<commit_before>import Controller from "@ember/controller";
import { computed } from "@ember/object";
import { locales as localesConfig, themes as themesConfig } from "config";


const { locales } = localesConfig;
const { themes } = themesConfig;


export default Controller.extend({
	contentGuiLanguages: computed(function() {
		return Object.keys( locales )
			.map( key => ({
				id: key,
				label: locales[ key ]
			}) );
	}),

	contentGuiTheme: computed(function() {
		return themes.map( id => ({ id }) );
	})
});<commit_msg>Sort language dropdown by localized language name<commit_after>import Controller from "@ember/controller";
import { computed } from "@ember/object";
import { locales as localesConfig, themes as themesConfig } from "config";


const { locales } = localesConfig;
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() {
		return themes.map( id => ({ id }) );
	})
});
{'fraction_non_alphanumeric': 0.14430577223088922, 'fraction_numerical': 0.0, 'mean_word_length': 4.01171875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6193160', 'n_tokens_mistral': 416, 'n_tokens_neox': 376, 'n_words': 116}