mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
sort languages
This commit is contained in:
parent
65713477de
commit
cf09918a94
@ -12,6 +12,8 @@ import { StorageService } from 'jslib/abstractions/storage.service';
|
|||||||
|
|
||||||
import { ConstantsService } from 'jslib/services/constants.service';
|
import { ConstantsService } from 'jslib/services/constants.service';
|
||||||
|
|
||||||
|
import { Utils } from 'jslib/misc/utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-options',
|
selector: 'app-options',
|
||||||
templateUrl: 'options.component.html',
|
templateUrl: 'options.component.html',
|
||||||
@ -26,10 +28,13 @@ export class OptionsComponent implements OnInit {
|
|||||||
constructor(private storageService: StorageService, private stateService: StateService,
|
constructor(private storageService: StorageService, private stateService: StateService,
|
||||||
private analytics: Angulartics2, private i18nService: I18nService,
|
private analytics: Angulartics2, private i18nService: I18nService,
|
||||||
private toasterService: ToasterService) {
|
private toasterService: ToasterService) {
|
||||||
this.localeOptions = [{ name: i18nService.t('default'), value: null }];
|
const localeOptions: any[] = [];
|
||||||
i18nService.supportedTranslationLocales.forEach((locale) => {
|
i18nService.supportedTranslationLocales.forEach((locale) => {
|
||||||
this.localeOptions.push({ name: locale, value: locale });
|
localeOptions.push({ name: locale, value: locale });
|
||||||
});
|
});
|
||||||
|
localeOptions.sort(Utils.getSortFunction(i18nService, 'name'));
|
||||||
|
localeOptions.splice(0, 0, { name: i18nService.t('default'), value: null });
|
||||||
|
this.localeOptions = localeOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
Loading…
Reference in New Issue
Block a user