aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/language-chooser.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/menu/language-chooser.component.ts')
-rw-r--r--client/src/app/menu/language-chooser.component.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts
index 3de6a129d..45fa73e76 100644
--- a/client/src/app/menu/language-chooser.component.ts
+++ b/client/src/app/menu/language-chooser.component.ts
@@ -1,6 +1,6 @@
1import { Component, ViewChild } from '@angular/core' 1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { ModalDirective } from 'ngx-bootstrap/modal'
3import { I18N_LOCALES } from '../../../../shared' 2import { I18N_LOCALES } from '../../../../shared'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 4
5@Component({ 5@Component({
6 selector: 'my-language-chooser', 6 selector: 'my-language-chooser',
@@ -8,21 +8,17 @@ import { I18N_LOCALES } from '../../../../shared'
8 styleUrls: [ './language-chooser.component.scss' ] 8 styleUrls: [ './language-chooser.component.scss' ]
9}) 9})
10export class LanguageChooserComponent { 10export class LanguageChooserComponent {
11 @ViewChild('modal') modal: ModalDirective 11 @ViewChild('modal') modal: ElementRef
12 12
13 languages: { [ id: string ]: string }[] = [] 13 languages: { id: string, label: string }[] = []
14 14
15 constructor () { 15 constructor (private modalService: NgbModal) {
16 this.languages = Object.keys(I18N_LOCALES) 16 this.languages = Object.keys(I18N_LOCALES)
17 .map(k => ({ id: k, label: I18N_LOCALES[k] })) 17 .map(k => ({ id: k, label: I18N_LOCALES[k] }))
18 } 18 }
19 19
20 show () { 20 show () {
21 this.modal.show() 21 this.modalService.open(this.modal)
22 }
23
24 hide () {
25 this.modal.hide()
26 } 22 }
27 23
28 buildLanguageLink (lang: { id: string }) { 24 buildLanguageLink (lang: { id: string }) {