]> git.ipfire.org Git - thirdparty/systemd.git/blob - docs/TRANSLATORS.md
docs: add spdx tags to all .md files
[thirdparty/systemd.git] / docs / TRANSLATORS.md
1 ---
2 title: Notes for Translators
3 category: Contributing
4 layout: default
5 SPDX-License-Identifier: LGPL-2.1-or-later
6 ---
7
8 # Notes for Translators
9
10 systemd depends on the `gettext` package for multilingual support.
11
12 You'll find the i18n files in the `po/` directory.
13
14 The build system (meson/ninja) can be used to generate a template (`*.pot`),
15 which can be used to create new translations.
16
17 It can also merge the template into the existing translations (`*.po`), to pick
18 up new strings in need of translation.
19
20 Finally, it is able to compile the translations (to `*.gmo` files), so that
21 they can be used by systemd software. (This step is also useful to confirm the
22 syntax of the `*.po` files is correct.)
23
24 ## Creating a New Translation
25
26 To create a translation to a language not yet available, start by creating the
27 initial template:
28
29 ```
30 $ meson compile -C build/ systemd-pot
31 ```
32
33 This will generate file `po/systemd.pot` in the source tree.
34
35 Then simply copy it to a new <code><i>${lang_code}</i>.po</code> file, where
36 <code><i>${lang_code}</i></code> is the two-letter code for a language
37 (possibly followed by a two-letter uppercase country code), according to the
38 ISO 639 standard.
39
40 In short:
41
42 <pre>
43 $ cp po/systemd.pot po/<i>${lang_code}</i>.po
44 </pre>
45
46 Then edit the new <code>po/<i>${lang_code}</i>.po</code> file (for example,
47 using the `poedit` GUI editor.)
48
49 ## Updating an Existing Translation
50
51 Start by updating the `*.po` files from the latest template:
52
53 ```
54 $ meson compile -C build/ systemd-update-po
55 ```
56
57 This will touch all the `*.po` files, so you'll want to pay attention when
58 creating a git commit from this change, to only include the one translation
59 you're actually updating.
60
61 Edit the `*.po` file, looking for empty translations and translations marked as
62 "fuzzy" (which means the merger found a similar message that needs to be
63 reviewed as it's expected not to match exactly.)
64
65 You can use any text editor to update the `*.po` files, but a good choice is
66 the `poedit` editor, a graphical application specifically designed for this
67 purpose.
68
69 Once you're done, create a git commit for the update of the `po/*.po` file you
70 touched. Remember to undo the changes to the other `*.po` files (for instance,
71 using `git checkout -- po/` after you commit the changes you do want to keep.)
72
73 ## Recompiling Translations
74
75 You can recompile the `*.po` files using the following command:
76
77 ```
78 $ meson compile -C build/ systemd-gmo
79 ```
80
81 The resulting files will be saved in the `build/po/` directory.