-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Sort languages via their display names #7593
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,12 +167,6 @@ define(function (require, exports, module) { | |
|
||
return i18n === undefined ? locale : i18n; | ||
}; | ||
|
||
// add system default | ||
languages.push({label: Strings.LANGUAGE_SYSTEM_DEFAULT, language: null}); | ||
|
||
// add english | ||
languages.push({label: getLocalizedLabel("en"), language: "en"}); | ||
|
||
// inspect all children of dirEntry | ||
entries.forEach(function (entry) { | ||
|
@@ -191,6 +185,16 @@ define(function (require, exports, module) { | |
} | ||
} | ||
}); | ||
// sort the languages via their display name | ||
languages.sort(function (lang1, lang2) { | ||
var langName1 = lang1.label, | ||
langName2 = lang2.label; | ||
|
||
return langName1.localeCompare(langName2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SAplayer I noticed that there are three languages (Ελληνικά, русский and српски) that seem to be in the wrong places. Maybe the first letter in those languages are not the regular ascii latin1 characters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I thought about in #7516, and @njx said we should do it either way. E: I just saw the chars you wrote are looking like latin chars, but they are not. It's Ε |
||
}); | ||
|
||
// add system default and english (those should be on the very top) | ||
languages.unshift({label: Strings.LANGUAGE_SYSTEM_DEFAULT, language: null}, {label: getLocalizedLabel("en"), language: "en"}); | ||
|
||
var template = Mustache.render(LanguageDialogTemplate, {languages: languages, Strings: Strings}); | ||
Dialogs.showModalDialogUsingTemplate(template).done(function (id) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's really no need to create these vars since they are only used once. Could simply be: