From cde5c46e449e49e1435ac649bf344234ccd61f80 Mon Sep 17 00:00:00 2001 From: LNJ Date: Tue, 11 Apr 2017 13:02:31 +0200 Subject: Add i18n support using intllib --- tools/updatepo.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tools/updatepo.sh (limited to 'tools') 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 -- cgit v1.2.3