diff options
author | EuAndreh <eu@euandre.org> | 2021-07-15 12:16:11 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-07-15 12:16:14 -0300 |
commit | 83e65d38d5269c7f505b5e65cd57ce640bba66bf (patch) | |
tree | a84173d7d0771da14479bfe78b08dc9cac28970e /aux | |
parent | Makefile: Remove TODOs.md as a dependency for "l10n-gen" target (diff) | |
download | git-permalink-83e65d38d5269c7f505b5e65cd57ce640bba66bf.tar.gz git-permalink-83e65d38d5269c7f505b5e65cd57ce640bba66bf.tar.xz |
aux/workflow/l10n.sh: Support "-L CONTRIBLANGS" option
Adjust Makfile to include it and give it both to aux/workflow/l10n.sh
and to aux/workflow/public.sh
Diffstat (limited to 'aux')
-rwxr-xr-x | aux/workflow/l10n.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/aux/workflow/l10n.sh b/aux/workflow/l10n.sh index 20c95d8..8123b8c 100755 --- a/aux/workflow/l10n.sh +++ b/aux/workflow/l10n.sh @@ -2,24 +2,32 @@ set -eu LANGS= -while getopts 'l:' flag; do +while getopts 'l:L:' flag; do case "$flag" in l) LANGS="$OPTARG" ;; + L) + CONTRIBLANGS="$OPTARG" + ;; *) exit 2 ;; esac done shift $((OPTIND - 1)) -if [ -z "$LANGS" ]; then - echo "Missing LANG" >&2 - exit 2 -fi + +assert_arg() { + if [ -z "$1" ]; then + echo "Missing $2" >&2 + exit 2 + fi +} + +assert_arg "${LANGS:-}" '-l LANGS' for from_f in "$@"; do - for lang in $LANGS; do + for lang in $LANGS ${CONTRIBLANGS:-}; do to_f="$(echo "$from_f" | sed "s/\.en\./.$lang./")" printf 'Generating %s...\n' "$to_f" pofile="po/LC_MESSAGES/$from_f/$lang.po" |