From 37b589c7dc6dabda7af92aee294bfc9168738ffe Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 20 Feb 2014 13:54:40 -0800 Subject: [PATCH] Bug 7377 Ver 4.0.2 starts in East Asian Language Revert "GrampsLocale: Don't set to 'C' if LANG is en_US" This reverts commit bdd336f38e900a6a2e14c7cd441fba5aad733bec. It turns out that Gtk's having an 'en' translation isn't the only reason for doing this: GtkBuilder uses $LANGUAGE too, and will look for an english translation of strings in our Glade files. Since there's no en.po or en_US.po, it will go to the next language in the list and produce confusing results. --- gramps/gen/utils/grampslocale.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index fbc02608d..e6385ff90 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -441,7 +441,11 @@ class GrampsLocale(object): lang = '.'.join((check_lang[0], 'UTF-8')) os.environ["LANG"] = lang - os.environ["LANGUAGE"] = ':'.join([l for l in self.language]) + #We need to convert 'en' and 'en_US' to 'C' to avoid confusing + #GtkBuilder when it's retrieving strings from our Glade files + #since we have neither an en.po nor an en_US.po. + os.environ["LANGUAGE"] = ':'.join(['C' if l in ('en', 'en_US') else l + for l in self.language]) # GtkBuilder uses GLib's g_dgettext wrapper, which oddly is bound # with locale instead of gettext. Win32 doesn't support bindtextdomain.