diff options
author | Caroline Chuong <caroline.chuong@octo.com> | 2020-06-05 15:37:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-06-05 15:55:29 +0200 |
commit | 0c23363a2df0bf34538773f76d3c60865ac9f418 (patch) | |
tree | a7d7dbd13b77fd63384be54f5fae0153f1defd35 /client/src/app/menu/language-chooser.component.ts | |
parent | e7809de95583c8c8c38427bd3c885b51e0f012ab (diff) | |
download | PeerTube-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.ts | 6 |
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 @@ | |||
1 | import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' |
2 | import { I18N_LOCALES } from '../../../../shared' | 2 | import { I18N_LOCALES, getShortLocale } 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 | import { sortBy } from '@app/shared/misc/utils' |
5 | import { getCompleteLocale } from '@shared/models/i18n' | 5 | import { getCompleteLocale } from '@shared/models/i18n' |
@@ -13,14 +13,14 @@ import { isOnDevLocale, getDevLocale } from '@app/shared/i18n/i18n-utils' | |||
13 | export class LanguageChooserComponent { | 13 | export 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 | } |