# HG changeset patch
# User laurent
# Date 1301566178 -7200
# Node ID 22e83880cdd989222a7b5308b34c4f9ad09a2932
# Parent  aa5a08d20ba1f8c91df880187b7da545d860c770
Adding support for disable language translation when default language not available in locale

diff -r aa5a08d20ba1 -r 22e83880cdd9 Beremiz.py
--- a/Beremiz.py	Mon Mar 28 11:42:06 2011 +0200
+++ b/Beremiz.py	Thu Mar 31 12:09:38 2011 +0200
@@ -118,7 +118,12 @@
 # Define locale for wx
 loc = __builtin__.__dict__.get('loc', None)
 if loc is None:
-    loc = wx.Locale(langid)
+    test_loc = wx.Locale(langid)
+    test_loc.AddCatalogLookupPathPrefix(localedir)
+    if test_loc.AddCatalog(domain):
+        loc = wx.Locale(langid)
+    else:
+        loc = wx.Locale(wx.LANGUAGE_ENGLISH)
     __builtin__.__dict__['loc'] = loc
 # Define location for searching translation files
 loc.AddCatalogLookupPathPrefix(localedir)