Suppress message box in case current locale is unsupported or missing in wx
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 28 Sep 2018 12:54:14 +0300
changeset 2349 645eb1bce0a5
parent 2348 3a755d690398
child 2350 9f7028ab8294
Suppress message box in case current locale is unsupported or missing in wx

Beremiz can still be translated into it using own locales
available in './locale'.
Beremiz_service.py
util/TranslationCatalogs.py
--- a/Beremiz_service.py	Thu Sep 27 19:07:57 2018 +0300
+++ b/Beremiz_service.py	Fri Sep 28 12:54:14 2018 +0300
@@ -163,7 +163,9 @@
     # Define locale for wx
     loc = __builtin__.__dict__.get('loc', None)
     if loc is None:
+        wx.LogGui.EnableLogging(False)
         loc = wx.Locale(langid)
+        wx.LogGui.EnableLogging(True)
         __builtin__.__dict__['loc'] = loc
         # Define location for searching translation files
     loc.AddCatalogLookupPathPrefix(localedir)
--- a/util/TranslationCatalogs.py	Thu Sep 27 19:07:57 2018 +0300
+++ b/util/TranslationCatalogs.py	Fri Sep 28 12:54:14 2018 +0300
@@ -55,7 +55,9 @@
             global locale
             if locale is None:
                 # Define locale for wx
+                wx.LogGui.EnableLogging(False)
                 locale = wx.Locale(wx.LANGUAGE_DEFAULT)
+                wx.LogGui.EnableLogging(True)
 
             locale.AddCatalogLookupPathPrefix(locale_dir)
             locale.AddCatalog(domain)