Add automatic check for localization strings with multiple unnamed arguments
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 03 Oct 2018 14:17:19 +0300
changeset 2424 dc5554f0c12c
parent 2423 2c7b7ae24d57
child 2425 68e7da937162
Add automatic check for localization strings with multiple unnamed arguments
tests/tools/check_source.sh
--- a/tests/tools/check_source.sh	Wed Oct 03 12:43:35 2018 +0300
+++ b/tests/tools/check_source.sh	Wed Oct 03 14:17:19 2018 +0300
@@ -77,6 +77,21 @@
     echo ""
 }
 
+localization_checks()
+{
+    echo "Check correct localization formats"
+    xgettext --version
+    
+    for i in $py_files; do
+        xgettext -s --language=Python --package-name Beremiz --output=/tmp/m.pot $i 2>&1 | grep 'warning'
+        if [ $? -eq 0 ]; then
+            echo "Syntax error in $i"
+            set_exit_error
+        fi
+    done
+    echo "DONE"
+    echo ""
+}
 
 # pep8 was renamed to pycodestyle
 # detect existed version
@@ -419,6 +434,7 @@
     get_files_to_check $@
     python3_compile_checks
     compile_checks
+    localization_checks
     pep8_checks_default
     # pep8_checks_selected