| .. | ||
| readme.md | ||
Translations
Wrap all strings which need to be translated in either (tr "") (Lisp files)
or qsTr("") (QML files).
-
compile app (either desktop or mobile, you may need
touch ../app.asdto force recompilation of all files); this will generate a dummy filetr.h, containing all Lisp strings to translate -
run Qt command
lupdate(here: Spanish, French) for creating the translation source files from both Lisp and QML strings:
lupdate ../app.pro -ts es.ts fr.ts
-
translate all
*.tsfiles using Qt Linguist -
run Qt command
lreleaseto create compiled translation files:
lrelease es.ts fr.ts
-
run respective
qmakeagain (destop/mobile) in order to include all*.qmfiles (compiled translations) -
next time you compile the app, the translation files will be included as resources in the executable
Now when you launch the app, the translation file matching your system locale
setting of your platform (see QLocale) will be loaded, see QTranslator in
main.cpp.