Skip to content

Commit

Permalink
Fix locale bug.
Browse files Browse the repository at this point in the history
bump version to 0.8.6
  • Loading branch information
benjie-git committed Mar 24, 2021
1 parent 24b45d2 commit 26d6ed1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
8 changes: 2 additions & 6 deletions designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
from wx.lib.mixins.inspection import InspectionMixin
from stackExporter import StackExporter

# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
import locale
locale.setlocale(locale.LC_ALL, 'C')

HERE = os.path.dirname(os.path.realpath(__file__))

# ----------------------------------------------------------------------
Expand Down Expand Up @@ -721,7 +717,7 @@ def ReadConfig(self):
class DesignerApp(wx.App, InspectionMixin):
def OnInit(self):
self.Init() # for InspectionMixin

self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
self.frame = DesignerFrame(None)
self.frame.app = self
self.frame.Show(True)
Expand All @@ -745,7 +741,7 @@ def MacReopenApp(self):

if __name__ == '__main__':
app = DesignerApp(redirect=False)
app.InitLocale()

if len(sys.argv) > 1:
filename = sys.argv[1]
app.frame.ReadFile(filename)
Expand Down
7 changes: 1 addition & 6 deletions standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
from findEngineViewer import FindEngine
from wx.lib.mixins.inspection import InspectionMixin

# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
import locale
locale.setlocale(locale.LC_ALL, 'C')

ID_MENU_FIND = wx.NewIdRef()
ID_MENU_FIND_SEL = wx.NewIdRef()
ID_MENU_FIND_NEXT = wx.NewIdRef()
Expand Down Expand Up @@ -271,7 +267,7 @@ def RunAllSetupHandlers(model):
class StandaloneApp(wx.App, InspectionMixin):
def OnInit(self):
self.Init(self) # for InspectionMixin

self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
self.SetAppDisplayName('CardStock')

bundle_dir = sys._MEIPASS
Expand Down Expand Up @@ -319,5 +315,4 @@ def MacReopenApp(self):

if __name__ == '__main__':
app = StandaloneApp(redirect=False)
app.InitLocale()
app.MainLoop()
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION='0.8.5'
VERSION='0.8.6'
7 changes: 1 addition & 6 deletions viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
from findEngineViewer import FindEngine
from wx.lib.mixins.inspection import InspectionMixin

# Fix locale error with wxPython, python3.8+, and Windows on a non-engligh locale.
import locale
locale.setlocale(locale.LC_ALL, 'C')

HERE = os.path.dirname(os.path.abspath(__file__))

ID_MENU_FIND = wx.NewIdRef()
Expand Down Expand Up @@ -306,7 +302,7 @@ def RunAllSetupHandlers(model):
class ViewerApp(wx.App, InspectionMixin):
def OnInit(self):
self.Init(self) # for InspectionMixin

self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
self.SetAppDisplayName('CardStock')
self.frame = None

Expand Down Expand Up @@ -361,7 +357,6 @@ def MacReopenApp(self):

if __name__ == '__main__':
app = ViewerApp(redirect=False)
app.InitLocale()
if len(sys.argv) > 1:
filename = sys.argv[1]
app.OpenFile(filename)
Expand Down

0 comments on commit 26d6ed1

Please sign in to comment.