Skip to content

Commit

Permalink
Don't have strings in plugins translatable that [dw]on't work anyhow
Browse files Browse the repository at this point in the history
The plugin description and -path are not shown translated even if they
are (like for the helloqml plugin and German).
Showing as being translatable gives a wrong impression as examples for
other plugins.
BTW: Those descriptions do translate in the Plugin Editor/Creator's
console log, but only there.
While at it, make helloqml actually work, it apparently had never been
ported from 2.x to 3.x (and later).

Backport of musescore#8985 plus some other random findings (not relevant to the
master branch)
  • Loading branch information
Jojo-Schmitz committed May 12, 2022
1 parent c7c294c commit b77ee4e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion mscore/musescore.cpp
Expand Up @@ -4312,7 +4312,7 @@ void MuseScore::changeState(ScoreState val)
"pad-note-256-TAB", "pad-note-512-TAB", "pad-note-1024-TAB", "pad-rest-TAB", "rest-TAB"};
bool intoTAB = (_sstate != STATE_NOTE_ENTRY_STAFF_TAB) && (val == STATE_NOTE_ENTRY_STAFF_TAB);
bool fromTAB = (_sstate == STATE_NOTE_ENTRY_STAFF_TAB) && (val != STATE_NOTE_ENTRY_STAFF_TAB);
// if activating TAB note entry, swap "pad-note-...-TAB" shorctuts into "pad-note-..." actions
// if activating TAB note entry, swap "pad-note-...-TAB" shortcuts into "pad-note-..." actions
if (intoTAB) {
for (unsigned i = 0; i < sizeof(stdNames)/sizeof(char*); ++i) {
QAction* act = getAction(stdNames[i]);
Expand Down
2 changes: 1 addition & 1 deletion mscore/shortcut.cpp
Expand Up @@ -4722,7 +4722,7 @@ void Shortcut::reset()
//---------------------------------------------------------

static const QString numPadPrefix("NumPad+");
static const int NUMPADPREFIX_SIZE = 7; // the length in chars of the above string
static const int NUMPADPREFIX_SIZE = numPadPrefix.size();

QString Shortcut::keySeqToString(const QKeySequence& keySeq, QKeySequence::SequenceFormat fmt, bool escapeKeyStr /* = false */)
{
Expand Down
2 changes: 1 addition & 1 deletion share/plugins/abc_import.qml
Expand Up @@ -26,7 +26,7 @@ import FileIO 3.0
MuseScore {
menuPath: "Plugins.ABC Import"
version: "3.0"
description: qsTr("This plugin imports ABC text from a file or the clipboard. Internet connection is required.")
description: "This plugin imports ABC text from a file or the clipboard. Internet connection is required."
requiresScore: false
pluginType: "dialog"

Expand Down
2 changes: 1 addition & 1 deletion share/plugins/colornotes.qml
Expand Up @@ -18,7 +18,7 @@ import MuseScore 3.0

MuseScore {
version: "3.5"
description: qsTr("This plugin colors notes in the selection depending on their pitch as per the Boomwhackers convention")
description: "This plugin colors notes in the selection depending on their pitch as per the Boomwhackers convention"
menuPath: "Plugins.Notes.Color Notes"

property variant colors : [ // "#rrggbb" with rr, gg, and bb being the hex values for red, green, and blue, respectively
Expand Down
13 changes: 6 additions & 7 deletions share/plugins/helloqml/helloqml.qml
Expand Up @@ -5,7 +5,7 @@ import MuseScore 3.0
MuseScore {
menuPath: "Plugins.helloQml"
version: "3.0"
description: qsTr("This demo plugin shows some basic tasks.")
description: "This demo plugin shows some basic tasks."
pluginType: "dialog"

width: 150
Expand All @@ -16,22 +16,22 @@ MuseScore {
console.log(curScore)
console.log(score.name)
var m
m = score.firstMeasure()
m = score.firstMeasure
while (m) {
console.log(qsTr("measure"))
var segment = m.first()
var segment = m.firstSegment
while (segment) {
var element
element = segment.elementAt(0)
if (element && element.type == Element.CHORD) {
console.log(qsTr(" element"))
console.log(element.beamMode)
if (element.beamMode == BeamMode.NO)
if (element.beamMode == Beam.NONE)
console.log(" beam no")
}
segment = segment.next()
segment = segment.next
}
m = m.nextMeasure()
m = m.nextMeasure
}
}

Expand All @@ -50,4 +50,3 @@ MuseScore {
}
}
}

Binary file modified share/plugins/helloqml/translations/locale_de.qm
Binary file not shown.
5 changes: 0 additions & 5 deletions share/plugins/helloqml/translations/locale_de.ts
Expand Up @@ -3,11 +3,6 @@
<TS version="2.0" language="de_DE">
<context>
<name>helloqml</name>
<message>
<location filename="../helloqml.qml" line="8"/>
<source>This demo plugin shows some basic tasks.</source>
<translation>Dieses Demo-Plugin zeigt einige einfache Funktionen.</translation>
</message>
<message>
<location filename="../helloqml.qml" line="13"/>
<source>hello world</source>
Expand Down
4 changes: 2 additions & 2 deletions share/plugins/notenames-interactive.qml
Expand Up @@ -21,8 +21,8 @@ import MuseScore 3.0

MuseScore {
version: "3.5"
description: qsTr("This plugin names notes as per your language setting")
menuPath: "Plugins.Notes." + qsTr("Note Names (Interactive)")
description: "This plugin names notes as per your language setting"
menuPath: "Plugins.Notes." + "Note Names (Interactive)"
pluginType: "dock"

implicitHeight: controls.implicitHeight * 1.5
Expand Down
4 changes: 2 additions & 2 deletions share/plugins/notenames.qml
Expand Up @@ -20,8 +20,8 @@ import MuseScore 3.0

MuseScore {
version: "3.5"
description: qsTr("This plugin names notes as per your language setting")
menuPath: "Plugins.Notes." + qsTr("Note Names")
description: "This plugin names notes as per your language setting"
menuPath: "Plugins.Notes." + "Note Names"

// Small note name size is fraction of the full font size.
property var fontSizeMini: 0.7;
Expand Down

0 comments on commit b77ee4e

Please sign in to comment.