From e919355bec68804581d5ec3eac07fc6530299201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Tue, 21 Feb 2017 04:48:55 -0300 Subject: [PATCH] Add helper script to update translations. --- tools/updatepo.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tools/updatepo.sh 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