gnunet-svn
[Top][All Lists]
Advanced

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

[www_shared] branch master updated: update pot file only when it has cha


From: gnunet
Subject: [www_shared] branch master updated: update pot file only when it has changes
Date: Fri, 07 May 2021 18:32:53 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository www_shared.

The following commit(s) were added to refs/heads/master by this push:
     new c7c1c92  update pot file only when it has changes
c7c1c92 is described below

commit c7c1c923b8208696c72216651e4788c551eb3c1c
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri May 7 18:30:25 2021 +0200

    update pot file only when it has changes
---
 update-messages | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/update-messages b/update-messages
index 582481c..7565b9a 100755
--- a/update-messages
+++ b/update-messages
@@ -19,7 +19,15 @@ languages=$($sitegen/list-languages)
 echo Using languages $languages
 
 echo "Updating message catalog"
-env "PYTHONPATH=$sitegen:${PYTHONPATH-:}" pybabel extract -F locale/babel.map 
-o locale/messages.pot .
+env "PYTHONPATH=$sitegen:${PYTHONPATH-:}" pybabel extract -F locale/babel.map 
-o locale/messages.pot~ .
+
+diffcount=$(diff locale/messages.pot locale/messages.pot~ | grep "^>" | wc -l)
+
+# Only copy pot file if more than the timestamp changed
+if [[ $diffcount -gt 1 ]]; then
+  cp locale/messages.pot~ locale/messages.pot
+fi
+
 
 echo "Updating existing translations"
 for lang in $languages; do

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]