2 title: Notes for Translators
5 # Notes for Translators
7 systemd depends on the `gettext` package for multilingual support.
9 You'll find the i18n files in the `po/` directory.
11 The build system (meson/ninja) can be used to generate a template (`*.pot`),
12 which can be used to create new translations.
14 It can also merge the template into the existing translations (`*.po`), to pick
15 up new strings in need of translation.
17 Finally, it is able to compile the translations (to `*.gmo` files), so that
18 they can be used by systemd software. (This step is also useful to confirm the
19 syntax of the `*.po` files is correct.)
21 ## Creating a New Translation
23 To create a translation to a language not yet available, start by creating the
27 $ ninja -C build/ systemd-pot
30 This will generate file `po/systemd.pot` in the source tree.
32 Then 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
40 $ cp po/systemd.pot po/<i>${lang_code}</i>.po
43 Then edit the new <code>po/<i>${lang_code}</i>.po</code> file (for example,
44 using the `poedit` GUI editor.)
46 ## Updating an Existing Translation
48 Start by updating the `*.po` files from the latest template:
51 $ ninja -C build/ systemd-update-po
54 This will touch all the `*.po` files, so you'll want to pay attention when
55 creating a git commit from this change, to only include the one translation
56 you're actually updating.
58 Edit 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
60 reviewed as it's expected not to match exactly.)
62 You can use any text editor to update the `*.po` files, but a good choice is
63 the `poedit` editor, a graphical application specifically designed for this
66 Once you're done, create a git commit for the update of the `po/*.po` file you
67 touched. Remember to undo the changes to the other `*.po` files (for instance,
68 using `git checkout -- po/` after you commit the changes you do want to keep.)
70 # Recompiling Translations
72 You can recompile the `*.po` files using the following command:
75 $ ninja -C build/ systemd-gmo
78 The resulting files will be saved in the `build/po/` directory.