summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-07-05 18:25:23 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-07-05 18:25:23 -0400
commitbbf6f9f61c7bc733f990f9cf496ea6fb443609e6 (patch)
tree8c96bbd2e0e3720e2bd9a90fa53dbeb23a2926a9 /po
parent38286baf174a9b8fbbd91653dbe3a846ded8a926 (diff)
add a po/HACKING file explaining how to add translations
Diffstat (limited to 'po')
-rw-r--r--po/HACKING44
1 files changed, 44 insertions, 0 deletions
diff --git a/po/HACKING b/po/HACKING
new file mode 100644
index 0000000..2a29adc
--- /dev/null
+++ b/po/HACKING
@@ -0,0 +1,44 @@
+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):
+
+ $ 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.