Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 4a61749

Browse files
committed
Merge pull request #7593 from SAPlayer/fix-7516
Sort languages via their display names
2 parents 7e0d04d + 52ce020 commit 4a61749

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • src/extensions/default/DebugCommands

src/extensions/default/DebugCommands/main.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ define(function (require, exports, module) {
167167

168168
return i18n === undefined ? locale : i18n;
169169
};
170-
171-
// add system default
172-
languages.push({label: Strings.LANGUAGE_SYSTEM_DEFAULT, language: null});
173-
174-
// add english
175-
languages.push({label: getLocalizedLabel("en"), language: "en"});
176170

177171
// inspect all children of dirEntry
178172
entries.forEach(function (entry) {
@@ -191,6 +185,13 @@ define(function (require, exports, module) {
191185
}
192186
}
193187
});
188+
// sort the languages via their display name
189+
languages.sort(function (lang1, lang2) {
190+
return lang1.label.localeCompare(lang2.label);
191+
});
192+
193+
// add system default and english (those should be on the very top)
194+
languages.unshift({label: Strings.LANGUAGE_SYSTEM_DEFAULT, language: null}, {label: getLocalizedLabel("en"), language: "en"});
194195

195196
var template = Mustache.render(LanguageDialogTemplate, {languages: languages, Strings: Strings});
196197
Dialogs.showModalDialogUsingTemplate(template).done(function (id) {

0 commit comments

Comments
 (0)