patches/moovida-01-g11n-localedir.diff
author yippi
Tue, 21 Jul 2009 10:06:28 +0000
changeset 1971 768eff0a01f2
parent 1964 2b057af19e2a
child 2037 1f29e76bd366
permissions -rw-r--r--
2009-07 21 Brian Cameron <[email protected]> * base-specs/moovida.spec, patches/moovida-01-g11n-localedir.diff, patches/moovida-04-fixlocale.diff, patches/moovida-05-pidof.diff: Merge patch 1 and 4. Add patch moovida-05-pidof.diff to fix bug #400134. * base-specs/moovida-plugins-good.spec: Update patch comment. * patches/moovida-plugins-good-02-solaris.diff: No longer mark GNOME plugin as working on Solaris since it depends on gnome-screensaver, which isn't yet integrated in Solaris. * patches/gnome-shell-01-launch.diff: Use pgrep.

--- elisa-1.0.5/elisa/core/utils/i18n.py-orig	2009-07-15 16:43:33.727389000 -0500
+++ elisa-1.0.5/elisa/core/utils/i18n.py	2009-07-21 03:26:46.895600000 -0500
@@ -89,14 +89,19 @@ def get_current_locale():
 def install_translation(plugin_name, plural = False):
     log_category = 'i18n'
     domain = 'elisa-plugin-%s' % plugin_name
-    i18n_dir = pkg_resources.resource_filename('elisa.plugins.%s' % plugin_name,
-                                               'i18n')
+    i18n_dir = "/usr/share/locale"
 
     current_locale = get_current_locale()
-    fallback_locale = current_locale.split('_')[0]
+    try:
+        fallback_locale = current_locale.split('_')[0]
+    except AttributeError:
+        fallback_locale = None
 
     try:
-        t = gettext.translation(domain, i18n_dir, languages=[current_locale, fallback_locale])
+        if current_locale == None:
+            t = gettext.translation(domain, i18n_dir)
+        else:
+            t = gettext.translation(domain, i18n_dir, languages=[current_locale,])
         translator = t.ugettext
         translator_plural = t.ungettext
     except IOError: