It does look very much related, all these strings are set in the same method, the constructor for PaletteBox, see mscore/palettebox.cpp, line 28 ff
I failed to see how to fix that other issue, so I do for this one
The issue is with the latest nightly, check the Palettes windows, the title "Palettes" and the toolTips for the workspace selection popup and the 'add workspace' button are not getting translated
I still do not know why the function tr() defined through the Q_OBJECT macro does not work in this case (while it works in other cases), but I think we have a possible work-around if we use the function:
QCoreApplication::translate("context", "sourceText")
I tried with QCoreApplication::translate("Ms::PaletteBox", "Palettes") instead of tr("Palettes") and lupdate (this command took more than 2 hours to complete!) and the output .ts files do contain the proper context and therefore the translation is properly read from the qm files (after compilation).
As a side note, lupdate gave some warnings/errors:
/home/antonio/MuseScore_official/mscore/scoretab.h:84: Excess closing brace in C++ code (or abuse of the C++ preprocessor)
/home/antonio/MuseScore_official/libmscore/chordline.cpp:23: Class 'Ms' lacks Q_OBJECT macro
/home/antonio/MuseScore_official/libmscore/dsp.h:68: Excess closing parenthesis in C++ code (or abuse of the C++ preprocessor)
/home/antonio/MuseScore_official/libmscore/dsp.cpp:108: Excess closing brace in C++ code (or abuse of the C++ preprocessor)
/home/antonio/MuseScore_official/mscore/drumroll.cpp:61: Qualifying with unknown namespace/class ::DrumrollEditor
/home/antonio/MuseScore_official/mscore/drumroll.cpp:195: Qualifying with unknown namespace/class ::DrumrollEditor
/home/antonio/MuseScore_official/mscore/palettebox.cpp:29: Qualifying with unknown namespace/class ::PaletteBox
/home/antonio/MuseScore_official/mscore/palettebox.cpp:216: Qualifying with unknown namespace/class ::PaletteBox
/home/antonio/MuseScore_official/mscore/pianoroll.cpp:53: Qualifying with unknown namespace/class ::PianorollEditor
/home/antonio/MuseScore_official/mscore/pianoroll.cpp:251: Qualifying with unknown namespace/class ::PianorollEditor
/home/antonio/MuseScore_official/mscore/scoreaccessibility.cpp:36: Class 'Ms::AccessibleScoreView' lacks Q_OBJECT macro
I can't understand the first one (I think the number of braces is correct in scoretab.h).
The second one does not probably originate problems (but I didn't check).
The third and fourth are true errors: there is a missing opening brace in dsp.h and an extra closing brace in dsp.cpp.
The fifth up to the tenth are the cause of the missing translations: indeed, also the drumroll and pianoroll do not show the translated strings. For all of these we could use QCoreApplication::translate("Ms::nameoftheclass", string-to-be-translated)
I don't know if the last warning is an actual problem or something we can safely ignore.
I though about such or a simular a workaround myself too, but I think we should rather find and fix the root cause?
on the 1st error: maybe lupdate is thrown off by the lacking space between #include and "musescore.h"? Or by something inside musescore.h?
2nd
3rd and 4th probably don't matter, they don't seem to be used at all, or do they? Fixing them won't harm though
11th should be an easy fix, whether needed or not. And/or might be caused by the #include not being separated by a space from the <...> (see above)
I think that the root cause could be the fact that the .h files are not including GUI .h files, but I am not 100% sure.
> on the 1st error: maybe lupdate is thrown off by the lacking space between #include and "musescore.h"?
It seems to be exactly this. Good catch!
> 3rd and 4th probably don't matter, they don't seem to be used at all, or do they? Fixing them won't harm though
Indeed, if I understood correctly, dsp.h is not called by other files (other than dsp.cpp). Should these two files be deleted from git?
Comments
I'll have a look, might be related to #31321: The term "Palettes" doesn't get used in its translated form?
It does look very much related, all these strings are set in the same method, the constructor for PaletteBox, see mscore/palettebox.cpp, line 28 ff
I failed to see how to fix that other issue, so I do for this one
Daniel, which MuseScore version are you using? If not a nightly build, please download and use a nightly build: http://musescore.org/en/download#nightly
The issue is with the latest nightly, check the Palettes windows, the title "Palettes" and the toolTips for the workspace selection popup and the 'add workspace' button are not getting translated
Thomas, sorry, I forgot to mention which version I'm using. It's MuseScore nightly rev. 85b4130 on Windows 7
I still do not know why the function tr() defined through the Q_OBJECT macro does not work in this case (while it works in other cases), but I think we have a possible work-around if we use the function:
QCoreApplication::translate("context", "sourceText")
I tried with QCoreApplication::translate("Ms::PaletteBox", "Palettes") instead of tr("Palettes") and lupdate (this command took more than 2 hours to complete!) and the output .ts files do contain the proper context and therefore the translation is properly read from the qm files (after compilation).
As a side note, lupdate gave some warnings/errors:
I can't understand the first one (I think the number of braces is correct in scoretab.h).
The second one does not probably originate problems (but I didn't check).
The third and fourth are true errors: there is a missing opening brace in dsp.h and an extra closing brace in dsp.cpp.
The fifth up to the tenth are the cause of the missing translations: indeed, also the drumroll and pianoroll do not show the translated strings. For all of these we could use QCoreApplication::translate("Ms::nameoftheclass", string-to-be-translated)
I don't know if the last warning is an actual problem or something we can safely ignore.
Proposed PR:
https://github.com/musescore/MuseScore/pull/1427
Excellent analysis!
I though about such or a simular a workaround myself too, but I think we should rather find and fix the root cause?
on the 1st error: maybe lupdate is thrown off by the lacking space between #include and "musescore.h"? Or by something inside musescore.h?
2nd
3rd and 4th probably don't matter, they don't seem to be used at all, or do they? Fixing them won't harm though
11th should be an easy fix, whether needed or not. And/or might be caused by the #include not being separated by a space from the <...> (see above)
I think that the root cause could be the fact that the .h files are not including GUI .h files, but I am not 100% sure.
> on the 1st error: maybe lupdate is thrown off by the lacking space between #include and "musescore.h"?
It seems to be exactly this. Good catch!
> 3rd and 4th probably don't matter, they don't seem to be used at all, or do they? Fixing them won't harm though
Indeed, if I understood correctly, dsp.h is not called by other files (other than dsp.cpp). Should these two files be deleted from git?
ABL's PR #1427
I had a go at the (remaining) lupdate issues in PR #1432
Fixed in 1ab1216031
Automatically closed -- issue fixed for 2 weeks with no activity.