Skip to content

Commit 1f12efa

Browse files
Updating contributor docs
1 parent c5709f5 commit 1f12efa

File tree

4 files changed

+38
-14
lines changed

4 files changed

+38
-14
lines changed

SCANNER_SUPPORT.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ To make the parameter strings available to the translation system, run these com
6262
(assuming you have set up `meson` to use the `build` directory):
6363

6464
```bash
65-
meson compile scanner_strings -C build
66-
meson compile gorfector-pot -C build
6765
meson compile gorfector-update-po -C build
6866
```
6967

70-
This will update the `gorfector.pot` file and all the `*.po` files in the `po` directory. You (or a translator) will
71-
now be able to translate the strings in the `*.po` files.
68+
This will extract the strings from the JSON file, update the `gorfector.pot` file and all the `*.po` files in
69+
the `po` directory. You (or a translator) will now be able to translate the strings in the `*.po` files.
7270

7371
## Testing your changes
7472

TRANSLATE.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
# Translating
22

3+
## Translating the User Interface
4+
35
Gorfector uses the GNU `gettext` system to translate the user interface. The source strings are
46
in 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

2223
This 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+
```

po/fr.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: gorfector master\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-05-24 11:51-0400\n"
10+
"POT-Creation-Date: 2025-05-24 12:50-0400\n"
1111
"PO-Revision-Date: 2025-05-24 11:52-0400\n"
1212
"Last-Translator: Patrick Fournier <>\n"
1313
"Language-Team: French - Canada\n"

po/gorfector.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-05-24 11:51-0400\n"
11+
"POT-Creation-Date: 2025-05-24 12:50-0400\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"

0 commit comments

Comments
 (0)