[orca] Fix for traceback when switching back to English profile
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for traceback when switching back to English profile
- Date: Sun, 16 Jun 2013 23:04:56 +0000 (UTC)
commit 0d8e0cc60990a4276c41aa9424a87b1c7b8bd7b0
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 04e3613..781942c 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]