On Sat, 23 Jul 2022 20:08:53 -0700 (PDT) LIANG ZHOU wrote:
LZ> I'm using wxWidgets 3.1.6 on macOS. wxMessageBox cannot show button lables
LZ> using the current system language(Simplified Chinese) automatically, even
LZ> the dialogs sample always show labels in English. Calling
LZ> m_locale.Init(wxLANGUAGE_CHINESE_SIMPLIFIED) in wxApp's Init method shows
LZ> an error message during app launch.
Unfortunately you can't change locale during run-time under macOS, this is
a system limitation and there is nothing we can do about it -- this is why
we've added wxUILocale in 3.2, which can just be used to opt-in using the
system language. As mentioned in wxUILocale docs, you also have to list the
languages your application supports in its Info.plist file, which is not
the case for the dialogs sample.
LZ> I don't need multi-language support in my app. I just want the message
LZ> boxes to behave in the same way like on Windows. Thanks!
Please check using wxUILocale and appropriate Info.plist file. If it still
doesn't work, it would be a bug -- please open an issue for it then.
TT-Solutions: wxWidgets consultancy and technical support