diff options
author | Félix Piédallu <felix@piedallu.me> | 2020-02-20 14:55:17 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2020-02-20 16:54:56 +0100 |
commit | a1f823ee6848f54fba7f7af4ee421125a0f7335b (patch) | |
tree | ff9247550f960d16d8a8a55b0b90361a7a533e1e | |
parent | 35ff249d98264e90eaf944e228f77338d3e0bbd3 (diff) | |
download | shared-mime-info-a1f823ee6848f54fba7f7af4ee421125a0f7335b.tar.gz |
build: Add script to check translations in po/LINGUAS
Replaces the shell in Makefile.am
-rw-r--r-- | Makefile.am | 8 | ||||
-rwxr-xr-x | po/check_translations.sh | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 0c587360..d25857d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -136,13 +136,7 @@ else endif check-translations: - @export RET=0 ; for i in $(top_srcdir)/po/*.po ; do \ - if ! grep -q ^`basename $$i | sed 's,.po,,'`$$ $(top_srcdir)/po/LINGUAS ; then \ - echo '***' `basename $$i | sed 's,.po,,'` missing from po/LINGUAS '***' ; \ - RET=1; \ - fi; \ - done; \ - if [ $$RET == 1 ] ; then exit 1; fi + $(top_srcdir)/po/check_translations.sh update-translations: po/shared-mime-info.pot @tx pull --all --force --skip diff --git a/po/check_translations.sh b/po/check_translations.sh new file mode 100755 index 00000000..76562cb2 --- /dev/null +++ b/po/check_translations.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Go to po directory +cd "$(dirname "${0}")" || exit 1 + +RET=0 + +for i in *.po; do + lang="$(basename "${i}" | sed 's,.po,,')" + if ! grep -q ^"${lang}" "LINGUAS"; then + echo "*** Language ${lang} is missing from LINGUAS ***" + RET=1 + fi +done + +exit "${RET}" |