wxMessageBox button labels are not translated

46 views
Skip to first unread message

LIANG ZHOU

unread,
Jul 23, 2022, 11:08:53 PM7/23/22
to wx-users
Hi,
I'm using wxWidgets 3.1.6 on macOS. wxMessageBox cannot show button lables using the current system language(Simplified Chinese) automatically, even the dialogs sample always show labels in English. Calling m_locale.Init(wxLANGUAGE_CHINESE_SIMPLIFIED) in wxApp's Init method shows an error message during app launch. I don't need multi-language support in my app. I just want the message boxes to behave in the same way like on Windows. Thanks!

Leo

Igor Korot

unread,
Jul 24, 2022, 1:21:39 AM7/24/22
to wx-u...@googlegroups.com
Hi,

On Sat, Jul 23, 2022 at 10:08 PM LIANG ZHOU <zhouli...@gmail.com> wrote:
>
> Hi,
> I'm using wxWidgets 3.1.6 on macOS. wxMessageBox cannot show button lables using the current system language(Simplified Chinese) automatically, even the dialogs sample always show labels in English. Calling m_locale.Init(wxLANGUAGE_CHINESE_SIMPLIFIED) in wxApp's Init method shows an error message during app launch. I don't need multi-language support in my app. I just want the message boxes to behave in the same way like on Windows. Thanks!

I presume your Mac supports that locale?
Out of curiosity - what is the default locale set on the machine?

Thank you.

>
> Leo
>
> --
> Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
> ---
> You received this message because you are subscribed to the Google Groups "wx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/8f6b8f68-6ecb-4d3e-973c-fdd825e2f7dcn%40googlegroups.com.

Vojtěch Bubník

unread,
Jul 24, 2022, 1:23:47 AM7/24/22
to wx-u...@googlegroups.com
BTW Liang Zhou is one of the authors of 
which is a reskinned PrusaSlicer modified for the new BambuLab ecosystem.

They rely heavily on custom rendering of wxWidgets controls. I recommend everyone to look into their wxWidgets skinning, some of the ideas may propagate to upstream wxWidgets and I urge BambuLab to contribute.


When I saw the application for the first time, I thought it is a qtQuick application and I applauded BambuLab for rewriting the UI completely. I was very surprised that such an elegant skin is even possible with wxWidgets. Namely Win32 controls look quite archaic on Windows and for example the various radio button skins of Bambu Studio look refreshing.


Vojtech




--

Vadim Zeitlin

unread,
Jul 24, 2022, 9:54:31 AM7/24/22
to wx-u...@googlegroups.com
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.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Vadim Zeitlin

unread,
Jul 24, 2022, 10:02:33 AM7/24/22
to wx-u...@googlegroups.com
On Sun, 24 Jul 2022 07:23:33 +0200 Vojtěch Bubník wrote:

VB> BTW Liang Zhou is one of the authors of
VB> https://github.com/bambulab/BambuStudio
VB> which is a reskinned PrusaSlicer modified for the new BambuLab ecosystem.
VB>
VB> They rely heavily on custom rendering of wxWidgets controls. I recommend
VB> everyone to look into their wxWidgets skinning, some of the ideas may
VB> propagate to upstream wxWidgets and I urge BambuLab to contribute.

Sure, let me extend the invitation to contribute your changes.

VB> https://www.bambulab.com/en/download

Sorry, are there some screenshots somewhere, just to see what are we
speaking about?

VB> https://www.youtube.com/watch?v=Svt4yl7JiZ4

(if possible not in video form)

Thanks,

Kenneth Porter

unread,
Jul 24, 2022, 4:48:36 PM7/24/22
to wx-u...@googlegroups.com
--On Sunday, July 24, 2022 4:56 PM +0200 Vadim Zeitlin
<va...@wxwidgets.org> wrote:

> Sorry, are there some screenshots somewhere, just to see what are we
> speaking about?
>
> VB> https://www.youtube.com/watch?v=Svt4yl7JiZ4
>
> (if possible not in video form)

I loaded the video and just skipped around in it to look at various screens
in the app. It reminds me a lot of Node-RED in Chrome, a web app for
managing home automation devices. (I use it to time my cats' auto-feeder
using an Ikea hub and remote outlet.) The Bambu titlebar looks like the
minimized header of Chrome, Firefox, and Thunderbird, with the menu moved
up into the titlebar to conserve screen space. The main panel is a tabbed
notebook with tabs across the top like a browser.

I'd love to know more about how he did this. My own app to run a multi-axis
motion system is full of controls and is tight for screen real estate when
run on a 1280x1024 screen (the standard in our testing area, as bench space
is also tight). So squeezing more stuff in a small screen and still making
it look good would be valuable to me.

Oleksandra Iushchenko

unread,
Jul 26, 2022, 3:48:11 AM7/26/22
to wx-users

VB> Sorry, are there some screenshots somewhere, just to see what are we
VB>  speaking about?

Sure. Here is a Screenshot of main screen and some of the Dialog with skinned controls

Bambus_ssh.jpg

Some of them are just inherited from the library's controls and skinned using their own bitmaps.
But for example, TextInput which is used for extended TextControls, SpinControls and even in ComboBox I would like to see in wxWidgets.
I think it's good idea which can be used by other UI-programmers.

= Oleksandra


неділя, 24 липня 2022 р. о 16:02:33 UTC+2 Vadim Zeitlin пише:

Vadim Zeitlin

unread,
Jul 26, 2022, 10:14:23 AM7/26/22
to wx-u...@googlegroups.com
On Tue, 26 Jul 2022 00:48:11 -0700 (PDT) Oleksandra Iushchenko wrote:

OI> Sure. Here is a Screenshot of main screen and some of the Dialog with
OI> skinned controls
OI> Bambus_ssh.jpg

Thanks!

OI> Some of them are just inherited from the library's controls and skinned
OI> using their own bitmaps.

Yes, this seems like a kind of hybrid wxUniv reimplementation.

OI> But for example, TextInput which is used for extended TextControls,
OI> SpinControls and even in ComboBox I would like to see in wxWidgets.
OI> I think it's good idea which can be used by other UI-programmers.

Considering the way all these custom controls just inherit from wxWindow,
it should be possible to reuse them without any problem, but this is going
to be impossible to integrate into wx itself as is because of the licence
considerations, as this code is under AGPL-3.0.

If the original developers of this code could consider implementing it as
a wxUniv theme and relicensing it under wx licence, it would be great, but
this would require some effort.

Regards,
Reply all
Reply to author
Forward
0 new messages