diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-01-30 23:36:10 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-01-30 23:36:10 +0100 |
commit | d1da269b4894c43afef967f0dca6b90e05946ecd (patch) | |
tree | 3f6ba3d1461eeb1634260570dde8694e8e94d906 | |
parent | d5f793bcd9f47392ee6e61c27f65fa85cbcc5176 (diff) | |
download | www-d1da269b4894c43afef967f0dca6b90e05946ecd.tar.gz www-d1da269b4894c43afef967f0dca6b90e05946ecd.zip |
generate HTML with same structure as nginx serves it
-rw-r--r-- | common/navigation.j2.inc | 4 | ||||
-rw-r--r-- | developers.html.j2 | 2 | ||||
-rw-r--r-- | governments.html.j2 | 2 | ||||
-rw-r--r-- | investors.html.j2 | 2 | ||||
-rw-r--r-- | locale/de/LC_MESSAGES/messages.po | 17 | ||||
-rw-r--r-- | locale/en/LC_MESSAGES/messages.po | 17 | ||||
-rw-r--r-- | locale/es/LC_MESSAGES/messages.po | 17 | ||||
-rw-r--r-- | locale/fr/LC_MESSAGES/messages.po | 17 | ||||
-rw-r--r-- | locale/it/LC_MESSAGES/messages.po | 17 | ||||
-rw-r--r-- | merchants.html.j2 | 2 | ||||
-rwxr-xr-x | template.py | 16 | ||||
-rwxr-xr-x | template.sh | 1 |
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 @@ | |||
9 | </div> | 9 | </div> |
10 | <div class="collapse navbar-collapse" id="main-navbar"> | 10 | <div class="collapse navbar-collapse" id="main-navbar"> |
11 | <ul class="nav nav-justified"> | 11 | <ul class="nav nav-justified"> |
12 | <li class="m_index"><a href=".">{{ _("Home") }}</a></li> | 12 | <li class="m_index"><a href="{{ url_localized('index.html') }}">{{ _("Home") }}</a></li> |
13 | <li class="m_demo btn btn-outline-success"><a href="https://demo.taler.net/" target="_blank">{{ _("Demo") }}</a></li> | 13 | <li class="m_demo btn btn-outline-success"><a href="https://demo.taler.net/" target="_blank">{{ _("Demo") }}</a></li> |
14 | <li class="m_citizens"><a href="{{ url_localized('citizens.html') }}">{{ _("Citizens") }}</a></li> | 14 | <li class="m_citizens"><a href="{{ url_localized('citizens.html') }}">{{ _("Citizens") }}</a></li> |
15 | <li class="m_merchants"><a href="{{ url_localized('merchants.html') }}">{{ _("Merchants") }}</a></li> | 15 | <li class="m_merchants"><a href="{{ url_localized('merchants.html') }}">{{ _("Merchants") }}</a></li> |
16 | <li class="m_governments"><a href="{{ url_localized('governments.html') }}">{{ _("Governments") }}</a></li> | 16 | <li class="m_governments"><a href="{{ url_localized('governments.html') }}">{{ _("Governments") }}</a></li> |
17 | <li class="m_investors"><a href="{{ url_localized('operators.html') }}">{{ _("Operators") }}</a></li> | 17 | <li class="m_investors"><a href="{{ url_localized('investors.html') }}">{{ _("Operators") }}</a></li> |
18 | <li class="m_developers"><a href="{{ url_localized('developers.html') }}">{{ _("Developers") }}</a></li> | 18 | <li class="m_developers"><a href="{{ url_localized('developers.html') }}">{{ _("Developers") }}</a></li> |
19 | <li class="m_about"><a href="{{ url_localized('about.html') }}">{{ _("About us") }}</a></li> | 19 | <li class="m_about"><a href="{{ url_localized('about.html') }}">{{ _("About us") }}</a></li> |
20 | </ul> | 20 | </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 @@ | |||
124 | transactions involve the following steps: | 124 | transactions involve the following steps: |
125 | ") }}</p> | 125 | ") }}</p> |
126 | 126 | ||
127 | <img src="/images/system.svg" alt="system overview" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> | 127 | <img src="{{ url('images/system.svg') }}" alt="system overview" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> |
128 | <ol> | 128 | <ol> |
129 | <li>{{ _("A customer instructs his <b>bank</b> to | 129 | <li>{{ _("A customer instructs his <b>bank</b> to |
130 | transfer funds from his account to the Taler exchange | 130 | 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 @@ | |||
66 | Information available to the government includes: | 66 | Information available to the government includes: |
67 | ") }}</p> | 67 | ") }}</p> |
68 | <p> | 68 | <p> |
69 | <img src="/images/government.svg" alt="government perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> | 69 | <img src="{{ url('images/government.svg') }}" alt="government perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> |
70 | </p><ul> | 70 | </p><ul> |
71 | <li>{{ _("From the banking system: | 71 | <li>{{ _("From the banking system: |
72 | The total amount of digital currency | 72 | 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 @@ | |||
59 | ") }}</p> | 59 | ") }}</p> |
60 | 60 | ||
61 | <p> | 61 | <p> |
62 | <img src="/images/exchange.svg" alt="operator perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> | 62 | <img src="{{ url('images/exchange.svg') }}" alt="operator perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> |
63 | </p><ul> | 63 | </p><ul> |
64 | <li>{{ _("Create a <b>reserve</b> based on an incoming | 64 | <li>{{ _("Create a <b>reserve</b> based on an incoming |
65 | wire transfer from a customer.") }}</li> | 65 | 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 "" | |||
3 | msgstr "" | 3 | msgstr "" |
4 | "Project-Id-Version: PROJECT VERSION\n" | 4 | "Project-Id-Version: PROJECT VERSION\n" |
5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
6 | "POT-Creation-Date: 2017-01-30 21:27+0100\n" | 6 | "POT-Creation-Date: 2017-01-30 23:16+0100\n" |
7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
9 | "Language: de\n" | 9 | "Language: de\n" |
@@ -14,13 +14,9 @@ msgstr "" | |||
14 | "Content-Transfer-Encoding: 8bit\n" | 14 | "Content-Transfer-Encoding: 8bit\n" |
15 | "Generated-By: Babel 2.3.4\n" | 15 | "Generated-By: Babel 2.3.4\n" |
16 | 16 | ||
17 | #: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2 | 17 | #: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2 |
18 | #: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11 | 18 | #: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2 |
19 | #: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7 | 19 | #: wallet.html.j2:2 |
20 | #: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2 | ||
21 | #: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137 | ||
22 | #: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112 | ||
23 | #: wallet.html.j2:194 | ||
24 | msgid "en" | 20 | msgid "en" |
25 | msgstr "de" | 21 | msgstr "de" |
26 | 22 | ||
@@ -1561,8 +1557,3 @@ msgstr "" | |||
1561 | #~ msgid "About us" | 1557 | #~ msgid "About us" |
1562 | #~ msgstr "Über uns" | 1558 | #~ msgstr "Über uns" |
1563 | 1559 | ||
1564 | #~ msgid "" | ||
1565 | #~ "This page was created using <a " | ||
1566 | #~ "href='https://www.gnu.org/'>Free Software</a> only." | ||
1567 | #~ msgstr "" | ||
1568 | |||
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 "" | |||
3 | msgstr "" | 3 | msgstr "" |
4 | "Project-Id-Version: PROJECT VERSION\n" | 4 | "Project-Id-Version: PROJECT VERSION\n" |
5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
6 | "POT-Creation-Date: 2017-01-30 21:27+0100\n" | 6 | "POT-Creation-Date: 2017-01-30 23:16+0100\n" |
7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
9 | "Language: en\n" | 9 | "Language: en\n" |
@@ -14,13 +14,9 @@ msgstr "" | |||
14 | "Content-Transfer-Encoding: 8bit\n" | 14 | "Content-Transfer-Encoding: 8bit\n" |
15 | "Generated-By: Babel 2.3.4\n" | 15 | "Generated-By: Babel 2.3.4\n" |
16 | 16 | ||
17 | #: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2 | 17 | #: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2 |
18 | #: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11 | 18 | #: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2 |
19 | #: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7 | 19 | #: wallet.html.j2:2 |
20 | #: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2 | ||
21 | #: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137 | ||
22 | #: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112 | ||
23 | #: wallet.html.j2:194 | ||
24 | msgid "en" | 20 | msgid "en" |
25 | msgstr "" | 21 | msgstr "" |
26 | 22 | ||
@@ -1048,8 +1044,3 @@ msgstr "" | |||
1048 | #~ msgid "About us" | 1044 | #~ msgid "About us" |
1049 | #~ msgstr "" | 1045 | #~ msgstr "" |
1050 | 1046 | ||
1051 | #~ msgid "" | ||
1052 | #~ "This page was created using <a " | ||
1053 | #~ "href='https://www.gnu.org/'>Free Software</a> only." | ||
1054 | #~ msgstr "" | ||
1055 | |||
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 "" | |||
3 | msgstr "" | 3 | msgstr "" |
4 | "Project-Id-Version: PROJECT VERSION\n" | 4 | "Project-Id-Version: PROJECT VERSION\n" |
5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
6 | "POT-Creation-Date: 2017-01-30 21:27+0100\n" | 6 | "POT-Creation-Date: 2017-01-30 23:16+0100\n" |
7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
9 | "Language: es\n" | 9 | "Language: es\n" |
@@ -14,13 +14,9 @@ msgstr "" | |||
14 | "Content-Transfer-Encoding: 8bit\n" | 14 | "Content-Transfer-Encoding: 8bit\n" |
15 | "Generated-By: Babel 2.3.4\n" | 15 | "Generated-By: Babel 2.3.4\n" |
16 | 16 | ||
17 | #: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2 | 17 | #: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2 |
18 | #: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11 | 18 | #: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2 |
19 | #: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7 | 19 | #: wallet.html.j2:2 |
20 | #: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2 | ||
21 | #: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137 | ||
22 | #: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112 | ||
23 | #: wallet.html.j2:194 | ||
24 | msgid "en" | 20 | msgid "en" |
25 | msgstr "es" | 21 | msgstr "es" |
26 | 22 | ||
@@ -1571,8 +1567,3 @@ msgstr "" | |||
1571 | #~ msgid "About us" | 1567 | #~ msgid "About us" |
1572 | #~ msgstr "Quiénes somos" | 1568 | #~ msgstr "Quiénes somos" |
1573 | 1569 | ||
1574 | #~ msgid "" | ||
1575 | #~ "This page was created using <a " | ||
1576 | #~ "href='https://www.gnu.org/'>Free Software</a> only." | ||
1577 | #~ msgstr "" | ||
1578 | |||
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 "" | |||
3 | msgstr "" | 3 | msgstr "" |
4 | "Project-Id-Version: PROJECT VERSION\n" | 4 | "Project-Id-Version: PROJECT VERSION\n" |
5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
6 | "POT-Creation-Date: 2017-01-30 21:27+0100\n" | 6 | "POT-Creation-Date: 2017-01-30 23:16+0100\n" |
7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
9 | "Language: fr\n" | 9 | "Language: fr\n" |
@@ -14,13 +14,9 @@ msgstr "" | |||
14 | "Content-Transfer-Encoding: 8bit\n" | 14 | "Content-Transfer-Encoding: 8bit\n" |
15 | "Generated-By: Babel 2.3.4\n" | 15 | "Generated-By: Babel 2.3.4\n" |
16 | 16 | ||
17 | #: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2 | 17 | #: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2 |
18 | #: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11 | 18 | #: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2 |
19 | #: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7 | 19 | #: wallet.html.j2:2 |
20 | #: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2 | ||
21 | #: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137 | ||
22 | #: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112 | ||
23 | #: wallet.html.j2:194 | ||
24 | msgid "en" | 20 | msgid "en" |
25 | msgstr "fr" | 21 | msgstr "fr" |
26 | 22 | ||
@@ -1557,8 +1553,3 @@ msgstr "" | |||
1557 | #~ msgid "About us" | 1553 | #~ msgid "About us" |
1558 | #~ msgstr "À propos" | 1554 | #~ msgstr "À propos" |
1559 | 1555 | ||
1560 | #~ msgid "" | ||
1561 | #~ "This page was created using <a " | ||
1562 | #~ "href='https://www.gnu.org/'>Free Software</a> only." | ||
1563 | #~ msgstr "" | ||
1564 | |||
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 "" | |||
3 | msgstr "" | 3 | msgstr "" |
4 | "Project-Id-Version: PROJECT VERSION\n" | 4 | "Project-Id-Version: PROJECT VERSION\n" |
5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" |
6 | "POT-Creation-Date: 2017-01-30 21:27+0100\n" | 6 | "POT-Creation-Date: 2017-01-30 23:16+0100\n" |
7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
9 | "Language: it\n" | 9 | "Language: it\n" |
@@ -14,13 +14,9 @@ msgstr "" | |||
14 | "Content-Transfer-Encoding: 8bit\n" | 14 | "Content-Transfer-Encoding: 8bit\n" |
15 | "Generated-By: Babel 2.3.4\n" | 15 | "Generated-By: Babel 2.3.4\n" |
16 | 16 | ||
17 | #: about.html.j2:2 about.html.j2:118 citizens.html.j2:2 developers.html.j2:2 | 17 | #: about.html.j2:2 citizens.html.j2:2 developers.html.j2:2 |
18 | #: governments.html.j2:2 governments.html.j2:7 governments.html.j2:11 | 18 | #: governments.html.j2:2 investors.html.j2:2 merchants.html.j2:2 news.html.j2:2 |
19 | #: governments.html.j2:101 investors.html.j2:2 investors.html.j2:7 | 19 | #: wallet.html.j2:2 |
20 | #: investors.html.j2:11 investors.html.j2:80 merchants.html.j2:2 | ||
21 | #: merchants.html.j2:7 merchants.html.j2:11 merchants.html.j2:137 | ||
22 | #: news.html.j2:2 wallet.html.j2:2 wallet.html.j2:7 wallet.html.j2:112 | ||
23 | #: wallet.html.j2:194 | ||
24 | msgid "en" | 20 | msgid "en" |
25 | msgstr "it" | 21 | msgstr "it" |
26 | 22 | ||
@@ -1569,8 +1565,3 @@ msgstr "" | |||
1569 | #~ msgid "About us" | 1565 | #~ msgid "About us" |
1570 | #~ msgstr "Chi siamo" | 1566 | #~ msgstr "Chi siamo" |
1571 | 1567 | ||
1572 | #~ msgid "" | ||
1573 | #~ "This page was created using <a " | ||
1574 | #~ "href='https://www.gnu.org/'>Free Software</a> only." | ||
1575 | #~ msgstr "" | ||
1576 | |||
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 @@ | |||
89 | ") }}</p> | 89 | ") }}</p> |
90 | 90 | ||
91 | <p> | 91 | <p> |
92 | <img src="/images/merchant.svg" alt="merchant perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> | 92 | <img src="{{ url('images/merchant.svg') }}" alt="merchant perspective" style="float: right; margin: 50px 5px 5px 5px;" width="50%"> |
93 | <ol> | 93 | <ol> |
94 | <li>{{ _("The new logic detects when a customer's system | 94 | <li>{{ _("The new logic detects when a customer's system |
95 | supports Taler and then needs to send a cryptographically signed | 95 | 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) | |||
25 | 25 | ||
26 | tmpl = env.get_template(in_file) | 26 | tmpl = env.get_template(in_file) |
27 | 27 | ||
28 | def self_localized(x): | 28 | def self_localized(other_locale): |
29 | return ".".join((name, x, ext)) | 29 | """ |
30 | Return URL for the current page in another locale. | ||
31 | """ | ||
32 | return "../" + other_locale + "/" + in_file.rstrip(".j2") | ||
30 | 33 | ||
31 | def url_localized(my_file): | 34 | def url_localized(filename): |
32 | my_name, my_ext = re.match(r"(.*)\.([^.]+)$", my_file).groups() | 35 | return "../" + locale + "/" + filename |
33 | return ".".join((my_name, locale, my_ext)) | ||
34 | 36 | ||
35 | def url(x): | 37 | def url(x): |
36 | # TODO: look at the app root environment variable | 38 | # TODO: look at the app root environment variable |
37 | # TODO: check if file exists | 39 | # TODO: check if file exists |
38 | return x | 40 | return "../" + x |
39 | 41 | ||
40 | import codecs | 42 | import codecs |
41 | f = codecs.open(".".join((name, locale, ext)), "w", "utf-8") | 43 | f = codecs.open("./" + locale + "/" + in_file.rstrip(".j2"), "w", "utf-8") |
42 | f.write(tmpl.render(lang=locale, url=url, self_localized=self_localized, url_localized=url_localized)) | 44 | f.write(tmpl.render(lang=locale, url=url, self_localized=self_localized, url_localized=url_localized)) |
43 | f.close() | 45 | f.close() |
diff --git a/template.sh b/template.sh index a33cefe8..1c743617 100755 --- a/template.sh +++ b/template.sh | |||
@@ -3,6 +3,7 @@ | |||
3 | for f in $(git ls-files *.j2); do | 3 | for f in $(git ls-files *.j2); do |
4 | for ld in locale/*/; do | 4 | for ld in locale/*/; do |
5 | l=$(basename $ld) | 5 | l=$(basename $ld) |
6 | mkdir -p $(basename $l) | ||
6 | echo "$f: $l" | 7 | echo "$f: $l" |
7 | python template.py $f $l | 8 | python template.py $f $l |
8 | done | 9 | done |