aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/l10n.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/workflow/l10n.sh')
-rwxr-xr-xaux/workflow/l10n.sh20
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"