Index: paneldelegate.py
===================================================================
--- paneldelegate.py	(revision 689)
+++ paneldelegate.py	(working copy)
@@ -21,6 +21,7 @@
 import gconfsource
 import subprocess
 import bonobo
+from ConfigParser import ConfigParser
 
 try:
     import userprofile
@@ -34,6 +35,27 @@
 def dprint (fmt, *args):
     util.debug_print (util.DEBUG_PANELDELEGATE, fmt % args)
 
+# This is based on the function g_get_language_names() in glib (gutils.c)
+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:
+				l.append(i)
+				if (len(i) > 3): # The name has definitely got a territory part
+					l.append(i.split('_')[0])
+			l.append('C')
+			return l
+
+	l.append('C') # System must be really really broken!!
+	return l
+
+
 PANEL_LAUNCHER_DIR = ".gnome2/panel2.d/default/launchers"
 
 class PanelChange (userprofile.ProfileChange):
@@ -204,10 +226,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":
