From 89d4cca797274ab621c69b02c485ef0e829615d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Mon, 15 Sep 2014 20:58:38 +0200 Subject: [PATCH] fix i18n and currency link to respect respectively currency and i18n current user choice --- index.html | 6 ++++++ src/janin.currency.js | 4 ++++ src/ninja.onload.js | 2 ++ 3 files changed, 12 insertions(+) diff --git a/index.html b/index.html index 26d3d13..9183dda 100644 --- a/index.html +++ b/index.html @@ -10259,6 +10259,10 @@ janin.currency = { // Update title depending on currency document.title = janin.currency.name() + " " + ninja.translator.get("title"); document.getElementById("siteTitle").alt = janin.currency.name() + " " + ninja.translator.get("title"); + + // Update i18n link + document.getElementById("cultureen").href = "?culture=en¤cy=" + janin.currency.name().toLowerCase(); + document.getElementById("culturefr").href = "?culture=fr¤cy=" + janin.currency.name().toLowerCase(); if(ninja.seeder.isDone()) { @@ -12334,6 +12338,8 @@ for(i = 0; i < janin.currencies.length; i++) { if(janin.currencies[i].donate == null) continue; currencieslist += ""+janin.currencies[i].name+" "; j++; } diff --git a/src/janin.currency.js b/src/janin.currency.js index 86f2b57..cf8b9c2 100644 --- a/src/janin.currency.js +++ b/src/janin.currency.js @@ -42,6 +42,10 @@ janin.currency = { // Update title depending on currency document.title = janin.currency.name() + " " + ninja.translator.get("title"); document.getElementById("siteTitle").alt = janin.currency.name() + " " + ninja.translator.get("title"); + + // Update i18n link + document.getElementById("cultureen").href = "?culture=en¤cy=" + janin.currency.name().toLowerCase(); + document.getElementById("culturefr").href = "?culture=fr¤cy=" + janin.currency.name().toLowerCase(); if(ninja.seeder.isDone()) { diff --git a/src/ninja.onload.js b/src/ninja.onload.js index 2dd741c..9533d7d 100644 --- a/src/ninja.onload.js +++ b/src/ninja.onload.js @@ -37,6 +37,8 @@ for(i = 0; i < janin.currencies.length; i++) { if(janin.currencies[i].donate == null) continue; currencieslist += ""+janin.currencies[i].name+" "; j++; }