Skip to content

Commit 26d6ed1

Browse files
committed
Fix locale bug.
bump version to 0.8.6
1 parent 24b45d2 commit 26d6ed1

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

designer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
from wx.lib.mixins.inspection import InspectionMixin
2626
from stackExporter import StackExporter
2727

28-
# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
29-
import locale
30-
locale.setlocale(locale.LC_ALL, 'C')
31-
3228
HERE = os.path.dirname(os.path.realpath(__file__))
3329

3430
# ----------------------------------------------------------------------
@@ -721,7 +717,7 @@ def ReadConfig(self):
721717
class DesignerApp(wx.App, InspectionMixin):
722718
def OnInit(self):
723719
self.Init() # for InspectionMixin
724-
720+
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
725721
self.frame = DesignerFrame(None)
726722
self.frame.app = self
727723
self.frame.Show(True)
@@ -745,7 +741,7 @@ def MacReopenApp(self):
745741

746742
if __name__ == '__main__':
747743
app = DesignerApp(redirect=False)
748-
app.InitLocale()
744+
749745
if len(sys.argv) > 1:
750746
filename = sys.argv[1]
751747
app.frame.ReadFile(filename)

standalone.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
from findEngineViewer import FindEngine
2222
from wx.lib.mixins.inspection import InspectionMixin
2323

24-
# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
25-
import locale
26-
locale.setlocale(locale.LC_ALL, 'C')
27-
2824
ID_MENU_FIND = wx.NewIdRef()
2925
ID_MENU_FIND_SEL = wx.NewIdRef()
3026
ID_MENU_FIND_NEXT = wx.NewIdRef()
@@ -271,7 +267,7 @@ def RunAllSetupHandlers(model):
271267
class StandaloneApp(wx.App, InspectionMixin):
272268
def OnInit(self):
273269
self.Init(self) # for InspectionMixin
274-
270+
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
275271
self.SetAppDisplayName('CardStock')
276272

277273
bundle_dir = sys._MEIPASS
@@ -319,5 +315,4 @@ def MacReopenApp(self):
319315

320316
if __name__ == '__main__':
321317
app = StandaloneApp(redirect=False)
322-
app.InitLocale()
323318
app.MainLoop()

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION='0.8.5'
1+
VERSION='0.8.6'

viewer.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
from findEngineViewer import FindEngine
2222
from wx.lib.mixins.inspection import InspectionMixin
2323

24-
# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
25-
import locale
26-
locale.setlocale(locale.LC_ALL, 'C')
27-
2824
HERE = os.path.dirname(os.path.abspath(__file__))
2925

3026
ID_MENU_FIND = wx.NewIdRef()
@@ -306,7 +302,7 @@ def RunAllSetupHandlers(model):
306302
class ViewerApp(wx.App, InspectionMixin):
307303
def OnInit(self):
308304
self.Init(self) # for InspectionMixin
309-
305+
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
310306
self.SetAppDisplayName('CardStock')
311307
self.frame = None
312308

@@ -361,7 +357,6 @@ def MacReopenApp(self):
361357

362358
if __name__ == '__main__':
363359
app = ViewerApp(redirect=False)
364-
app.InitLocale()
365360
if len(sys.argv) > 1:
366361
filename = sys.argv[1]
367362
app.OpenFile(filename)

0 commit comments

Comments
 (0)