[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-www] branch master updated: i18n: fix js, lang switc
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-www] branch master updated: i18n: fix js, lang switcher |
Date: |
Thu, 19 Jan 2017 23:43:53 +0100 |
This is an automated email from the git hooks/post-receive script.
tg pushed a commit to branch master
in repository www.
The following commit(s) were added to refs/heads/master by this push:
new 592850e i18n: fix js, lang switcher
592850e is described below
commit 592850e144e38520fb166ee490c25b0283257d16
Author: tg(x) <address@hidden>
AuthorDate: Thu Jan 19 23:45:29 2017 +0100
i18n: fix js, lang switcher
---
about.html.j2 | 2 +-
citizens.html.j2 | 2 +-
common/header.inc.j2 | 1 +
common/navigation.inc.j2 | 10 ++++----
developers.html.j2 | 2 +-
financial-news.html.j2 | 2 +-
governments.html.j2 | 2 +-
index.html.j2 | 2 +-
investors.html.j2 | 2 +-
lang.css | 60 ------------------------------------------------
lang.js => menu.js | 48 --------------------------------------
merchants.html.j2 | 2 +-
news.html.j2 | 2 +-
wallet.html.j2 | 2 +-
14 files changed, 16 insertions(+), 123 deletions(-)
diff --git a/about.html.j2 b/about.html.j2
index 7880cf6..335d213 100644
--- a/about.html.j2
+++ b/about.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/citizens.html.j2 b/citizens.html.j2
index d625627..77212e9 100644
--- a/citizens.html.j2
+++ b/citizens.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/common/header.inc.j2 b/common/header.inc.j2
index 4115aaf..b71482d 100644
--- a/common/header.inc.j2
+++ b/common/header.inc.j2
@@ -35,6 +35,7 @@
<link href="/justified-nav.css" rel="stylesheet">
<link href="/styles.css" rel="stylesheet">
+ <script src="/menu.js"></script>
<script src="/dist/js/jquery-1.11.1.min.js"></script>
<script src="/dist/js/bootstrap.min.js"></script>
diff --git a/common/navigation.inc.j2 b/common/navigation.inc.j2
index 7b42146..90c328a 100644
--- a/common/navigation.inc.j2
+++ b/common/navigation.inc.j2
@@ -22,10 +22,10 @@
</div>
<div class="navbar navbar-default navbar-fixed-bottom"
role="navigation">
<div class="container lang-slector">
- <a href="/en/"><img src="/images/gb.png" height="15" width="23"
alt="English"></a>
- <a href="/de/"><img src="/images/de.png" height="15" width="25"
alt="Deutsch"></a>
- <a href="/fr/"><img src="/images/fr.png" height="15" width="22"
alt="Français"></a>
- <a href="/it/"><img src="/images/it.png" height="15" width="22"
alt="Italiano"></a>
- <a href="/es/"><img src="/images/es.png" height="15" width="23"
alt="Español"></a>
+ <a href="#"
onclick="location.pathname=location.pathname.replace(/^.../, '/en')"><img
src="/images/gb.png" height="15" width="23" alt="English"></a>
+ <a href="#"
onclick="location.pathname=location.pathname.replace(/^.../, '/de')"><img
src="/images/de.png" height="15" width="25" alt="Deutsch"></a>
+ <a href="#"
onclick="location.pathname=location.pathname.replace(/^.../, '/fr')"><img
src="/images/fr.png" height="15" width="22" alt="Français"></a>
+ <a href="#"
onclick="location.pathname=location.pathname.replace(/^.../, '/it')"><img
src="/images/it.png" height="15" width="22" alt="Italiano"></a>
+ <a href="#"
onclick="location.pathname=location.pathname.replace(/^.../, '/es')"><img
src="/images/es.png" height="15" width="23" alt="Español"></a>
</div>
</div>
diff --git a/developers.html.j2 b/developers.html.j2
index 0225ef7..02e6bea 100644
--- a/developers.html.j2
+++ b/developers.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/financial-news.html.j2 b/financial-news.html.j2
index b85d7fd..e424db8 100644
--- a/financial-news.html.j2
+++ b/financial-news.html.j2
@@ -6,7 +6,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onLoad="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/governments.html.j2 b/governments.html.j2
index 79af28e..83f244c 100644
--- a/governments.html.j2
+++ b/governments.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/index.html.j2 b/index.html.j2
index c012ae5..5f95a3c 100644
--- a/index.html.j2
+++ b/index.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="Anonymous electronic payments for civil
society">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/investors.html.j2 b/investors.html.j2
index a87070e..1dffdb8 100644
--- a/investors.html.j2
+++ b/investors.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/lang.css b/lang.css
deleted file mode 100644
index 72b5a2c..0000000
--- a/lang.css
+++ /dev/null
@@ -1,60 +0,0 @@
-body.en :lang(de) {
- display: none;
-}
-body.en :lang(fr) {
- display: none;
-}
-body.en :lang(it) {
- display: none;
-}
-body.en :lang(es) {
- display: none;
-}
-body.de :lang(en) {
- display: none;
-}
-body.de :lang(fr) {
- display: none;
-}
-body.de :lang(it) {
- display: none;
-}
-body.de :lang(es) {
- display: none;
-}
-body.fr :lang(de) {
- display: none;
-}
-body.fr :lang(en) {
- display: none;
-}
-body.fr :lang(it) {
- display: none;
-}
-body.fr :lang(es) {
- display: none;
-}
-body.it :lang(de) {
- display: none;
-}
-body.it :lang(en) {
- display: none;
-}
-body.it :lang(fr) {
- display: none;
-}
-body.it :lang(es) {
- display: none;
-}
-body.es :lang(de) {
- display: none;
-}
-body.es :lang(en) {
- display: none;
-}
-body.es :lang(fr) {
- display: none;
-}
-body.es :lang(it) {
- display: none;
-}
diff --git a/lang.js b/menu.js
similarity index 56%
rename from lang.js
rename to menu.js
index 24faa9f..3026dab 100644
--- a/lang.js
+++ b/menu.js
@@ -24,54 +24,6 @@
// @license
magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt
GPL-v3-or-Later
-function supports_html5_storage() {
- try {
- return 'sessionStorage' in window && window['sessionStorage']
!== null;
- } catch (e) {
- return false;
- }
-}
-
-function setLang(l)
-{
- document.body.className=l;
- document.body.parentNode.setAttribute('lang', l);
-
- if (supports_html5_storage()) {
- sessionStorage.setItem('lang', l);
- }
- if (l == 'en') document.title = 'GNU Taler - Taxable Anonymous Libre
Electronic Reserve';
- if (l == 'de') document.title = 'GNU Taler - Taxierbare Anonyme
Liberale Elektronische Reserven';
- if (l == 'fr') document.title = 'GNU Taler - Taxable Anonyme Libre
Électronique Réserve';
- if (l == 'it') document.title = 'GNU Taler';
-}
-
-function get_default_lang()
-{
- langs = ['en', 'de', 'fr', 'it'];
-
- for (var i in navigator.languages) {
- for (var j in langs) {
- if (navigator.languages[i].indexOf(langs[j]) != -1) {
- return langs[j];
- }
- }
- }
-
- return 'en';
-}
-
-function loadLang()
-{
- l = 'null';
- if (supports_html5_storage()) {
- l = sessionStorage.getItem('lang');
- }
-
- if (l == 'null') l = get_default_lang();
- setLang(l);
-}
-
function activate_menu()
{
b = document.getElementsByClassName("m_" +
document.URL.replace(/^.*(\\|\/|\:)/, '').split('.')[0])
diff --git a/merchants.html.j2 b/merchants.html.j2
index f5fbd09..f1ed4e3 100644
--- a/merchants.html.j2
+++ b/merchants.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/news.html.j2 b/news.html.j2
index f3ea6b2..54dc6f4 100644
--- a/news.html.j2
+++ b/news.html.j2
@@ -4,7 +4,7 @@
<meta name="description" content="">
<!--# include file="common/header.{{ _("en") }}.inc" -->
</head>
- <body class="en" onload="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
diff --git a/wallet.html.j2 b/wallet.html.j2
index 7b4914a..7045e64 100644
--- a/wallet.html.j2
+++ b/wallet.html.j2
@@ -107,7 +107,7 @@ document.addEventListener('DOMContentLoaded', onLoad);
</style>
</head>
- <body class="en" onLoad="loadLang();">
+ <body>
<div class="container">
<!--# include file="common/navigation.{{ _("en") }}.inc" -->
<!-- Jumbotron -->
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-www] branch master updated: i18n: fix js, lang switcher,
gnunet <=