patches/moovida-01-g11n-localedir.diff
changeset 1971 768eff0a01f2
parent 1964 2b057af19e2a
child 2037 1f29e76bd366
--- a/patches/moovida-01-g11n-localedir.diff	Tue Jul 21 06:09:03 2009 +0000
+++ b/patches/moovida-01-g11n-localedir.diff	Tue Jul 21 10:06:28 2009 +0000
@@ -1,6 +1,6 @@
---- elisa-1.0.5/elisa/core/utils/i18n.py-orig	2009-07-15 16:33:57.726981000 -0500
-+++ elisa-1.0.5/elisa/core/utils/i18n.py	2009-07-15 16:34:15.808682000 -0500
-@@ -89,8 +89,7 @@ def get_current_locale():
+--- 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
@@ -9,4 +9,18 @@
 +    i18n_dir = "/usr/share/locale"
  
      current_locale = get_current_locale()
-     fallback_locale = current_locale.split('_')[0]
+-    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: