Skip to content

Commit

Permalink
p/pronterface: Fix unknown wx locale (#1351)
Browse files Browse the repository at this point in the history
Function `wx.Locale.GetSystemLanguage` returns `wx.LANGUAGE_UNKNOWN`
when unable to identify the system's language. And `wx.Locale`
constructor does not allow `wx.LANGUAGE_UNKNOWN` as an argument.

Fixes #1345
Fixes #1348
  • Loading branch information
rockstorm101 committed May 13, 2023
1 parent cbf6d03 commit 9c16540
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion printrun/pronterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,10 @@ class PronterApp(wx.App):
def __init__(self, *args, **kwargs):
super(PronterApp, self).__init__(*args, **kwargs)
self.SetAppName("Pronterface")
self.locale = wx.Locale(wx.Locale.GetSystemLanguage())
lang = wx.Locale.GetSystemLanguage()
# Fall back to English if unable to determine language
if lang == wx.LANGUAGE_UNKNOWN:
lang = wx.LANGUAGE_ENGLISH_US
self.locale = wx.Locale(lang)
self.mainwindow = PronterWindow(self)
self.mainwindow.Show()

0 comments on commit 9c16540

Please sign in to comment.