Skip to content

Conversation

SilverGreen93
Copy link
Contributor

@SilverGreen93 SilverGreen93 commented Oct 9, 2025

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:

image

Example display for Romanian locale in Edit string data dialog:

image
  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

using namespace muse;

static constexpr const char* noteNamesWithOctaves[] = {
QT_TRANSLATE_NOOP("EditPitchBase", "C -1"),
Copy link
Member

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.

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 11, 2025

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

@cbjeukendrup
Copy link
Member

For now, this seems fine to me, but I do want to note the following:

  • I could imagine this won't make all users happy: for users from a more classical background it will be great, but for users who come from DAWs, where MIDI/"international" (?) pitch notation is probably the standard, it might be confusing. On the other hand, "confusing" could well be replaced with "educative", so I'm happy to merge this and think about it again if and when we get complaints about it.
  • There is a certain overlap in functionality with the tpc2name functions from pitchspelling.h. These functions take a very different approach, not dependent on the currently selected locale, and computing the names in code rather than having all of them translatable.
  • Eventually, we will need in-score language to be independent from app language. I don't think that has to be a big influence on which strategy we choose right now, but we should keep it in mind.
  • In the in-score popup for the "String tunings" element, we would have to go in the opposite direction, namely from localised pitch name to pitch. That's a challenge for another PR.

Considering these points, do we still all think this is the way to go for now?

@SilverGreen93
Copy link
Contributor Author

SilverGreen93 commented Oct 11, 2025

  • I could imagine this won't make all users happy: for users from a more classical background it will be great, but for users who come from DAWs, where MIDI/"international" (?) pitch notation is probably the standard, it might be confusing.

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?

Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display pitch notation in language locale (Helmholtz or SPN)

3 participants