-
Notifications
You must be signed in to change notification settings - Fork 3k
Return localized note name in pitchToString #30415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Return localized note name in pitchToString #30415
Conversation
src/framework/global/utils.cpp
Outdated
using namespace muse; | ||
|
||
static constexpr const char* noteNamesWithOctaves[] = { | ||
QT_TRANSLATE_NOOP("EditPitchBase", "C -1"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to change the context to something like global/pitchName
. Transifex will automatically fill in the strings in the new context based on the strings in the old context. Eventually we should get rid of EditPitch
, because it is an outdated QWidget-based dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also make the strings from editpitch.ui untranslatable to not end up with duplicates and/or superfluous effort to translators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downside: that won't pick up the existing translations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood correctly what @cbjeukendrup said, changing the context will make Transifex reuse the strings, so there should be minimal effort for translators.
If I would make the strings from editpitch.ui untranslatable, how would then they be displayed translated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(full) reuse only happens for same context, but the similarity check on transifex may copy the translation, so you'd only need to review. Still it'd be duplicate
Making them untranslatable in editpitch.ui indeed requires some extra code in editput.cpp to insert them
Partially resolves: musescore#30167 Show note+octave names using the default locale name from `EditPitchBase` strings. For this to work correctly, add all the possible note names in a translatable vector. Note that most of them are already present in `editpitch.ui` file (already translated), so this will reuse those strings and only add the missing ones for translators.
- Use `global/noteName` for note names - Use `global/pitchName` instead of `EditPitchBase` for note names with octaves.
7324bc6
to
cf08eb2
Compare
See also AmbitusSettings.qml, apparently also used for the Status bar, but lacking triple sharp/flat translations $ git diff
diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/ambituses/AmbitusSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/ambituses/AmbitusSettings.qml
index f49ea36d35..aa5a0d245f 100644
--- a/src/inspector/view/qml/MuseScore/Inspector/notation/ambituses/AmbitusSettings.qml
+++ b/src/inspector/view/qml/MuseScore/Inspector/notation/ambituses/AmbitusSettings.qml
@@ -42,41 +42,55 @@ Column {
spacing: 12
readonly property var tpcListModel: [
+ { text: qsTrc("global", "C♭♭♭"), value: AmbitusTypes.TPC_C_BBB },
{ text: qsTrc("global", "C♭♭"), value: AmbitusTypes.TPC_C_BB },
{ text: qsTrc("global", "C♭"), value: AmbitusTypes.TPC_C_B },
{ text: qsTrc("global", "C"), value: AmbitusTypes.TPC_C },
{ text: qsTrc("global", "C♯"), value: AmbitusTypes.TPC_C_S },
{ text: qsTrc("global", "C♯♯"), value: AmbitusTypes.TPC_C_SS },
+ { text: qsTrc("global", "C♯♯♯"), value: AmbitusTypes.TPC_C_SSS },
+ { text: qsTrc("global", "D♭♭♭"), value: AmbitusTypes.TPC_D_BBB },
{ text: qsTrc("global", "D♭♭"), value: AmbitusTypes.TPC_D_BB },
{ text: qsTrc("global", "D♭"), value: AmbitusTypes.TPC_D_B },
{ text: qsTrc("global", "D"), value: AmbitusTypes.TPC_D },
{ text: qsTrc("global", "D♯"), value: AmbitusTypes.TPC_D_S },
{ text: qsTrc("global", "D♯♯"), value: AmbitusTypes.TPC_D_SS },
+ { text: qsTrc("global", "D♯♯♯"), value: AmbitusTypes.TPC_D_SSS },
+ { text: qsTrc("global", "E♭♭♭"), value: AmbitusTypes.TPC_E_BBB },
{ text: qsTrc("global", "E♭♭"), value: AmbitusTypes.TPC_E_BB },
{ text: qsTrc("global", "E♭"), value: AmbitusTypes.TPC_E_B },
{ text: qsTrc("global", "E"), value: AmbitusTypes.TPC_E },
{ text: qsTrc("global", "E♯"), value: AmbitusTypes.TPC_E_S },
{ text: qsTrc("global", "E♯♯"), value: AmbitusTypes.TPC_E_SS },
+ { text: qsTrc("global", "E♯♯♯"), value: AmbitusTypes.TPC_E_SSS },
+ { text: qsTrc("global", "F♭♭♭"), value: AmbitusTypes.TPC_F_BBB },
{ text: qsTrc("global", "F♭♭"), value: AmbitusTypes.TPC_F_BB },
{ text: qsTrc("global", "F♭"), value: AmbitusTypes.TPC_F_B },
{ text: qsTrc("global", "F"), value: AmbitusTypes.TPC_F },
{ text: qsTrc("global", "F♯"), value: AmbitusTypes.TPC_F_S },
{ text: qsTrc("global", "F♯♯"), value: AmbitusTypes.TPC_F_SS },
+ { text: qsTrc("global", "F♯♯♯"), value: AmbitusTypes.TPC_F_SSS },
+ { text: qsTrc("global", "G♭♭♭"), value: AmbitusTypes.TPC_G_BBB },
{ text: qsTrc("global", "G♭♭"), value: AmbitusTypes.TPC_G_BB },
{ text: qsTrc("global", "G♭"), value: AmbitusTypes.TPC_G_B },
{ text: qsTrc("global", "G"), value: AmbitusTypes.TPC_G },
{ text: qsTrc("global", "G♯"), value: AmbitusTypes.TPC_G_S },
{ text: qsTrc("global", "G♯♯"), value: AmbitusTypes.TPC_G_SS },
+ { text: qsTrc("global", "G♯♯♯"), value: AmbitusTypes.TPC_G_SSS },
+ { text: qsTrc("global", "A♭♭♭"), value: AmbitusTypes.TPC_A_BBB },
{ text: qsTrc("global", "A♭♭"), value: AmbitusTypes.TPC_A_BB },
{ text: qsTrc("global", "A♭"), value: AmbitusTypes.TPC_A_B },
{ text: qsTrc("global", "A"), value: AmbitusTypes.TPC_A },
{ text: qsTrc("global", "A♯"), value: AmbitusTypes.TPC_A_S },
{ text: qsTrc("global", "A♯♯"), value: AmbitusTypes.TPC_A_SS },
+ { text: qsTrc("global", "A♯♯♯"), value: AmbitusTypes.TPC_A_SSS },
+ { text: qsTrc("global", "B♭♭♭"), value: AmbitusTypes.TPC_B_BBB },
{ text: qsTrc("global", "B♭♭"), value: AmbitusTypes.TPC_B_BB },
{ text: qsTrc("global", "B♭"), value: AmbitusTypes.TPC_B_B },
{ text: qsTrc("global", "B"), value: AmbitusTypes.TPC_B },
{ text: qsTrc("global", "B♯"), value: AmbitusTypes.TPC_B_S },
{ text: qsTrc("global", "B♯♯"), value: AmbitusTypes.TPC_B_SS }
+ { text: qsTrc("global", "B♯♯♯"), value: AmbitusTypes.TPC_B_SSS }
]
height: childrenRect.height |
For now, this seems fine to me, but I do want to note the following:
Considering these points, do we still all think this is the way to go for now? |
There is confusion right now between the Select note dialog (EditPitchUI, which displays note names already localized) and the note pitches displayed in the screenshots above (which display in SPN), so I think this PR will clear the confusion. But I also thought about guys that are already familiar just with SPN from DAWs, and I am proposing to add a checkbox in settings to enable global SPN display instead of using localized pitch names. What do you think about this option? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine to me, whether it is the way to go is not my decision.
Having all note and pitch names translatable is something I'd certainly support, esp. missing are those in the status bar (which this PR doesn't touch)
But having those remaining ones in the edit pitch dialog done is a good 1st step IMHO
Partially resolves: #30167 (Part 1)
Show note+octave names using the default locale name from
EditPitchBase
strings.For this to work correctly, add all the possible note names in a translatable vector. Most of them are already present in
editpitch.ui
file (already translated), so this will reuse those strings and only add the missing ones for translators.Example display for Romanian locale in Staff properties dialog:
Example display for Romanian locale in Edit string data dialog: