1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-17 04:50:11 +01:00

Fix translate into sort order

This commit is contained in:
Piero Toffanin 2023-10-19 14:52:16 -04:00
parent 87322de964
commit e5258d0cb6

View File

@ -155,7 +155,11 @@ document.addEventListener('DOMContentLoaded', function(){
else{ else{
var lang = this.langs.find(l => l.code === this.sourceLang); var lang = this.langs.find(l => l.code === this.sourceLang);
if (!lang) return this.langs; if (!lang) return this.langs;
return lang.targets.map(t => this.langs.find(l => l.code === t)); var tgtLangs = lang.targets.map(t => this.langs.find(l => l.code === t));
tgtLangs.sort(function(a, b){
return a.name.localeCompare(b.name);
});
return tgtLangs;
} }
} }
}, },