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