diff options
author | LNJ <git@lnj.li> | 2017-04-11 13:02:31 +0200 |
---|---|---|
committer | LNJ <git@lnj.li> | 2017-04-11 13:02:31 +0200 |
commit | cde5c46e449e49e1435ac649bf344234ccd61f80 (patch) | |
tree | 57e4d51c44d4c4a052d948f0fb73217050a58285 /tools | |
parent | cb616b0df9e0a07b9e569898c1d3cc265e6c13bf (diff) |
Add i18n support using intllib
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/updatepo.sh | 22 |
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 |