From 2fef15d878f00c72a799aebc5b8a6bd61489296e Mon Sep 17 00:00:00 2001 From: fat115 Date: Sat, 5 Aug 2017 10:12:43 +0200 Subject: add intllib support (i18n) -> mods ontime_clocks, signs, signs_roads & steles add french translations add updatepo.sh script to update po/pot files add specific array for full description of steles --- ontime_clocks/tools/updatepo.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 ontime_clocks/tools/updatepo.sh (limited to 'ontime_clocks/tools') diff --git a/ontime_clocks/tools/updatepo.sh b/ontime_clocks/tools/updatepo.sh new file mode 100755 index 0000000..feb2504 --- /dev/null +++ b/ontime_clocks/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 -- cgit v1.2.3