From 0c23363a2df0bf34538773f76d3c60865ac9f418 Mon Sep 17 00:00:00 2001 From: Caroline Chuong Date: Fri, 5 Jun 2020 15:37:53 +0200 Subject: [PATCH] Add lang attribute in languages list menu --- client/src/app/menu/language-chooser.component.html | 2 +- client/src/app/menu/language-chooser.component.ts | 6 +++--- 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 @@ 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 @@ import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' -import { I18N_LOCALES } from '../../../../shared' +import { I18N_LOCALES, getShortLocale } from '../../../../shared' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { sortBy } from '@app/shared/misc/utils' import { getCompleteLocale } from '@shared/models/i18n' @@ -13,14 +13,14 @@ import { isOnDevLocale, getDevLocale } from '@app/shared/i18n/i18n-utils' export class LanguageChooserComponent { @ViewChild('modal', { static: true }) modal: ElementRef - languages: { id: string, label: string }[] = [] + languages: { id: string, label: string, iso: string }[] = [] constructor ( private modalService: NgbModal, @Inject(LOCALE_ID) private localeId: string ) { const l = Object.keys(I18N_LOCALES) - .map(k => ({ id: k, label: I18N_LOCALES[k] })) + .map(k => ({ id: k, label: I18N_LOCALES[k] , iso: getShortLocale(k)})) this.languages = sortBy(l, 'label') } -- 2.25.1