aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/language-chooser.component.ts
diff options
context:
space:
mode:
authorCaroline Chuong <caroline.chuong@octo.com>2020-06-05 15:37:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-05 15:55:29 +0200
commit0c23363a2df0bf34538773f76d3c60865ac9f418 (patch)
treea7d7dbd13b77fd63384be54f5fae0153f1defd35 /client/src/app/menu/language-chooser.component.ts
parente7809de95583c8c8c38427bd3c885b51e0f012ab (diff)
downloadPeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.tar.gz
PeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.tar.zst
PeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.zip
Add lang attribute in languages list menu
Diffstat (limited to 'client/src/app/menu/language-chooser.component.ts')
-rw-r--r--client/src/app/menu/language-chooser.component.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts
index 9bc934ad4..dd4b35f5e 100644
--- a/client/src/app/menu/language-chooser.component.ts
+++ b/client/src/app/menu/language-chooser.component.ts
@@ -1,5 +1,5 @@
1import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' 1import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core'
2import { I18N_LOCALES } from '../../../../shared' 2import { I18N_LOCALES, getShortLocale } from '../../../../shared'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { sortBy } from '@app/shared/misc/utils' 4import { sortBy } from '@app/shared/misc/utils'
5import { getCompleteLocale } from '@shared/models/i18n' 5import { getCompleteLocale } from '@shared/models/i18n'
@@ -13,14 +13,14 @@ import { isOnDevLocale, getDevLocale } from '@app/shared/i18n/i18n-utils'
13export class LanguageChooserComponent { 13export class LanguageChooserComponent {
14 @ViewChild('modal', { static: true }) modal: ElementRef 14 @ViewChild('modal', { static: true }) modal: ElementRef
15 15
16 languages: { id: string, label: string }[] = [] 16 languages: { id: string, label: string, iso: string }[] = []
17 17
18 constructor ( 18 constructor (
19 private modalService: NgbModal, 19 private modalService: NgbModal,
20 @Inject(LOCALE_ID) private localeId: string 20 @Inject(LOCALE_ID) private localeId: string
21 ) { 21 ) {
22 const l = Object.keys(I18N_LOCALES) 22 const l = Object.keys(I18N_LOCALES)
23 .map(k => ({ id: k, label: I18N_LOCALES[k] })) 23 .map(k => ({ id: k, label: I18N_LOCALES[k] , iso: getShortLocale(k)}))
24 24
25 this.languages = sortBy(l, 'label') 25 this.languages = sortBy(l, 'label')
26 } 26 }