diff options
Diffstat (limited to 'client/src/app/menu/language-chooser.component.ts')
-rw-r--r-- | client/src/app/menu/language-chooser.component.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts index 45fa73e76..8eb84673e 100644 --- a/client/src/app/menu/language-chooser.component.ts +++ b/client/src/app/menu/language-chooser.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, ElementRef, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild } from '@angular/core' |
2 | import { I18N_LOCALES } from '../../../../shared' | 2 | import { I18N_LOCALES } from '../../../../shared' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { sortBy } from '@app/shared/misc/utils' | ||
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
6 | selector: 'my-language-chooser', | 7 | selector: 'my-language-chooser', |
@@ -13,8 +14,10 @@ export class LanguageChooserComponent { | |||
13 | languages: { id: string, label: string }[] = [] | 14 | languages: { id: string, label: string }[] = [] |
14 | 15 | ||
15 | constructor (private modalService: NgbModal) { | 16 | constructor (private modalService: NgbModal) { |
16 | this.languages = Object.keys(I18N_LOCALES) | 17 | const l = Object.keys(I18N_LOCALES) |
17 | .map(k => ({ id: k, label: I18N_LOCALES[k] })) | 18 | .map(k => ({ id: k, label: I18N_LOCALES[k] })) |
19 | |||
20 | this.languages = sortBy(l, 'label') | ||
18 | } | 21 | } |
19 | 22 | ||
20 | show () { | 23 | show () { |