summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.noreply.github.com>2017-02-21 04:48:55 -0300
committerrubenwardy <rubenwardy@gmail.com>2017-02-23 22:48:13 +0000
commite919355bec68804581d5ec3eac07fc6530299201 (patch)
treeb453a7b6186bab37d7e65de36247776307422afc
parentccd9a014243cd82d5b69d819af56b387d654f911 (diff)
Add helper script to update translations.
-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