aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
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
parente7809de95583c8c8c38427bd3c885b51e0f012ab (diff)
downloadPeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.tar.gz
PeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.tar.zst
PeerTube-0c23363a2df0bf34538773f76d3c60865ac9f418.zip
Add lang attribute in languages list menu
Diffstat (limited to 'client')
-rw-r--r--client/src/app/menu/language-chooser.component.html2
-rw-r--r--client/src/app/menu/language-chooser.component.ts6
2 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/menu/language-chooser.component.html b/client/src/app/menu/language-chooser.component.html
index a62b33dda..8aa7b9ab2 100644
--- a/client/src/app/menu/language-chooser.component.html
+++ b/client/src/app/menu/language-chooser.component.html
@@ -10,6 +10,6 @@
10 </a> 10 </a>
11 11
12 <div class="modal-body"> 12 <div class="modal-body">
13 <a *ngFor="let lang of languages" [href]="buildLanguageLink(lang)">{{ lang.label }}</a> 13 <a *ngFor="let lang of languages" [href]="buildLanguageLink(lang)" [lang]=lang.iso>{{ lang.label }}</a>
14 </div> 14 </div>
15</ng-template> 15</ng-template>
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 }