Thread 'English display in French version'

Message boards : BOINC Manager : English display in French version
Message board moderation

To post messages, you must log in.

AuthorMessage
Philippe

Send message
Joined: 31 Jul 18
Posts: 9
France
Message 88444 - Posted: 14 Oct 2018, 15:18:26 UTC

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").

ID: 88444 · Report as offensive
ProfileJord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15560
Netherlands
Message 88452 - Posted: 15 Oct 2018, 13:13:05 UTC - in response to Message 88444.  
Last modified: 15 Oct 2018, 13:31:57 UTC

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.
ID: 88452 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5128
United Kingdom
Message 88454 - Posted: 15 Oct 2018, 16:18:07 UTC

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.
ID: 88454 · Report as offensive
ProfileJord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15560
Netherlands
Message 88455 - Posted: 15 Oct 2018, 16:44:04 UTC - in response to Message 88454.  

ID: 88455 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 88456 - Posted: 15 Oct 2018, 18:59:24 UTC - in response to Message 88455.  
Last modified: 15 Oct 2018, 19:30:54 UTC

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: https://docs.wxwidgets.org/3.0/page_translations.html https://github.com/wxWidgets/wxWidgets/tree/WX_3_0_BRANCH/locale (those seem to be the source files that we can use to compile mo files and include them with the Windows installer.
ID: 88456 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5128
United Kingdom
Message 88458 - Posted: 15 Oct 2018, 19:34:28 UTC - in response to Message 88456.  

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.
ID: 88458 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 88501 - Posted: 17 Oct 2018, 13:57:26 UTC

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.
ID: 88501 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 801
Finland
Message 88503 - Posted: 17 Oct 2018, 20:23:00 UTC

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.
ID: 88503 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 88506 - Posted: 18 Oct 2018, 5:29:27 UTC

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.
ID: 88506 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 801
Finland
Message 88507 - Posted: 18 Oct 2018, 16:22:48 UTC - in response to Message 88506.  

#ifdef THESE_STRINGS_ARE_FOR_GETTEXT ?
ID: 88507 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 88508 - Posted: 18 Oct 2018, 16:44:20 UTC - in response to Message 88507.  

#ifdef THESE_STRINGS_ARE_FOR_GETTEXT ?

Yes, that works. The gettext parser ignores those.
ID: 88508 · Report as offensive

Message boards : BOINC Manager : English display in French version

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.