import { Component , Injector } from '@angular/core' ; import { OverlayModalService } from '../../services/ux/overlay-modal' ; import { LanguageModalComponent } from './language-modal/language-modal.component' ; import { LanguageService } from './language.service' ; import { LanguageModalService } from './language-modal/language-modal.service' ; /**
 * Language selection modal component
 */ @ Component ( { selector : 'm-language__bar' , templateUrl : 'language-bar.component.html' , styleUrls : [ 'language-bar.component.ng.scss' ] , } ) export class LanguageBarComponent { param service param languageModal param injector constructor ( public service , protected languageModal , protected injector ) { } /**
     * Opens language selection modal.
     */ async openLanguageModal ( ) { const language = await this . languageModal . present ( this . injector ) . toPromise ( ) ; if ( language ) { await this . onLanguageSelect ( language ) ; } } param language async onLanguageSelect ( language ) { const needsReload = await this . service . setCurrentLanguage ( language ) ; if ( needsReload ) { window . location . reload ( ) ; } } }