diff options
author | Diego MartÃnez <kaeza@users.noreply.github.com> | 2017-01-21 01:04:03 -0300 |
---|---|---|
committer | Diego MartÃnez <kaeza@users.noreply.github.com> | 2017-01-24 00:24:57 -0300 |
commit | b2551f6a2209b8a11b42834cb0d63f5c03a2b95f (patch) | |
tree | 93e1ac391a3146431b273c94805f543b63b64fb1 /tools/xgettext.sh | |
parent | 4e067ec21906e9a27ec704dd5f34297b2592d6de (diff) |
Add support for gettext message catalogs.
Diffstat (limited to 'tools/xgettext.sh')
-rwxr-xr-x | tools/xgettext.sh | 23 |
1 files changed, 23 insertions, 0 deletions
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; |