summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2014-07-28 19:08:21 (GMT)
committerOlav Vitters <olav@vitters.nl>2014-07-28 19:08:21 (GMT)
commit1bcb0f3383c298b7e3be718ded7964aafbd7e5ab (patch)
tree7ff95ad585b0217ebd3da0e54ebae46788af5929
parent0543891b316c67dfb1ea63086a72c6690c7f0472 (diff)
downloadsysadmin-bin-1bcb0f3383c298b7e3be718ded7964aafbd7e5ab.zip
sysadmin-bin-1bcb0f3383c298b7e3be718ded7964aafbd7e5ab.tar.xz
add simplistic check to ensure keywords in desktop files are properly translated
-rwxr-xr-xgit/pre-receive-check-po24
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