Message boards : BOINC Manager : English display in French version
Message board moderation
Author | Message |
---|---|
Send message Joined: 31 Jul 18 Posts: 9 |
I write about a localized version, the French version. I write here for convenience in English but the menus appears of course in French. When you click on "Tools Menu", then "Add a project..." And then you click on Cancel button, you see below that the two buttons are not in French (not "Non" and "Oui" but in English "No" and "Yes"). |
Send message Joined: 29 Aug 05 Posts: 15560 |
Translations are done by volunteers. It's possible that this is a new thing, and I say that because I am the translator for Dutch and see that it does this in Dutch as well. I'll go hunt it down, thanks. Edit: I have just looked in Transifex, but they're not there either. So they're probably hard coded somewhere. I forwarded it to the translation developer. |
Send message Joined: 5 Oct 06 Posts: 5128 |
I was the last person to work on that page, and the event shown seems to be https://github.com/BOINC/boinc/blob/master/clientgui/ProjectInfoPage.cpp#L851 There's no BOINC code for that procedure call, so I assume we're relying on the default handlers provided by wxWidgets - I don't know how (if ever) we could shoehorn translations into it. |
Send message Joined: 29 Aug 05 Posts: 15560 |
From Christian Beer, look here: https://github.com/BOINC/boinc/blob/5dac399bec7445d46f7e4c4364e9665deca1277f/clientgui/WizardAttach.cpp#L605, so I guess it's WxWidgets doing it. |
Send message Joined: 4 Jul 12 Posts: 321 |
This seems to be an old problem: https://trac.wxwidgets.org/ticket/10962 but the bug report claims that this is fixed since wxWidgets 2.9 The place where this is called is: https://github.com/BOINC/boinc/blob/f368579c547c15a9bea0d3c0b6c235ae32123410/clientgui/BOINCGUIApp.cpp#L1268 So this should affect the cancel result dialog too. The real problem might be that we don't ship the default wxWidgets translation files "wxstd.mo". I found the files for wxWidgets 3.1: https://www.wxwidgets.org/about/translations/ but all I could find for 3.0 is this: |
Send message Joined: 5 Oct 06 Posts: 5128 |
Since we call a simple wxMessageBox within the safety wrapper, we could also follow https://docs.wxwidgets.org/3.0/classwx_message_dialog.html and the Public Member Functions like SetOKLabel and related. There seem to be only the most basic of state labels: Yes, No, OK, Cancel. If we put those into the safety wrapper, and our own translations into the existing files, we might be able to fix this with minimal coding and no extra files. |
Send message Joined: 4 Jul 12 Posts: 321 |
I agree with Richard. It seems better to replace wxMessageBox with wxMessageDialog like in the Trac ticket I linked too. This would look like this in our case I think: int CBOINCGUIApp::SafeMessageBox(const wxString& message, const wxString& caption, long style, wxWindow *parent, int x, int y ) { int retval; m_bSafeMessageBoxDisplayed++; wxPoint pos(...); wxMessageDialog dlg(parent, message, caption, style, pos); if (style contains wxOK) { //not sure is this is needed dlg.SetOKLabel(_("OK")); } retval = dlg.ShowModal(); m_bSafeMessageBoxDisplayed--; return retval; } I'm not sure if we need to test the styles used or if we could simply override all buttons even if they are not used. That must be tested. |
Send message Joined: 20 Nov 12 Posts: 801 |
Some thoughts. If you download wxWidgets source tarball from their website it includes compiled translations. Windows installer would need to be modified to install the files which would probably require Rom to do it and since Rom is not really actively involved in BOINC any more... I wonder what other strings we use from wxWidgets. Looking at the template I guess not all that many. Maybe a few error messages. All it really needs is making "Yes" and "No" visible to string scraping tool. There is clientgui/Localization.cpp,.h. Maybe not pretty but it's already in use. |
Send message Joined: 4 Jul 12 Posts: 321 |
Interesting thought. We could just add the basic strings to CBOINCGUIApp::SafeMessageBox(...) like this: int CBOINCGUIApp::SafeMessageBox(const wxString& message, const wxString& caption, long style, wxWindow *parent, int x, int y ) { int retval; wxString d1 = _("OK") + _("Cancel") + _("Yes") + _("No"); m_bSafeMessageBoxDisplayed++; retval = wxMessageBox(message, caption, style, parent, x, y); m_bSafeMessageBoxDisplayed--; return retval; } This will most likely trigger an unused variable warning but that can be handled later. |
Send message Joined: 20 Nov 12 Posts: 801 |
#ifdef THESE_STRINGS_ARE_FOR_GETTEXT ? |
Send message Joined: 4 Jul 12 Posts: 321 |
#ifdef THESE_STRINGS_ARE_FOR_GETTEXT ? Yes, that works. The gettext parser ignores those. |
Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.