Commit cb2ac4366710ca785c928c91f89cb4015c69ae0a
1 parent
66691ea9
Exists in
master
and in
6 other branches
ENH: Applied patch by Paulo Cesar Pereira de Andrade - mandriva-locale.patch
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
invesalius/i18n.py
@@ -47,8 +47,10 @@ def GetLocaleOS(): | @@ -47,8 +47,10 @@ def GetLocaleOS(): | ||
47 | if sys.platform == 'darwin': | 47 | if sys.platform == 'darwin': |
48 | locale.setlocale(locale.LC_ALL, "") | 48 | locale.setlocale(locale.LC_ALL, "") |
49 | return locale.getlocale()[0] | 49 | return locale.getlocale()[0] |
50 | - | ||
51 | - return locale.getdefaultlocale()[0] | 50 | + lc = locale.getdefaultlocale()[0] |
51 | + if lc: | ||
52 | + return lc | ||
53 | + return 'en' | ||
52 | 54 | ||
53 | def InstallLanguage(language): | 55 | def InstallLanguage(language): |
54 | language_dir = os.path.abspath(os.path.join('..','locale')) | 56 | language_dir = os.path.abspath(os.path.join('..','locale')) |