summaryrefslogtreecommitdiff
path: root/po/HACKING
blob: 9ab35a7ef3e59697a77a5e22fea4e23b3fc327e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Translations for programs are provided in files with the `.po` suffix.
These are created by copying PO-template (`.pot`) files, and filling
in the missing "msgstr" values.

To add a translation, you'll first (1) need to create the `.pot`
files, and then (2) copy them and (3) fill them in.

# 1. Create `.pot` files

  libretools' .pot files are not tracked in git; they are created by
  running `make` (you'll need a checkout of both devtools-par and
  libretools to run `make` if building from git).  In addition to the
  usual (`base-devel`) depenencies when running `make`, you'll need
  the `ruby-ronn` package as well.

      $ sudo pacman -S --needed base-devel ruby-ronn
      ...
      $ git clone https://git.parabola.nu/packages/devtools-par.git/
      $ git clone https://git.parabola.nu/packages/libretools.git/
      $ cd libretools
      $ make
      ...
      $ cd po/
      $ ls
      HACKING
      gitget.pot
      librelib.pot
      libretools.pot
      xbs.pot
      ...

# 2. Create `.po` files from them

  Create a folder under `po/` with the two-letter language code[^1]
  you want to add.  Then, copy the `.pot` files to that folder,
  changing the file extension to `.po`; for example:

      $ mkdir es
      $ for file in *.pot; do cp $file es/${file%t}; done

  [^1]: See the langauge code table
        here: <http://www.lingoes.net/en/translator/langcode.htm>

# 3. Fill the `.po` files in with translations

  From there you can open each .po file in your favorite text editor,
  and fill in the `msgstr` values with translations of the associated
  `msgid` keys.