summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-01-30 23:36:10 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-01-30 23:36:10 +0100
commitd1da269b4894c43afef967f0dca6b90e05946ecd (patch)
tree3f6ba3d1461eeb1634260570dde8694e8e94d906
parentd5f793bcd9f47392ee6e61c27f65fa85cbcc5176 (diff)
downloadwww-d1da269b4894c43afef967f0dca6b90e05946ecd.tar.gz
www-d1da269b4894c43afef967f0dca6b90e05946ecd.tar.bz2
www-d1da269b4894c43afef967f0dca6b90e05946ecd.zip
generate HTML with same structure as nginx serves it
-rw-r--r--common/navigation.j2.inc4
-rw-r--r--developers.html.j22
-rw-r--r--governments.html.j22
-rw-r--r--investors.html.j22
-rw-r--r--locale/de/LC_MESSAGES/messages.po17
-rw-r--r--locale/en/LC_MESSAGES/messages.po17
-rw-r--r--locale/es/LC_MESSAGES/messages.po17
-rw-r--r--locale/fr/LC_MESSAGES/messages.po17
-rw-r--r--locale/it/LC_MESSAGES/messages.po17
-rw-r--r--merchants.html.j22
-rwxr-xr-xtemplate.py16
-rwxr-xr-xtemplate.sh1
12 files changed, 36 insertions, 78 deletions
diff --git a/common/navigation.j2.inc b/common/navigation.j2.inc
index fdf5ab56..d0b9d91b 100644
--- a/common/navigation.j2.inc
+++ b/common/navigation.j2.inc
@@ -9,12 +9,12 @@
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav nav-justified">
- <li class="m_index"><a href=".">{{ _("Home") }}</a></li>
+ <li class="m_index"><a href="{{ url_localized('index.html') }}">{{ _("Home") }}</a></li>
<li class="m_demo btn btn-outline-success"><a href="https://demo.taler.net/" target="_blank">{{ _("Demo") }}</a></li>
<li class="m_citizens"><a href="{{ url_localized('citizens.html') }}">{{ _("Citizens") }}</a></li>
<li class="m_merchants"><a href="{{ url_localized('merchants.html') }}">{{ _("Merchants") }}</a></li>
<li class="m_governments"><a href="{{ url_localized('governments.html') }}">{{ _("Governments") }}</a></li>
- <li class="m_investors"><a href="{{ url_localized('operators.html') }}">{{ _("Operators") }}</a></li>
+ <li class="m_investors"><a href="{{ url_localized('investors.html') }}">{{ _("Operators") }}</a></li>
<li class="m_developers"><a href="{{ url_localized('developers.html') }}">{{ _("Developers") }}</a></li>
<li class="m_about"><a href="{{ url_localized('about.html') }}">{{ _("About&nbsp;us") }}</a></li>
</ul>
diff --git a/developers.html.j2 b/developers.html.j2
index bc7fb327..253343fb 100644
--- a/developers.html.j2
+++ b/developers.html.j2
@@ -124,7 +124,7 @@
transactions involve the following steps:
") }}</p>
- <img src="/images/system.svg" alt="system overview" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
+ <img src="{{ url('images/system.svg') }}" alt="system overview" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
<ol>
<li>{{ _("A customer instructs his <b>bank</b> to
transfer funds from his account to the Taler exchange
diff --git a/governments.html.j2 b/governments.html.j2
index 0d48e455..49880c1d 100644
--- a/governments.html.j2
+++ b/governments.html.j2
@@ -66,7 +66,7 @@
Information available to the government includes:
") }}</p>
<p>
- <img src="/images/government.svg" alt="government perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
+ <img src="{{ url('images/government.svg') }}" alt="government perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
</p><ul>
<li>{{ _("From the banking system:
The total amount of digital currency
diff --git a/investors.html.j2 b/investors.html.j2
index 2de7a57f..1ffedaab 100644
--- a/investors.html.j2
+++ b/investors.html.j2
@@ -59,7 +59,7 @@
") }}</p>
<p>
- <img src="/images/exchange.svg" alt="operator perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
+ <img src="{{ url('images/exchange.svg') }}" alt="operator perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
</p><ul>
<li>{{ _("Create a <b>reserve</b> based on an incoming
wire transfer from a customer.") }}</li>
diff --git a/locale/de/LC_MESSAGES/messages.po b/locale/de/LC_MESSAGES/messages.po
index 9c02b0f4..40781877 100644
--- a/locale/de/LC_MESSAGES/messages.po
+++ b/locale/de/LC_MESSAGES/messages.po
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2017-01-30 21:27+0100\n"
+"POT-Creation-Date: 2017-01-30 23:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
@@ -14,13 +14,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-#: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2
-#: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11
-#: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7
-#: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2
-#: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137
-#: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112
-#: wallet.html.j2:194
+#: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2
+#: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2
+#: wallet.html.j2:2
msgid "en"
msgstr "de"
@@ -1561,8 +1557,3 @@ msgstr ""
#~ msgid "About&nbsp;us"
#~ msgstr "Über uns"
-#~ msgid ""
-#~ "This page was created using <a "
-#~ "href='https://www.gnu.org/'>Free Software</a> only."
-#~ msgstr ""
-
diff --git a/locale/en/LC_MESSAGES/messages.po b/locale/en/LC_MESSAGES/messages.po
index 4295c6b3..aad11e27 100644
--- a/locale/en/LC_MESSAGES/messages.po
+++ b/locale/en/LC_MESSAGES/messages.po
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2017-01-30 21:27+0100\n"
+"POT-Creation-Date: 2017-01-30 23:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
@@ -14,13 +14,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-#: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2
-#: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11
-#: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7
-#: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2
-#: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137
-#: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112
-#: wallet.html.j2:194
+#: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2
+#: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2
+#: wallet.html.j2:2
msgid "en"
msgstr ""
@@ -1048,8 +1044,3 @@ msgstr ""
#~ msgid "About&nbsp;us"
#~ msgstr ""
-#~ msgid ""
-#~ "This page was created using <a "
-#~ "href='https://www.gnu.org/'>Free Software</a> only."
-#~ msgstr ""
-
diff --git a/locale/es/LC_MESSAGES/messages.po b/locale/es/LC_MESSAGES/messages.po
index 4bc2d89b..f82d56a1 100644
--- a/locale/es/LC_MESSAGES/messages.po
+++ b/locale/es/LC_MESSAGES/messages.po
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2017-01-30 21:27+0100\n"
+"POT-Creation-Date: 2017-01-30 23:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
@@ -14,13 +14,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-#: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2
-#: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11
-#: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7
-#: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2
-#: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137
-#: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112
-#: wallet.html.j2:194
+#: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2
+#: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2
+#: wallet.html.j2:2
msgid "en"
msgstr "es"
@@ -1571,8 +1567,3 @@ msgstr ""
#~ msgid "About&nbsp;us"
#~ msgstr "Quiénes somos"
-#~ msgid ""
-#~ "This page was created using <a "
-#~ "href='https://www.gnu.org/'>Free Software</a> only."
-#~ msgstr ""
-
diff --git a/locale/fr/LC_MESSAGES/messages.po b/locale/fr/LC_MESSAGES/messages.po
index 78bd85da..d504bc3a 100644
--- a/locale/fr/LC_MESSAGES/messages.po
+++ b/locale/fr/LC_MESSAGES/messages.po
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2017-01-30 21:27+0100\n"
+"POT-Creation-Date: 2017-01-30 23:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: fr\n"
@@ -14,13 +14,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-#: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2
-#: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11
-#: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7
-#: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2
-#: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137
-#: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112
-#: wallet.html.j2:194
+#: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2
+#: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2
+#: wallet.html.j2:2
msgid "en"
msgstr "fr"
@@ -1557,8 +1553,3 @@ msgstr ""
#~ msgid "About&nbsp;us"
#~ msgstr "À&nbsp;propos"
-#~ msgid ""
-#~ "This page was created using <a "
-#~ "href='https://www.gnu.org/'>Free Software</a> only."
-#~ msgstr ""
-
diff --git a/locale/it/LC_MESSAGES/messages.po b/locale/it/LC_MESSAGES/messages.po
index 2df87084..a2545ba0 100644
--- a/locale/it/LC_MESSAGES/messages.po
+++ b/locale/it/LC_MESSAGES/messages.po
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2017-01-30 21:27+0100\n"
+"POT-Creation-Date: 2017-01-30 23:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: it\n"
@@ -14,13 +14,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-#: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2
-#: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11
-#: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7
-#: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2
-#: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137
-#: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112
-#: wallet.html.j2:194
+#: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2
+#: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2
+#: wallet.html.j2:2
msgid "en"
msgstr "it"
@@ -1569,8 +1565,3 @@ msgstr ""
#~ msgid "About&nbsp;us"
#~ msgstr "Chi siamo"
-#~ msgid ""
-#~ "This page was created using <a "
-#~ "href='https://www.gnu.org/'>Free Software</a> only."
-#~ msgstr ""
-
diff --git a/merchants.html.j2 b/merchants.html.j2
index 48ea6019..34771b66 100644
--- a/merchants.html.j2
+++ b/merchants.html.j2
@@ -89,7 +89,7 @@
") }}</p>
<p>
- <img src="/images/merchant.svg" alt="merchant perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
+ <img src="{{ url('images/merchant.svg') }}" alt="merchant perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%">
<ol>
<li>{{ _("The new logic detects when a customer's system
supports Taler and then needs to send a cryptographically signed
diff --git a/template.py b/template.py
index 1fdf3b85..e86574db 100755
--- a/template.py
+++ b/template.py
@@ -25,19 +25,21 @@ env.install_gettext_translations(tr, newstyle=True)
tmpl = env.get_template(in_file)
-def self_localized(x):
- return ".".join((name, x, ext))
+def self_localized(other_locale):
+ """
+ Return URL for the current page in another locale.
+ """
+ return "../" + other_locale + "/" + in_file.rstrip(".j2")
-def url_localized(my_file):
- my_name, my_ext = re.match(r"(.*)\.([^.]+)$", my_file).groups()
- return ".".join((my_name, locale, my_ext))
+def url_localized(filename):
+ return "../" + locale + "/" + filename
def url(x):
# TODO: look at the app root environment variable
# TODO: check if file exists
- return x
+ return "../" + x
import codecs
-f = codecs.open(".".join((name, locale, ext)), "w", "utf-8")
+f = codecs.open("./" + locale + "/" + in_file.rstrip(".j2"), "w", "utf-8")
f.write(tmpl.render(lang=locale, url=url, self_localized=self_localized, url_localized=url_localized))
f.close()
diff --git a/template.sh b/template.sh
index a33cefe8..1c743617 100755
--- a/template.sh
+++ b/template.sh
@@ -3,6 +3,7 @@
for f in $(git ls-files *.j2); do
for ld in locale/*/; do
l=$(basename $ld)
+ mkdir -p $(basename $l)
echo "$f: $l"
python template.py $f $l
done