Skip to content

Commit b6dc0d7

Browse files
committed
docs: convert TRANSLATORS to Markdown
Also expand it to cover typical tasks of creating new translations, updating existing ones and compiling them (which can be useful to check syntax.)
1 parent 1d1cb16 commit b6dc0d7

File tree

3 files changed

+75
-28
lines changed

3 files changed

+75
-28
lines changed

docs/TRANSLATORS

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/TRANSLATORS.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Notes for Translators
2+
3+
systemd depends on the `gettext` package for multilingual support.
4+
5+
You'll find the i18n files in the `po/` directory.
6+
7+
The build system (meson/ninja) can be used to generate a template (`*.pot`),
8+
which can be used to create new translations.
9+
10+
It can also merge the template into the existing translations (`*.po`), to pick
11+
up new strings in need of translation.
12+
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.)
16+
17+
# Creating a New Translation
18+
19+
To create a translation to a language not yet available, start by creating the
20+
initial template:
21+
22+
```
23+
$ ninja -C build/ systemd-pot
24+
```
25+
26+
This will generate file `po/systemd.pot` in the source tree.
27+
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
31+
ISO 639 standard.
32+
33+
In short:
34+
35+
<pre>
36+
$ cp po/systemd.pot po/<i>${lang_code}</i>.po
37+
</pre>
38+
39+
Then edit the new <code>po/<i>${lang_code}</i>.po</code> file (for example,
40+
using the `poedit` GUI editor.)
41+
42+
# Updating an Existing Translation
43+
44+
Start by updating the `*.po` files from the latest template:
45+
46+
```
47+
$ ninja -C build/ systemd-update-po
48+
```
49+
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.
53+
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.)
57+
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
60+
purpose.
61+
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.)
65+
66+
# Recompiling Translations
67+
68+
You can recompile the `*.po` files using the following command:
69+
70+
```
71+
$ ninja -C build/ systemd-gmo
72+
```
73+
74+
The resulting files will be saved in the `build/po/` directory.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,7 @@ install_data('LICENSE.GPL2',
27712771
'docs/ENVIRONMENT.md',
27722772
'docs/HACKING',
27732773
'docs/TRANSIENT-SETTINGS.md',
2774-
'docs/TRANSLATORS',
2774+
'docs/TRANSLATORS.md',
27752775
'docs/UIDS-GIDS.md',
27762776
'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
27772777
install_dir : docdir)

0 commit comments

Comments
 (0)