[sysadmin-bin] add simplistic check to ensure keywords in desktop files are properly translated



commit 1bcb0f3383c298b7e3be718ded7964aafbd7e5ab
Author: Olav Vitters <olav vitters nl>
Date:   Mon Jul 28 21:08:21 2014 +0200

    add simplistic check to ensure keywords in desktop files are properly translated

 git/pre-receive-check-po |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/git/pre-receive-check-po b/git/pre-receive-check-po
index 743fa01..2e734c9 100755
--- a/git/pre-receive-check-po
+++ b/git/pre-receive-check-po
@@ -47,6 +47,30 @@ EOF
        exit 1
     fi
 
+    # Do a simplistic check to for keyword not ending with a semicolon
+    result=`git cat-file blob "$rev:$path" | sed -rn '/^#: .*\.desktop/{:start /\nmsgstr/!{N;b start};/msgid 
[^\n]+;"/{/msgstr [^\n]+;"/!p}}' 2>&1`
+    if [ "$result" != ""]; then
+      cat <<EOF >&2
+---
+The following translation (.po) file should ensure the translated content ends with a 
semicolon.$branch_message
+
+$path
+
+The following part of the file fails to do this. Please correct the translation and try to push again.
+
+$result
+
+After making fixes, modify your commit to include them, by doing:
+
+git add $basename
+git commit --amend
+
+If you have any further problems or questions, please contact the GNOME Translation Project mailing list 
<gnome-i18n gnome org>. Thank you.
+---
+EOF
+      exit 1
+    fi
+
      # Check for the absence of an executable flag
     if expr "$mode" : ".*\([1357]..\|[1357].\|[1357]\)$" > /dev/null 2>& 1; then
        cat <<EOF >&2


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