1

I have a simple html-page, there I have several text-elements. This I want to localizise, english, german, and so.

Here I found some snippet, but I don't get them to work: Handling multilanguage with JQuery only Why is this not a correct syntax:

js:

label["login"]["fr"]="Connection";
label["login"]["en"]="Login";
...
//some Click-Listener change all 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 help where great, or some other simple ideas.

4

4 に答える 4

0

パーティーに数分遅れましたが、参考までに私の実用的なソリューションを次に示します。

http://jsfiddle.net/adnrw/jStET/1/

上記のように、何かを追加する前にarray()forを宣言する必要があります。label

于 2013-07-18T07:13:33.610 に答える