gnunet-svn
[Top][All Lists]
Advanced

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

[www_shared] branch master updated (20d3bab -> dc1f914)


From: gnunet
Subject: [www_shared] branch master updated (20d3bab -> dc1f914)
Date: Fri, 07 May 2021 18:02:44 +0200

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

dold pushed a change to branch master
in repository www_shared.

    from 20d3bab  emit sitemap after static file pass
     new 794129f  add i18n, clean up names
     new dc1f914  better language listing from www.yml

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 make_site.py => build-site |  1 -
 list-languages             |  8 ++++++++
 update-messages            | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 rename make_site.py => build-site (99%)
 create mode 100755 list-languages
 create mode 100755 update-messages

diff --git a/make_site.py b/build-site
similarity index 99%
rename from make_site.py
rename to build-site
index 35cc333..935f605 100755
--- a/make_site.py
+++ b/build-site
@@ -19,7 +19,6 @@ sys.path.insert(0, ".")
 
 from sitegen.site import SiteGenerator
 
-
 def main():
     x = SiteGenerator()
     x.run()
diff --git a/list-languages b/list-languages
new file mode 100755
index 0000000..9df48ac
--- /dev/null
+++ b/list-languages
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+from ruamel.yaml import YAML
+from pathlib import Path
+yaml = YAML(typ="safe")
+config = yaml.load(Path("www.yml"))
+langs = config["langs_full"]
+print(" ".join(langs))
diff --git a/update-messages b/update-messages
new file mode 100755
index 0000000..582481c
--- /dev/null
+++ b/update-messages
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+# This script extracts translations (into locale/messages.pot),
+# updates existing translations (locale/$lang/messages.po)
+# and fails if a conflict happened.
+#
+# @author Florian Dold <dold@taler.net>
+
+SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+set -eu
+
+root=$PWD
+sitegen=$SCRIPTPATH
+
+cd $root
+
+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 .
+
+echo "Updating existing translations"
+for lang in $languages; do
+        msgmerge -q -U -m --previous locale/$lang/LC_MESSAGES/messages.po 
locale/messages.pot
+done
+
+# Check for conflicts
+if grep -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then
+        echo "ERROR: Conflicts encountered in PO files.";
+        exit 1;
+fi

-- 
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]