2017-01-21 05:04:03 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
me=$(basename "${BASH_SOURCE[0]}");
|
|
|
|
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
|
|
echo "Usage: $me FILE..." >&2;
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p locale;
|
|
|
|
echo "Generating template..." >&2;
|
2017-02-26 00:38:17 +01:00
|
|
|
xgettext --from-code=UTF-8 \
|
|
|
|
--keyword=S \
|
|
|
|
--keyword=NS:1,2 \
|
|
|
|
--keyword=N_ \
|
|
|
|
--add-comments='Translators:' \
|
|
|
|
--add-location=file \
|
|
|
|
-o locale/template.pot \
|
|
|
|
"$@" \
|
2017-01-21 05:04:03 +01:00
|
|
|
|| exit;
|
|
|
|
|
2017-02-26 00:38:17 +01:00
|
|
|
find locale -name '*.po' -type f | while read -r file; do
|
2017-01-21 05:04:03 +01:00
|
|
|
echo "Updating $file..." >&2;
|
2017-02-26 00:38:17 +01:00
|
|
|
msgmerge --update "$file" locale/template.pot;
|
2017-01-21 05:04:03 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "DONE!" >&2;
|