Skip to content

Commit

Permalink
Added fallback to en_US locale for wxWidgets.
Browse files Browse the repository at this point in the history
- Fixes #493
  • Loading branch information
set-soft committed May 26, 2021
1 parent 838de14 commit 3b59811
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion kicost/kicost_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,18 @@ def kicost_gui(files=None):
'''
app = wx.App(redirect=False)
loc = wx.Locale(wx.LANGUAGE_DEFAULT)
locale_retry = False
if not loc.IsOk():
logger.warning(W_LOCFAIL+"Failed to set the locale")
logger.warning(W_LOCFAIL+"Failed to set the default locale")
locale_retry = True
elif not loc.GetLocale() and not loc.GetName():
logger.warning(W_LOCFAIL+"Unsupported locale")
locale_retry = True
if locale_retry:
loc = wx.Locale(wx.LANGUAGE_ENGLISH_US)
logger.warning(W_LOCFAIL+"Trying with US english locale")
if not loc.IsOk():
logger.warning(W_LOCFAIL+"Failed to set the en_US locale")
else:
logger.debug('wxWidgets locale {} ({}) system: {}'.format(loc.GetLocale(), loc.GetName(), locale.getlocale()))
frame = formKiCost(None)
Expand Down
2 changes: 1 addition & 1 deletion kicost/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.1.5'
__build__ = 'afec1c0-2021-05-24'
__build__ = '838de14-2021-05-24'

0 comments on commit 3b59811

Please sign in to comment.