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