-
Notifications
You must be signed in to change notification settings - Fork 34
Create translations for Commander Wars
Commander Wars uses Qt's translation tools and translation process. Please refer to qt's Linquist manual for example: https://doc.qt.io/qt-6/qtlinguist-index.html On how to use lupdate and qt's inquist tools.
The tools search for text which can have one of the following syntaxes:
- tr("My nice text") in cpp files
- qsTr("My nice text") in js files
- QT_TRANSLATE_NOOP("GAME","My nice text") in xml files
Those are/can be added to the .ts-File which is used for translating files from one language to another. The base game provides a a ts-File for all texts found and marked in the source code here: https://github.com/Robosturm/Commander_Wars/blob/master/translation/lang_en.ts
Requirements:
- Have a downloaded version of the source code
- Have at least qt's linquist tool installed. --> Provided by installing Qt
- Copy lang_en.ts and change the ending of en to the correct language code of your region e.g. de_DE for German in Germany
- Translate the entries using linquist
- Use the release option to create the binary file e.g. lang_de_DE.qm
- Create the folder translation and copy the file into it.
- Start the game the language should now be selectable
- Create an issue or pull request provding the ts file. So the language can be made available for everyone
1 Create a lang_*.ts file using Qt's lupdate tool provided by qt. Note please refer to the qt-documentation on how to use the command line tool 2 Continue in step 2 of the section Add a new language
E-Mail-Contact: [email protected] ask for help here. :)