18 var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
19 var language = langId.substr(0, 2);
22 for (index in arguments) {
23 for (property in arguments[index])
24 locales[property] = arguments[index][property];
29 if ( ! locales[langId] && ! locales[language])
32 var locale = (locales[langId] ? locales[langId] : locales[language]);
35 var index = locale[text];
36 if (index === undefined)
41 function setLanguage(language) {
42 locale = locales[language];
49 setLanguage: setLanguage