You can use localStorage HTML and then make language files in arrays like
lang.english = { hello: "Hello kind sir", bye: "Bye, hope to see you again" }
So, you would call the text as follows if you use jQuery to add to the DOM
$("#welcome p").text(lang.localStorage.getItem("lang").hello);
EDIT: I think you could even make a function to get the correct text.
function getText(text) { var localLanguage = localStorage.getItem("lang"); return lang.localLanguage.text; }
So the correct way would be something like this:
$("#welcome p").text(getText(hello));
Patrick
source share