[fix] Force use of 2 char langcode. Prevent double load of english json file.

This commit is contained in:
opi 2014-06-09 19:09:45 +02:00
parent bba105c228
commit dde8755128

View file

@ -1208,10 +1208,12 @@ $(document).ready(function () {
// User language // User language
if (window.navigator && window.navigator.language) { if (window.navigator && window.navigator.language) {
y18n.locale = window.navigator.language; y18n.locale = window.navigator.language.substr(0, 2);
$.getJSON('locales/'+ y18n.locale +'.json', function(data){ if (y18n.locale !== 'en') {
y18n.translations[y18n.locale] = data; $.getJSON('locales/'+ y18n.locale +'.json', function(data){
}); y18n.translations[y18n.locale] = data;
});
}
} }
/** /**