1 import { Component, ViewChild } from '@angular/core'
2 import { ModalDirective } from 'ngx-bootstrap/modal'
3 import { I18N_LOCALES } from '../../../../shared'
6 selector: 'my-language-chooser',
7 templateUrl: './language-chooser.component.html',
8 styleUrls: [ './language-chooser.component.scss' ]
10 export class LanguageChooserComponent {
11 @ViewChild('modal') modal: ModalDirective
13 languages: { [ id: string ]: string }[] = []
16 this.languages = Object.keys(I18N_LOCALES)
17 .map(k => ({ id: k, label: I18N_LOCALES[k] }))
28 buildLanguageLink (lang: { id: string }) {
29 return window.location.origin + '/' + lang.id