I am doing a company site, and my task is do the ‘translate’. It was requested to do in JavaScript, and was done. This way, when I click on the flag and select the language, the page is translated automatically. However, when I load another page, the website is not being able to hold the ‘cookie’ and loses the translation, going back to Portuguese. Can anybody help me to solve that? Any solution/suggestion? Here is the website for reference: http://whatsac.com/traducao/
Below are the codings:
var _t = $('body').translate({lang: "pt", t: t});
var str = _t.g("translate");
console.log(str);
$(".lang_selector").click(function(ev) {
var lang = $(this).attr("data-value");
_t.lang(lang);
console.log(lang);
ev.preventDefault();
});
});