[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[www_shared] 01/02: add i18n, clean up names
From: |
gnunet |
Subject: |
[www_shared] 01/02: add i18n, clean up names |
Date: |
Fri, 07 May 2021 18:02:45 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository www_shared.
commit 794129fc96ec67b4f6bb50f1b568c5877d2e4e75
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri May 7 17:48:56 2021 +0200
add i18n, clean up names
---
make_site.py => build-site | 1 -
update-messages | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletion(-)
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/update-messages b/update-messages
new file mode 100755
index 0000000..8b0fea2
--- /dev/null
+++ b/update-messages
@@ -0,0 +1,37 @@
+#!/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=""
+
+for i in $( cd locale/; echo */); do
+ languages="$languages ${i%/}"
+done
+
+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.