Skip to content

translations collaboration

Yue Lan edited this page Aug 1, 2020 · 2 revisions

Translations Collaboration

For now, peony has the localization works on Chinese, English, and Turkish (thanks for @oltulu). We hope more contributors which could help us to make peony to an i18n project.

Peony uses Qt's translations frameworks, and it uses a semi-automatic shell script to manage and update the translation files. To add a new language support, there is 3 mainly steps you should care about:

Add translations target to .pro file.

To let your translation files can be updated, you should modify the .pro file (src.pro for peony, libpeony.pro for libpeony2, peony-qt-desktop.pro for peony-qt-desktop). For example, if you want to translate libpeony to Turkish, you should add _tr.ts to TRANSLATIONS macro. Like This.

Update/Generate new .ts files

After you added translation targets, you can execute update-translations.sh in ${top-src-dir}/translations then you can see the target files has been generated. Note that update-translations.sh also generate the .qm file used by applications for localization. The works of package and released using this script, and auto build with debhelper, so you should not worry about it won't work.

After your .ts file declaration added into TRANSLATIONS at .pro file(s), you should rebuild the project and check if new .ts files are generated at ${top-src-dir}/translations now. If not, you might use lupdate command to generate it manually.

Translate .ts files, then emit a pull request.

This is the most laborious job. Every language has their own rules to translate. Maybe I can't offer a help to you, but I suggest you choosing the wording carefully and updating it when the translation file contains new words that need to be translated. Everytimes the pull requests of i18n is welcomed.

Clone this wiki locally