fix i18n and currency link to respect respectively currency and i18n current user choice

This commit is contained in:
Michael Muré 2014-09-15 20:58:38 +02:00
parent 62ae758e22
commit 89d4cca797
3 changed files with 12 additions and 0 deletions

View file

@ -10259,6 +10259,10 @@ janin.currency = {
// Update title depending on currency // Update title depending on currency
document.title = janin.currency.name() + " " + ninja.translator.get("title"); document.title = janin.currency.name() + " " + ninja.translator.get("title");
document.getElementById("siteTitle").alt = 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&currency=" + janin.currency.name().toLowerCase();
document.getElementById("culturefr").href = "?culture=fr&currency=" + janin.currency.name().toLowerCase();
if(ninja.seeder.isDone()) if(ninja.seeder.isDone())
{ {
@ -12334,6 +12338,8 @@ for(i = 0; i < janin.currencies.length; i++) {
if(janin.currencies[i].donate == null) if(janin.currencies[i].donate == null)
continue; continue;
currencieslist += "<a href='?currency="+janin.currencies[i].name; currencieslist += "<a href='?currency="+janin.currencies[i].name;
if (ninja.getQueryString()["culture"] != undefined)
currencieslist += "&culture=" + ninja.getQueryString()["culture"];
currencieslist += "'>"+janin.currencies[i].name+"</a> "; currencieslist += "'>"+janin.currencies[i].name+"</a> ";
j++; j++;
} }

View file

@ -42,6 +42,10 @@ janin.currency = {
// Update title depending on currency // Update title depending on currency
document.title = janin.currency.name() + " " + ninja.translator.get("title"); document.title = janin.currency.name() + " " + ninja.translator.get("title");
document.getElementById("siteTitle").alt = 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&currency=" + janin.currency.name().toLowerCase();
document.getElementById("culturefr").href = "?culture=fr&currency=" + janin.currency.name().toLowerCase();
if(ninja.seeder.isDone()) if(ninja.seeder.isDone())
{ {

View file

@ -37,6 +37,8 @@ for(i = 0; i < janin.currencies.length; i++) {
if(janin.currencies[i].donate == null) if(janin.currencies[i].donate == null)
continue; continue;
currencieslist += "<a href='?currency="+janin.currencies[i].name; currencieslist += "<a href='?currency="+janin.currencies[i].name;
if (ninja.getQueryString()["culture"] != undefined)
currencieslist += "&culture=" + ninja.getQueryString()["culture"];
currencieslist += "'>"+janin.currencies[i].name+"</a> "; currencieslist += "'>"+janin.currencies[i].name+"</a> ";
j++; j++;
} }