javascript - Multi language support -
I'm developing an HTML5 application that uses jQuery. I want to make it multi language: To locate the user's language and to change all the literals in the language of the user.
I think an HTML file is used for each language supported, but it is a waste of space
to change all written words in the user's language Another approach could be the use of jQuery. But I'm not sure how to do this.
What do you think? Is there a better way?
Update: I have forgotten to say that I have some texts in javascript too. Do not you type any server-side query in user's language and then read the appropriate text Automatically load? CMS may also be suitable here For all JavaScript code, I will use string literals as a variable. Therefore you can load a different language file suitable for the user language. File English Js: file german.js: and in your JavaScript: Or am I missing the point here? ;)
var messages_siteA1 = "This is a warning."; Var message_siteA2 = "..."; // ...
var messages_siteA1 = "That time is the warning."; Var message_siteA2 = "..."; // ...
Warning (messages_siteA1);
Comments
Post a Comment