I have a dialog with buttons that are created using the self.CreateButtonSizer(wx.OK | wx.CANCEL)
method.
import wx
class Dialog(wx.Dialog):
def __init__(self, parent):
super().__init__(parent)
self.btn_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
self.SetSizer(self.btn_sizer)
class Frame(wx.Frame):
def __init__(self):
super().__init__(None)
btn = wx.Button(self, -1, 'click')
def on_btn(e):
with Dialog(self) as dlg:
dlg.ShowModal()
btn.Bind(wx.EVT_BUTTON, on_btn)
app = wx.App()
Frame().Show()
app.MainLoop()
If I launch the application through PyCharm, then the text on the buttons is set in accordance with the localization parameters (Russian).
Then I build the application using pyinstaller:
py -3.7 C:\Python\Python37-32\Scripts\pyinstaller.exe .\wxapp.py
If you open the dialog in the assembled application, then the buttons display English text.
How to solve this problem?
Setting self.locale = wx.Locale(wx.LANGUAGE_RUSSIAN)
for wx.App
did not help.