import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { LocalStorageKeysEnum, LanguageEnum } from '@testlocallibrary/shared-kernel/models/enums';
import * as i1 from '@testlocallibrary/shared-kernel/services/local-storage';
import * as i2 from '@angular/router';
import * as i1$1 from '@ngx-translate/core';

class LanguageService {
    constructor(localStorageService, router) {
        this.localStorageService = localStorageService;
        this.router = router;
    }
    getLanguage() {
        let localStorageLanguage = this.localStorageService.getFromLocalStorage(LocalStorageKeysEnum.Language);
        if (this.router.url.includes(`/${localStorageLanguage}/`) || (!this.router.url.includes(`/${LanguageEnum.Ar}/`) && !this.router.url.includes(`/${LanguageEnum.En}/`)))
            return this.localStorageService.getFromLocalStorage(LocalStorageKeysEnum.Language) || LanguageEnum.En;
        else {
            let language = '';
            this.router.url.includes(`/${LanguageEnum.Ar}/`) ? language = LanguageEnum.Ar : language = LanguageEnum.En;
            this.localStorageService.saveToLocalStorage(LocalStorageKeysEnum.Language, language);
            return language;
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageService, deps: [{ token: i1.LocalStorageService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }], ctorParameters: function () { return [{ type: i1.LocalStorageService }, { type: i2.Router }]; } });

class TranslationService {
    constructor(translate) {
        this.translate = translate;
    }
    setLanguage(lang) {
        this.translate.use(lang);
    }
    translateInstant(key, params) {
        return this.translate.instant(key, params);
    }
    getLanguage() {
        return this.translate.currentLang;
    }
    translateGet(key, params) {
        return this.translate.get(key, params);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslationService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslationService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslationService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });

/**
 * Generated bundle index. Do not edit.
 */

export { LanguageService, TranslationService };
//# sourceMappingURL=testlocallibrary-shared-kernel-services-language.mjs.map
