I am using jquery code to handle language translation, I have in my previous posts, gotten the code to handle most text and ajax translations.
And this code even works 100% in firefox, but when testing on google chrome 5.0.365.2 Dev
$("input:button,input:submit").each(function() {
var value = $(this).val();
// check if there is value
if (value != undefined) {
for (var x = 0; x < en_count; x++) {
var from = en_lang[x];
var to = toCache[x];
// if node has data translated skip it
var ist = $(this).data('translated');
if (ist != 'yes') {
if (value.match(from)) {
value = to;
$(this).attr('value',to);
}
}
}
}
});
Before this code, I create 2 array's 1 for english and 1 for an other language.
en_lng contains the array for english text on this page. toCache contains the array for the other language, that i am translating to.
To help make sure not to translate a piece of text more than once, I am using the data property, and storing the value of 'translated'.
So in the end, this code is just for translating input button/submit text.
Thank You....