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