? plugins/artdisplay/Makefile
? plugins/artdisplay/Makefile.in
? plugins/artdisplay/artdisplay.rb-plugin
? plugins/ipod/Makefile
? plugins/ipod/Makefile.in
? plugins/ipod/ipod.rb-plugin
Index: plugins/artdisplay/artdisplay.py
===================================================================
RCS file: /cvs/gnome/rhythmbox/plugins/artdisplay/artdisplay.py,v
retrieving revision 1.3
diff -p -u -r1.3 artdisplay.py
--- plugins/artdisplay/artdisplay.py	1 May 2006 14:13:22 -0000	1.3
+++ plugins/artdisplay/artdisplay.py	1 May 2006 14:44:25 -0000
@@ -24,16 +24,17 @@ import rhythmdb, rb
 import gobject, gtk
 import os, re
 import urllib
+import locale
 
 LICENSE_KEY = "18C3VZN9HCECM5G3HQG2"
-LOCALE = "us"
+DEFAULT_LOCALE = "us"
 ASSOCIATE = "webservices-20"
 
 _supportedLocales = {
-		"us" : ("us", "xml.amazon.com"),
-		"uk" : ("uk", "xml-eu.amazon.com"),
+		"en_US" : ("us", "xml.amazon.com"),
+		"en_GB" : ("uk", "xml-eu.amazon.com"),
 		"de" : ("de", "xml-eu.amazon.com"),
-		"jp" : ("jp", "xml.amazon.co.jp")
+		"ja" : ("jp", "xml.amazon.co.jp")
 	}
 
 class AmazonError (Exception): pass
@@ -249,15 +250,29 @@ class ArtDisplayPlugin (rb.Plugin):
 				rc = rc.replace (',', '')
 				rc = int (rc)
 		return rc
+
+	def get_locale (self):
+		default = locale.getdefaultlocale ()
+		lc_id = DEFAULT_LOCALE
+		if default[0] is not None:
+			if _supportedLocales.has_key (default[0]):
+				lc_id = default[0]
+				
+		lc_host = _supportedLocales[lc_id][1]
+		lc_name = _supportedLocales[lc_id][0]
+		return ((lc_host, lc_name))
 	
 	def buildURL (self, keyword):
-		url = "http://" + _supportedLocales[LOCALE][1] + "/onca/xml3?f=xml"
+		(lc_host, lc_name) = self.get_locale ()
+
+		url = "http://" + lc_host + "/onca/xml3?f=xml"
 		url += "&t=%s" % ASSOCIATE
 		url += "&dev-t=%s" % LICENSE_KEY
 		url += "&type=%s" % 'lite'
-		url += "&locale=%s" % _supportedLocales[LOCALE][0]
+		url += "&locale=%s" % lc_name
 		url += "&mode=%s" % 'music'
 		url += "&%s=%s" % ('KeywordSearch', urllib.quote (keyword))
+		
 		return url
 
 	def search (self, keyword):
