To translate a plugin, you need to use
qsTr() for all your "quoted strings" in the .js files. qsTr() has 2 arguments, the 1st is the to be translated string, the 2nd is a comment to the translator (and later visible in Qt Linguist) and optional.
It can work with placeholders, e.g.
qsTr("Pages: %1") .arg(NumberOfPages)
If the string is outside a function, use
QT_TR_NOOP(). For example, for the [[nodetitle:Plugin File Structure|menu item]]
(although, as per this forum thread the term 'Plugins' should not get translated, not yet at least)
Not extra steps needed for .ui files.
Next the plugin needs a directory on its own, do not conflict with other plugins' translations
Then create a directory
translations into the plugins' directory. You need to put
locale_XX.qm files in it. How to obtain a .qm file for your plugin?
replace XX by the targetted language (eg.: "de" for German) and include .js and .ui files
This extracts all the to be translated strings from ther .js and .ui files into that .ts file.
Repeat for other languages, if need be.
Use Qt Linguist to put the translation into
locale_XX.ts. Once done use File → Release in Qt Linguist or run the following:
That will create/update a
Now, run MuseScore in your language and your plugin should be translated!
More information on QtScript website.
If you want to look at working examples, check the batch export plugin and/or the MuseScore 1.2+ version of the musescore.com plugin ("Save online").