diff options
author | EuAndreh <eu@euandre.org> | 2021-06-24 09:14:31 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-25 11:56:53 -0300 |
commit | f4deaf6bd66ed07cab897002c4cacd2e28027552 (patch) | |
tree | 81ccdcc409933ea00fa3c944d5fc0fab5e47231b /aux/workflow/l10n.sh | |
parent | aux/workflow/manpages.sh: Add missing suffix to HTML files (diff) | |
download | git-permalink-f4deaf6bd66ed07cab897002c4cacd2e28027552.tar.gz git-permalink-f4deaf6bd66ed07cab897002c4cacd2e28027552.tar.xz |
aux/workflow/assert-spelling.sh: Add; init dictionaries; fix spelling
- aux/workflow/l10n.sh: fix handling of $@;
- Makefile: remove circular dependency between dev-check and public by
adding the "l10n-gen" target.
Diffstat (limited to 'aux/workflow/l10n.sh')
-rwxr-xr-x | aux/workflow/l10n.sh | 32 |
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 -} |