minetest-3d_armor/3d_armor/tools/updatepo.sh
Eugen Wesseloh c96ba7ef34 Cleanup locales (#155)
* use localization function in formspecs

* remove unused translations

* remove F keyword from updatepo tool

* add tool readme
2018-07-26 20:05:50 +01:00

25 lines
558 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