wiki:TranslatingMuseeq

Version 8 (modified by daelstorm, 12 years ago) (diff)

--

Translating Museeq


There are several tools needed to create or modify a translation for Museeq.


CPP source to TS conversion tool

To extract all the translatable strings for the museeq source, the lupdate tool is used. Run the following command in the museeq/ directory, with the ?? replaced by the language you wish to translate:

lupdate *.cpp -ts translations/museeq_??.ts

For example, if I wanted to create or update the French translation, I'd use this command:

lupdate *.cpp -ts translations/museeq_fr.ts


Qt Linguist

Run linguist and open the museeq_??.ts file.

linguist

Familarize yourself with the different modes. When you finish inputting a translation string, hit the green checkmark to complete it. If you do not, the translated string will not appear when you start museeq.


TS to QM conversion tool

If your translation is not in the list of languages in the SConscript (the list is ts_templates), you can either modify the SConscript to include it, or simply build the binary translation file (which has a .qm suffix) from the .ts file.

cd museek+/museeq/translations/
lrelease museeq_??.ts -qm museeq_??.qm

For example, if I wanted to convert the French translation's .ts to a .qm, I'd use this command:

lrelease museeq_fr.ts -qm museeq_fr.qm

If the Qt .ts file is available for your language, use it to translate the Qt dialogs.

lrelease museeq_fr.ts qt_fr.ts -qm museeq_fr.qm


Installing the translation

If your translation is not in the list of languages in the SConscript (the list is ts_templates), you can either modify the SConscript to include it and run scons install, or copy it manually to your $PREFIX/share/museek/museeq/translations/ directory.


Using the translation

Museeq uses an internal locale-detecting function to decide with translation, if any, it should try to use. This function references the $LANG variable, so running:

LANG=fr museeq

Will start museeq with the French translation, if the museeq_fr.qm file is in $PREFIX/share/museek/museeq/translations/ directory.

Note: if you run museeq from the build directory, museeq will be unable to find the translations, just as it cannot find the default icon theme, as the build directory is $PREFIX.

Go back to DevelopingMuseekPlus | museeq | MuseeqTranslationSupport