Skip to content

Commit

Permalink
Sort language dropdown by localized language name
Browse files Browse the repository at this point in the history
  • Loading branch information
bastimeyer committed Mar 31, 2018
1 parent 5e3362f commit 17f01c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/controllers/SettingsMainController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ const { themes } = themesConfig;

export default Controller.extend({
contentGuiLanguages: computed(function() {
const compare = new Intl.Collator( "en", { sensitivity: "base" } ).compare;

return Object.keys( locales )
.map( key => ({
id: key,
label: locales[ key ]
}) );
}) )
// sort by localized language name in English order
.sort( ( a, b ) => compare( a.label, b.label ) );
}),

contentGuiTheme: computed(function() {
Expand Down

0 comments on commit 17f01c2

Please sign in to comment.