beremiz

Parents aa5a08d20ba1
Children d3fb687dd0b9
Adding support for disable language translation when default language not available in locale
  • +6 -1
    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)