Basically need to generate custom(some different then yes no) messeges(alert) in JS , how to deal with translation in it?
Plese take a look at jQuery-i18n translation plugin
var my_dictionary = {
"some text" : "a translation",
"some more text" : "another translation"
}
$.i18n.load(my_dictionary);
$('div#example').text($.i18n._('some text'));
And jQuery localisation
$.localise('js/greeting');
$('#greeting').val(greeting);
$('#languages').val($.localise.defaultLanguage);
$('#changeLocale').change(function() {
var newLang = $(this).val();
$.localise('js/greeting', {language: newLang, loadBase: true});
$('#greeting').val(greeting);
$('#languages').val(newLang);
});
Or, If you really want more translation than looking up data, try google translate api
google.language.translate("Hello world", "en", "es", function(result) {
if (!result.error) {
var container = document.getElementById("translation");
container.innerHTML = result.translation;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With