[gimp/gimp-2-10] build: add a test to check the Windows installer languages.



commit 45fe197b02d88f286891f129a94839db9bf368e7
Author: Jehan <jehan girinstud io>
Date:   Tue May 18 20:18:14 2021 +0200

    build: add a test to check the Windows installer languages.
    
    This way, we will avoid in the future any discrepancies between
    languages set in the Windows installer and available translations (po
    files in po-windows-installer/) because `make check` will fail.
    
    (cherry picked from commit 8a42c6ccc2b7d7befd86d8fef524f4653dcd3e4e
    apart from the removed meson file)

 build/windows/installer/lang/Makefile.am            |  6 ++++++
 .../windows/installer/lang/test-installer-langs.sh  | 21 +++++++++++++++++++++
 2 files changed, 27 insertions(+)
---
diff --git a/build/windows/installer/lang/Makefile.am b/build/windows/installer/lang/Makefile.am
index 3e10c829f6..23a8a0091a 100644
--- a/build/windows/installer/lang/Makefile.am
+++ b/build/windows/installer/lang/Makefile.am
@@ -62,3 +62,9 @@ clean-local:
                echo "  RM       $$isl";                \
                rm -f "$$isl";                          \
        done
+
+TESTS_ENVIRONMENT = \
+       chmod +x test-installer-langs.sh; \
+       GIMP_TESTING_ABS_TOP_SRCDIR=@abs_top_srcdir@
+
+TESTS = test-installer-langs.sh
diff --git a/build/windows/installer/lang/test-installer-langs.sh 
b/build/windows/installer/lang/test-installer-langs.sh
new file mode 100755
index 0000000000..795e2c7990
--- /dev/null
+++ b/build/windows/installer/lang/test-installer-langs.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Make sure that the languages specified in the installer match the
+# translations present. This check step is necessary to not forget new
+# installer translations because we have a manual step.
+
+INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile' 
${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/gimp3264.iss | \
+                 sed 's/^Name: *"\([a-zA-Z_]*\)".*$/\1/' | sort`
+# 'en' doesn't have a gettext file because it is the default.
+INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
+
+PO_LANGS=`ls ${GIMP_TESTING_ABS_TOP_SRCDIR}/po-windows-installer/*.po |sed 
's%.*/po-windows-installer/\([a-zA-Z_]*\).po%\1%'`
+PO_LANGS=`echo "$PO_LANGS" | tr '\n\r' ' '`
+
+if [ "$PO_LANGS" = "$INSTALLER_LANGS" ]; then
+  exit 0
+else
+  echo "Error: languages listed in the Windows installer script do not match the .po files in 
po-windows-installer/."
+  echo "Please verify: build/windows/installer/gimp3264.iss"
+  exit 1
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]