From 68f4bee72e58b482440d4d604df9271c9778626b Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Thu, 14 Mar 2019 16:37:18 -0700 Subject: [PATCH] update README translation instructions --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9a4562..85c5b49 100644 --- a/README.md +++ b/README.md @@ -46,4 +46,18 @@ Currently you will need to manually run tor first before running cwtch.im/ui. Us ## Translations -Translations can be update by runing QT Linguist in the project directory (`linguist`) and loading and editing any of the `i18n/translate_*.ts` files. To add a new translation, please register the file in qml.qrc. To update translations, run `lupdate ui.pro` to update the editable .ts files and when you are done run `lrelease ui.pro` to generate the .qm files that are used at runtime. +### Add new translation + +Edit `ui.pro` and add a new line in the variable definition for `TRANSLATIONS` like: + + TRANSLATIONS = i18n/translation_en.ts \ + i18n/translation_de.ts + +Then to update and generate your new translation file, run `lupdate ui.pro` and you will find your new file in the `i18n/` directory. + +### Updating translations + +Run `lupdate ui.pro` to update all the translation files in the `i18n/` directory, then edit your languages' .ts file to make the appropriate changes. It is recommended to use QT Linguist (`linguist`) to edit the files. + +When done, run `lrelease ui.pro` to compile all the translations from their .ts files into .qm files for use in the program. Then you can compile the ui program. +