Index: paneldelegate.py
===================================================================
--- paneldelegate.py	(revision 689)
+++ paneldelegate.py	(working copy)
@@ -21,6 +21,8 @@
 import gconfsource
 import subprocess
 import bonobo
+import exceptions
+from ConfigParser import ConfigParser
 
 try:
     import userprofile
@@ -34,6 +36,68 @@
 def dprint (fmt, *args):
     util.debug_print (util.DEBUG_PANELDELEGATE, fmt % args)
 
+def insert_unique(l, e):
+    try:
+        l.index(e)
+    except exceptions.ValueError:
+        l.append(e)
+
+# Inspired by the function g_get_language_names() in glib (gutils.c)
+# For reference, the is X/Open format locale format is language[_territory][.codeset][@modifier] 
+def get_language_names():
+    vars = ['LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG']
+    l = []
+
+    for v in vars:
+        tmp = os.getenv(v)
+
+        if tmp:
+            tmplist = tmp.split(':')
+            for i in tmplist:
+                language = ""
+                territory = ""
+                codeset = ""
+                modifier = ""
+                
+                if i.find('@') > -1:
+                    modifier = '@'+i.split('@')[1]
+                    i = i.split('@')[0]
+
+                if i.find('.') > -1:
+                    codeset = '.'+i.split('.')[1]
+                    i = i.split('.')[0]
+
+                if i.find('_') > -1:
+                    territory = '_'+i.split('_')[1]
+                    i = i.split('_')[0]
+
+                language = i
+
+                # Now append the various combinations into the list, from the most desirable to the least
+                c = language+territory+codeset+modifier
+                insert_unique(l, c)
+                c = language+territory+modifier
+                insert_unique(l, c)
+                c = language+codeset+modifier
+                insert_unique(l, c)
+                c = language+modifier
+                insert_unique(l, c)
+                c = language+territory+codeset
+                insert_unique(l, c)
+                c = language+territory
+                insert_unique(l, c)
+                c = language+codeset
+                insert_unique(l, c)
+                insert_unique(l, language)
+                #FIXME: There must be a saner way to the above
+
+            l.append('C')
+            return l
+
+    l.append('C') # System is really really broken!!
+    return l
+
+
 PANEL_LAUNCHER_DIR = ".gnome2/panel2.d/default/launchers"
 
 class PanelChange (userprofile.ProfileChange):
@@ -204,10 +268,20 @@
 				desktop_file = launcher_location[7:]
 			else:
 				desktop_file = PANEL_LAUNCHER_DIR + "/" + launcher_location
+			c = ConfigParser()
+			c.read(desktop_file)
+			langs = get_language_names()
+			for lang in langs:
+				if lang == 'C': # We have reached the very end :-(
+					option = 'name'
+				else:
+					option = ("name[%s]") %lang
 
-                        # FIXME: we need to use xdg.DesktopEntry to extract the localized name
-                        # http://bugzilla.gnome.org/show_bug.cgi?id=397742
-                        self.name = _("%s launcher") % launcher_location
+				if c.has_option('Desktop Entry', option) == True:
+					appname = c.get('Desktop Entry', option)
+					break
+
+			self.name = _("%s launcher") %appname
 		elif self.object_type == "action-applet":
 			action_type = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/action_type")
 			if action_type == "lock":
