aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/l10n.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/workflow/l10n.sh')
-rwxr-xr-xaux/workflow/l10n.sh32
1 files changed, 17 insertions, 15 deletions
diff --git a/aux/workflow/l10n.sh b/aux/workflow/l10n.sh
index ece154e..207237d 100755
--- a/aux/workflow/l10n.sh
+++ b/aux/workflow/l10n.sh
@@ -18,8 +18,23 @@ if [ -z "$LANGS" ]; then
exit 2
fi
-# shellcheck disable=2044
-for f in $(find "$@" -not -name '*.en.*'); do
+manpage() {
+ from_f="$1"
+ for l in $LANGS; do
+ to_f="$(echo "$from_f" | sed "s/\.en\./.$l./")"
+
+ printf 'Generating %s...\n' "$to_f"
+ OUT="$(mktemp)"
+ po4a-updatepo -f man -m "$from_f" -p "po/$l.po"
+ po4a-translate -f man -m "$from_f" -p "po/$l.po" -l "$to_f" -k 0 -v 2>&1 | tee "$OUT" >&2
+
+ if ! grep -qF ' is 100% translated (' "$OUT"; then
+ printf '\n\tWARNING!\n Missing translations for %s\n\n' "$to_f" >&2
+ fi
+ done
+}
+
+for f in "$@"; do
case "$f" in
*.en.[1-9].in)
manpage "$f"
@@ -30,16 +45,3 @@ for f in $(find "$@" -not -name '*.en.*'); do
;;
esac
done
-
-manpage() {
- from_f="$1"
- for l in $LANGS; do
- to_f="$(echo "$from_f" | sed "s/\.en\./.$l./")"
- po4a-updatepo -f man -m "$from_f" -p "po/$l.po"
- OUT="$(po4a-translate -f man -m "$from_f" -p "po/$l.po" -l "$to_f" -k 0 -v 2>&1)"
- echo "$OUT" >&2
- if ! echo "$OUT" | grep -qF ' is 100% translated ('; then
- printf '\n\tWARNING!\n Missing translations for %s\n\n' "$to_f" >&2
- fi
- done
-}