From b2551f6a2209b8a11b42834cb0d63f5c03a2b95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Sat, 21 Jan 2017 01:04:03 -0300 Subject: Add support for gettext message catalogs. --- tools/xgettext.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tools/xgettext.sh (limited to 'tools/xgettext.sh') diff --git a/tools/xgettext.sh b/tools/xgettext.sh new file mode 100755 index 0000000..6de353c --- /dev/null +++ b/tools/xgettext.sh @@ -0,0 +1,23 @@ +#! /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; +xgettext --from-code=UTF-8 -kS -kNS:1,2 -k_ \ + -o locale/template.pot "$@" \ + || exit; + +cd locale; + +for file in *.po; do + echo "Updating $file..." >&2; + msgmerge --update "$file" template.pot; +done + +echo "DONE!" >&2; -- cgit v1.2.3