Change format for desktop system langs

This commit is contained in:
Julia.Radzhabova
2025-05-13 21:54:55 +03:00
parent f204c3cc2f
commit d64c6f91d8
2 changed files with 18 additions and 6 deletions

View File

@ -2811,13 +2811,19 @@ define([
this.loadLanguages([]);
}
let sLangs = Common.Controllers.Desktop.systemLangs() || [],
recentKey = 'de-settings-recent-langs',
arr = Common.localStorage.getItem(recentKey),
let sLangs = Common.Controllers.Desktop.systemLangs() || {},
arr = [];
for (let name in sLangs) {
sLangs.hasOwnProperty(name) && arr.push(name);
}
sLangs = arr;
let recentKey = 'de-settings-recent-langs',
recentCount = Math.max(5, sLangs.length + 3);
Common.Utils.InternalSettings.set(recentKey + "-count", recentCount);
Common.Utils.InternalSettings.set(recentKey + "-offset", sLangs.length);
arr = Common.localStorage.getItem(recentKey);
arr = arr ? arr.split(';') : [];
arr = _.union(sLangs, arr);
arr.splice(recentCount);

View File

@ -2361,13 +2361,19 @@ define([
this.loadLanguages([]);
}
let sLangs = Common.Controllers.Desktop.systemLangs() || [],
recentKey = 'pe-settings-recent-langs',
arr = Common.localStorage.getItem(recentKey),
let sLangs = Common.Controllers.Desktop.systemLangs() || {},
arr = [];
for (let name in sLangs) {
sLangs.hasOwnProperty(name) && arr.push(name);
}
sLangs = arr;
let recentKey = 'pe-settings-recent-langs',
recentCount = Math.max(5, sLangs.length + 3);
Common.Utils.InternalSettings.set(recentKey + "-count", recentCount);
Common.Utils.InternalSettings.set(recentKey + "-offset", sLangs.length);
arr = Common.localStorage.getItem(recentKey);
arr = arr ? arr.split(';') : [];
arr = _.union(sLangs, arr);
arr.splice(recentCount);