[orca/gnome-3-8] Fix for traceback when switching back to English profile



commit b1d44d6a4fe8b1875467e51915db2e796514d2f9
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Jun 16 19:04:38 2013 -0400

    Fix for traceback when switching back to English profile

 src/orca/orca_i18n.py.in |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/orca_i18n.py.in b/src/orca/orca_i18n.py.in
index cd7b53e..1631b27 100644
--- a/src/orca/orca_i18n.py.in
+++ b/src/orca/orca_i18n.py.in
@@ -57,16 +57,15 @@ def C_(ctx, s):
 def setModuleLocale(moduleName, newLocale=None):
     global _, ngettext, cgettext
 
-    if not newLocale:
-        _ = gettext.gettext
-        ngettext = gettext.ngettext
-        cgettext = gettext.gettext
-    else:
+    try:
         translation = gettext.translation('orca', localedir, languages=[newLocale])
         _ = translation.gettext
         ngettext = translation.ngettext
         cgettext = translation.gettext
-
+    except:
+        _ = gettext.gettext
+        ngettext = gettext.ngettext
+        cgettext = gettext.gettext
     module = sys.modules.get(moduleName)
     if module:
         imp.reload(module)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]