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