jquery - Localize HTML-Page with JavaScript -
i have simple html-page, there have several text-elements. want localizise, english, german, , so.
here found snippet, don't them work: handling multilanguage jquery only why not correct syntax:
js:
label["login"]["fr"]="connection"; label["login"]["en"]="login"; ... //some click-listener change language elements $("*[tag='ist_ml']").each(function() { $(this).html(label[$(this).attr("ml_label")]["en"]); }); //end click-listener
html:
<label tag='ist_ml' ml_label='login' for='txtlogin'></label>
some great, or other simple ideas.
define variables before trying store data:
label = {}; label["login"] = {}; label["login"]["fr"]="connection"; label["login"]["en"]="login";
or
label = { login : { fr : "connection", en : "login" } };
Comments
Post a Comment