summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Piédallu <felix@piedallu.me>2020-02-20 14:55:17 +0100
committerBastien Nocera <hadess@hadess.net>2020-02-20 17:59:36 +0100
commit515a8db53586b05960bf48234663ea5d9818136f (patch)
tree591eb99ac5e35ff8ab1bf98cbda8df97a9653ffb
parenta1e4ea7992251ebd7e20fc550c5c96df9696f245 (diff)
downloadshared-mime-info-515a8db53586b05960bf48234663ea5d9818136f.tar.gz
build: Add script to check translations in po/LINGUAS
Replaces the shell in Makefile.am
-rw-r--r--Makefile.am11
-rwxr-xr-xpo/check_translations.sh16
2 files changed, 19 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 0360e89e..1ff15338 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,8 @@ EXTRA_DIST = \
$(man_MANS) \
$(ITS_FILES) \
shared-mime-info.pc.in \
- data/freedesktop_generate.sh
+ data/freedesktop_generate.sh \
+ po/check_translations.sh
CLEANFILES = freedesktop.org.xml po/stamp-it
@@ -137,13 +138,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}"