Commit 73b26029b6de6b8e7d339003761988a0c6f71b62

Authored by tatiana
1 parent a88ca6a8

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 24 import locale
25 25 import gettext
26 26 import os
  27 +import sys
27 28  
28 29 import constants as const
29 30  
... ... @@ -36,8 +37,11 @@ def GetLocales():
36 37  
37 38 def GetLocaleOS():
38 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 46 def InstallLanguage(language):
43 47  
... ...