summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.noreply.github.com>2017-02-20 17:31:15 -0300
committerAuke Kok <sofar+github@foo-projects.org>2017-02-20 13:38:32 -0800
commit7252ae9be7e20f5a2defb3fe82748f53f22732b4 (patch)
treeb5b8b74e151ae4684fc6f2a230af1d08c7a029a6
parentffa50a5d4755575b19750ee7935da1b5a1ce22e5 (diff)
Add helper script to update PO files.
-rwxr-xr-xtools/updatepo.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/updatepo.sh b/tools/updatepo.sh
new file mode 100755
index 0000000..74332e0
--- /dev/null
+++ b/tools/updatepo.sh
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+# To create a new translation:
+# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
+
+cd "$(dirname "${BASH_SOURCE[0]}")/..";
+
+# Extract translatable strings.
+xgettext --from-code=UTF-8 \
+ --keyword=S \
+ --keyword=NS:1,2 \
+ --keyword=N_ \
+ --add-comments='Translators:' \
+ --add-location=file \
+ -o locale/template.pot \
+ $(find . -name '*.lua')
+
+# Update translations.
+find locale -name '*.po' | while read -r file; do
+ echo $file
+ msgmerge --update $file locale/template.pot;
+done