]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/menu/language-chooser.component.ts
Remove unnecessary CSS in menu
[github/Chocobozzz/PeerTube.git] / client / src / app / menu / language-chooser.component.ts
index 45fa73e762a15dea6a001badc95d1e1a166afd85..8eb84673ea08242b3d6119f9c514e7378ff1151c 100644 (file)
@@ -1,6 +1,7 @@
 import { Component, ElementRef, ViewChild } from '@angular/core'
 import { I18N_LOCALES } from '../../../../shared'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { sortBy } from '@app/shared/misc/utils'
 
 @Component({
   selector: 'my-language-chooser',
@@ -13,8 +14,10 @@ export class LanguageChooserComponent {
   languages: { id: string, label: string }[] = []
 
   constructor (private modalService: NgbModal) {
-    this.languages = Object.keys(I18N_LOCALES)
-      .map(k => ({ id: k, label: I18N_LOCALES[k] }))
+    const l = Object.keys(I18N_LOCALES)
+                    .map(k => ({ id: k, label: I18N_LOCALES[k] }))
+
+    this.languages = sortBy(l, 'label')
   }
 
   show () {