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