mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Force use of 2 char langcode. Prevent double load of english json file.
This commit is contained in:
parent
bba105c228
commit
dde8755128
1 changed files with 6 additions and 4 deletions
10
js/app.js
10
js/app.js
|
@ -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;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue