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