import { Component } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@ngx-translate/core";
import * as i2 from "@ionic/angular";
import * as i3 from "@angular/forms";
import * as i4 from "../../../components/msg/msg.component";
export class LanguagePage {
    constructor(translateService, popup) {
        this.translateService = translateService;
        this.popup = popup;
        this.language = '';
    }
    ngOnInit() {
        this.currentLanguage = localStorage.getItem('language');
    }
    changeLanguage(lang) {
        this.translateService.use(lang);
        localStorage.setItem('language', lang);
    }
    close() {
        this.popup.dismiss(null);
    }
    static { this.ɵfac = function LanguagePage_Factory(t) { return new (t || LanguagePage)(i0.ɵɵdirectiveInject(i1.TranslateService), i0.ɵɵdirectiveInject(i2.PopoverController)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguagePage, selectors: [["app-language"]], decls: 21, vars: 1, consts: [["color", "primary"], ["slot", "end"], [3, "click"], ["slot", "icon-only", "name", "close"], ["key", "language.title"], ["lines", "none"], [3, "ngModel", "ngModelChange"], ["key", "language.heading"], ["slot", "start", "value", "en"], ["slot", "start", "value", "es"]], template: function LanguagePage_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "ion-header")(1, "ion-toolbar", 0)(2, "ion-buttons", 1)(3, "ion-button", 2);
            i0.ɵɵlistener("click", function LanguagePage_Template_ion_button_click_3_listener() { return ctx.close(); });
            i0.ɵɵelement(4, "ion-icon", 3);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(5, "ion-title");
            i0.ɵɵelement(6, "app-msg", 4);
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(7, "ion-content")(8, "ion-list", 5)(9, "ion-radio-group", 6);
            i0.ɵɵlistener("ngModelChange", function LanguagePage_Template_ion_radio_group_ngModelChange_9_listener($event) { return ctx.language = $event; });
            i0.ɵɵelementStart(10, "ion-list-header")(11, "ion-label");
            i0.ɵɵelement(12, "app-msg", 7);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(13, "ion-item", 2);
            i0.ɵɵlistener("click", function LanguagePage_Template_ion_item_click_13_listener() { return ctx.changeLanguage("en"); });
            i0.ɵɵelementStart(14, "ion-label");
            i0.ɵɵtext(15, "English");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(16, "ion-radio", 8);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(17, "ion-item", 2);
            i0.ɵɵlistener("click", function LanguagePage_Template_ion_item_click_17_listener() { return ctx.changeLanguage("es"); });
            i0.ɵɵelementStart(18, "ion-label");
            i0.ɵɵtext(19, "Espa\u00F1ol");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(20, "ion-radio", 9);
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            i0.ɵɵadvance(9);
            i0.ɵɵproperty("ngModel", ctx.language);
        } }, dependencies: [i2.IonButton, i2.IonButtons, i2.IonContent, i2.IonHeader, i2.IonIcon, i2.IonItem, i2.IonLabel, i2.IonList, i2.IonListHeader, i2.IonRadio, i2.IonRadioGroup, i2.IonTitle, i2.IonToolbar, i2.RadioValueAccessor, i2.SelectValueAccessor, i3.NgControlStatus, i3.NgModel, i4.MsgComponent] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguagePage, [{
        type: Component,
        args: [{ selector: 'app-language', template: "<ion-header>\r\n  <ion-toolbar color=\"primary\">\r\n    <ion-buttons slot=\"end\">\r\n      <ion-button (click)=\"close()\">\r\n        <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\r\n      </ion-button>\r\n    </ion-buttons>\r\n    <ion-title><app-msg key=\"language.title\"></app-msg></ion-title>\r\n  </ion-toolbar>\r\n</ion-header>\r\n\r\n<ion-content>\r\n  <ion-list lines=\"none\">\r\n    <ion-radio-group [(ngModel)]=\"language\" >\r\n      <ion-list-header>\r\n        <ion-label><app-msg key=\"language.heading\"></app-msg></ion-label>\r\n      </ion-list-header>\r\n      <ion-item (click)=\"changeLanguage('en')\">\r\n        <ion-label>English</ion-label>\r\n        <ion-radio slot=\"start\" value=\"en\"></ion-radio>\r\n      </ion-item>\r\n  \r\n      <ion-item (click)=\"changeLanguage('es')\">\r\n        <ion-label>Espa\u00F1ol</ion-label>\r\n        <ion-radio slot=\"start\" value=\"es\"></ion-radio>\r\n      </ion-item>\r\n    </ion-radio-group>\r\n  </ion-list>\r\n</ion-content>\r\n" }]
    }], () => [{ type: i1.TranslateService }, { type: i2.PopoverController }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguagePage, { className: "LanguagePage", filePath: "lib\\pages\\popovers\\language\\language.page.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64, 