From 83e65d38d5269c7f505b5e65cd57ce640bba66bf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 15 Jul 2021 12:16:11 -0300 Subject: 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 --- aux/workflow/l10n.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'aux/workflow') 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" -- cgit v1.2.3