I currently have a languages.js set up as such:var MaterialProperties = 0;var YieldStrength = 1;var OtherPhrases = 2;//continue to list other phrases - there are 40+var English = [    Material Properties,    Yield Strength,    Other Phrases];var Chinese = [    // Chinese string that means Material Properties,    // Chinese string that means Yield Strength,    // Other phrases in Chinese];var SelectedLanguage = English; //defaultThen I have the user select via dropdown box the language they would like, calling setLanguage(selected_language), which sets SelectedLanguage to either English or Chinese, depending on the value of the dropbox selection.Everywhere in my HTML where it should read Material Strength (or corresponding string in Chinese), I reference this as SelectedLanguage[MaterialProperties], which is the same as saying English[0] or Chinese[0], which returns the correct string.Is there a better, more efficient, cleaner way to do this?
Multilanguage Support in Apache Cordova
javascript;i18n;cordova
Try check this library http://www.localeplanet.com/ Everywhere you display text, put into _() function.For example:console.log(_('Hello, world!'));Use the po2js or po2json scripts to convert the .po files to something usable by JavaScript. Put these files on your website and add the appropriate one to your pages.