Commit 73b26029b6de6b8e7d339003761988a0c6f71b62
1 parent
a88ca6a8
Exists in
master
and in
68 other branches
FIX: i18n error in darwin (#52)
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
invesalius/i18n.py
@@ -24,6 +24,7 @@ import ConfigParser | @@ -24,6 +24,7 @@ import ConfigParser | ||
24 | import locale | 24 | import locale |
25 | import gettext | 25 | import gettext |
26 | import os | 26 | import os |
27 | +import sys | ||
27 | 28 | ||
28 | import constants as const | 29 | import constants as const |
29 | 30 | ||
@@ -36,8 +37,11 @@ def GetLocales(): | @@ -36,8 +37,11 @@ def GetLocales(): | ||
36 | 37 | ||
37 | def GetLocaleOS(): | 38 | def GetLocaleOS(): |
38 | """Return language of the operating system.""" | 39 | """Return language of the operating system.""" |
39 | - os_language = locale.getdefaultlocale()[0] | ||
40 | - return os_language | 40 | + if sys.platform == 'darwin': |
41 | + locale.setlocale(locale.LC_ALL, "") | ||
42 | + return locale.getlocale()[0] | ||
43 | + | ||
44 | + return locale.getdefaultlocale()[0] | ||
41 | 45 | ||
42 | def InstallLanguage(language): | 46 | def InstallLanguage(language): |
43 | 47 |