11# Translating
22
3+ ## Translating the User Interface
4+
35Gorfector uses the GNU ` gettext ` system to translate the user interface. The source strings are
46in the C++ source files as well as in the JSON files that define the scanner parameters, in the ` scanners ` directory.
57
6- To update the translation files , you need to run the following commands at the repository root
7- (assuming you have set up ` meson ` to use the ` build ` directory) :
8+ To add a new language , you need to edit the ` po/meson.build ` file and add the new language to the list of languages.
9+ Then, run the following command at the repository root to generate the new ` *.po ` file :
810
911``` bash
10- meson compile scanner_strings -C build
11- meson compile gorfector-pot -C build
12- meson compile gorfector-update-po -C build
12+ meson compile update_all_po -C build
1313```
1414
15- This will update the ` gorfector.pot ` file and all the ` *.po ` files in the ` po ` directory. You are now ready to edit
16- the translations. Once you are done, you can run the following command to compile the translations:
15+ This will update the ` gorfector.pot ` file (if needed) and all the ` *.po ` files in the ` po ` directory.
16+ You are now ready to edit the translations. Once you are done, you can run the following command to compile
17+ the translations:
1718
1819``` bash
19- meson compile gorfector-gmo -C build
20+ meson compile compile_all_mo -C build
2021```
2122
2223This will compile the ` *.po ` files into ` *.mo ` files, which are used by the program at runtime.
@@ -25,3 +26,28 @@ You can then run the following command to install the translations:
2526``` bash
2627 meson install -C build
2728```
29+
30+ Your translations are now installed and ready to be used.
31+
32+ ## Updating the Help Files
33+
34+ The help files are in the ` help ` directory. To add a new language, you need to edit the ` help/LINGUAS ` file
35+ and add the new language to the list of languages. Then, run the following command at the repository root to generate
36+ the new ` *.po ` file:
37+
38+ ``` bash
39+ meson compile help-gorfector-update-po -C build
40+ ```
41+
42+ Edit the ` *.po ` file to add your translations. Once you are done, you can run the following command to compile
43+ the translations:
44+
45+ ``` bash
46+ meson compile help-gorfector-< lang> -gmo -C build
47+ ```
48+
49+ To install the translations, run the following command:
50+
51+ ``` bash
52+ meson install -C build
53+ ```
0 commit comments