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