From 40b5e767d59df705a2442fcc253db077cc7f8b68 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Sun, 27 Aug 2023 12:17:34 +0200 Subject: [PATCH] Document how to translate and test translations --- docs/translations.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/translations.md diff --git a/docs/translations.md b/docs/translations.md new file mode 100644 index 0000000..3193275 --- /dev/null +++ b/docs/translations.md @@ -0,0 +1,27 @@ +# Translations + +Translations are stored in .ts files in the [src/translations/](../src/translations/) directory. + +## Adding a new language + +- Add a .ts file to the `TS_FILES` variable in [src/CMakeLists.txt](../src/CMakeLists.txt) +- Run `make lupdate` in the build directory to create the .ts file +- Translate the content of the .ts file with Linguist + +## Testing a translation + +- Build and install the app, preferably in a directory where you don't need to be root to install. This example assumes you install it to `$HOME/tmp/nanonote-inst`: + ``` + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=$HOME/tmp/nanonote-inst + make + make install + ``` + +- Run the app, possibly with the `LANGUAGE` variable set to force the language: + ``` + LANGUAGE= $HOME/tmp/nanonote-inst/bin/nanonote + ``` + +- If something is wrong: fix the translation, run `make install` and try again