util/TranslationCatalogs.py
changeset 1813 c18adf359d21
parent 1806 6b4d0f4f2fbc
child 1838 646245c1c0d9
--- a/util/TranslationCatalogs.py	Fri Sep 15 20:05:41 2017 +0300
+++ b/util/TranslationCatalogs.py	Fri Sep 15 20:28:54 2017 +0300
@@ -26,11 +26,7 @@
 import __builtin__
 import wx
 
-# Get the default language
-langid = wx.LANGUAGE_DEFAULT
-
-# Define locale for wx
-locale = wx.Locale(langid)
+locale = None
 
 
 __builtin__.__dict__['_'] = wx.GetTranslation
@@ -53,6 +49,11 @@
     if os.path.exists(locale_dir) and os.path.isdir(locale_dir):
         domain = GetDomain(locale_dir)
         if domain is not None:
+            global locale
+            if locale is None:
+                # Define locale for wx
+                locale = wx.Locale(wx.LANGUAGE_DEFAULT)
+
             locale.AddCatalogLookupPathPrefix(locale_dir)
             locale.AddCatalog(domain)