moreores/tools/updatepo.sh
fat115 2c41c61092 more accurate translatable strings
based on kaeza's i18n work : https://github.com/kaeza/moreores/tree/i18n
add updatepo.sh (with sorting)
all language.txt files converted to language.po file (mainly fuzzy strings)
2017-08-04 19:02:35 +02:00

25 lines
557 B
Bash
Executable File

#! /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_ \
--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