diff --git a/app.py b/app.py index 9bc80ea..8eaa0f3 100644 --- a/app.py +++ b/app.py @@ -178,7 +178,10 @@ class SplashScreen(wx.SplashScreen): if lang: # print "LANG", lang, _, wx.Locale(), wx.GetLocale() import locale - locale.setlocale(locale.LC_ALL, '') + try: + locale.setlocale(locale.LC_ALL, '') + except locale.Error: + pass # For pt_BR, splash_pt.png should be used if (lang.startswith('pt')): icon_file = "splash_pt.png" diff --git a/invesalius/gui/language_dialog.py b/invesalius/gui/language_dialog.py index 9d9d153..55538ab 100644 --- a/invesalius/gui/language_dialog.py +++ b/invesalius/gui/language_dialog.py @@ -56,7 +56,10 @@ class ComboBoxLanguage: # Find out OS locale self.os_locale = i18n.GetLocaleOS() - os_lang = self.os_locale[0:2] + try: + os_lang = self.os_locale[0:2] + except TypeError: + os_lang = None # Default selection will be English selection = self.locales_key.index('en') @@ -70,7 +73,7 @@ class ComboBoxLanguage: # Add bitmap and info to Combo bitmapCmb.Append(dict_locales[key], bmp, key) # Set default combo item if available on the list - if key.startswith(os_lang): + if os_lang and key.startswith(os_lang): selection = self.locales_key.index(key) bitmapCmb.SetSelection(selection) -- libgit2 0.21.2