This page gives an overview of options on how to translate a plugin to different languages.
### Reuse MuseScore translatable strings
If your plugin only needs strings that are already used within MuseScore (e.g. some musical terms or actions names) the simplest method to keep a plugin translated is to reuse translations that already exist in MuseScore. In order to do this you need to use [`qsTranslate()`](https://doc.qt.io/qt-5/qml-qtqml-qt.html#qsTranslate-method) function with appropriate translation contexts:
```
var t1 = qsTranslate("symUserNames", "Sharp"); // gets a translation for "Sharp" symbol name
console.log(t1);
var t2 = qsTranslate("action", "Export parts"); // gets a translation for "Export parts" action
Translation contexts for existing strings can be searched for on [Transifex](https://app.transifex.com/musescore/musescore) or directly in MuseScore [source code](https://github.com/musescore/MuseScore).
This method allows to quickly make a plugin translatable. Still, it may not fit a particular plugin's needs. \n
Translation contexts are not guaranteed to remain unchanged between MuseScore releases. Also, this method won't work if a plugin needs strings that are not used anywhere else in MuseScore.
To make the plugin's strings translatable you need to use [`qsTr()`](https://doc.qt.io/qt-5/qml-qtqml-qt.html#qsTr-method) for all your "quoted strings" in the `.qml` files. `qsTr()` has 3 arguments, the 1st is the string to be translated, the 2nd (optional) argument is a comment to the translator (which is later visible in Qt Linguist), the 3rd (also optional) is intended to be used for handling plurals in translations. \n
It can work with placeholders, e.g. `qsTr("Pages: %1").arg(numberOfPages)`
For translating \ref Ms::PluginAPI::PluginAPI::menuPath "menu item" of the plugin it is better not to translate the top-level item of menu path (usually "Plugins"):
In order to avoid conflicts with other plugins' translations it is recommended to have a separate directory for your plugin (that is, plugin's `.qml` files should *not* be put directly to the Plugins directory but to a subdirectory created specifically for that plugin).