summaryrefslogtreecommitdiff
path: root/steles/tools/updatepo.sh
diff options
context:
space:
mode:
authorpyrollo <dev@pyrollo.com>2017-08-26 10:22:54 +0200
committerGitHub <noreply@github.com>2017-08-26 10:22:54 +0200
commitd59c475162da02695a85ebd92a44e53129aa8be3 (patch)
treeb72e4a139bd574119c2d67f93354178557642237 /steles/tools/updatepo.sh
parente29f085c32caa485ce407b574641bd5f0a492820 (diff)
parent2fef15d878f00c72a799aebc5b8a6bd61489296e (diff)
Merge pull request #6 from fat115/master
add intllib support (i18n)
Diffstat (limited to 'steles/tools/updatepo.sh')
-rwxr-xr-xsteles/tools/updatepo.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/steles/tools/updatepo.sh b/steles/tools/updatepo.sh
new file mode 100755
index 0000000..feb2504
--- /dev/null
+++ b/steles/tools/updatepo.sh
@@ -0,0 +1,25 @@
+#! /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 \
+ --language=Lua \
+ --sort-by-file \
+ --keyword=S \
+ --keyword=NS:1,2 \
+ --keyword=N_ \
+ --keyword=F \
+ --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