@ogs-gmbh/ngx-translate
Version:
A lightweight, REST-based Angular i18n library designed for seamless internationalization with minimal setup. It supports dynamic language switching & flexible translation management via RESTful APIs.
43 lines (42 loc) • 2.17 kB
TypeScript
import { Observable, Subject } from "rxjs";
import { NotifierScope, NotifierScopes, ScopedFile } from "../types/store.type";
import { LocaleConfig } from "../types/config.type";
import * as i0 from "@angular/core";
export declare class TranslationStoreService {
private _loadedScopes;
private _notifierScopes;
private readonly _translationConfig;
private readonly _locale;
private readonly _locale$;
private readonly _storageAttributes;
constructor();
getCurrentLocale(): LocaleConfig;
getLocale$(): Observable<LocaleConfig>;
setLocale(locale: LocaleConfig): void;
getLocales(): LocaleConfig[];
setScopedFile(scopeName: string | null, file: ScopedFile): void;
getScopedFile(scopeName: string | null): ScopedFile | undefined;
hasScopedFile(scopeName: string | null): boolean;
hasScopedFiles(scopeNames: ReadonlyArray<string | null>): boolean;
isScopeExisting(scopeName: string | null): boolean;
getExistingScopes(scopeNames: ReadonlyArray<string | null>): Array<string | null>;
isScopeNameInNotifierScopes(scopeName: string | null): boolean;
areScopeNamesInNotifierScopes(scopeNames: ReadonlyArray<string | null>): boolean;
getExistingNotifierScopes(scopeNames: ReadonlyArray<string | null>): Array<string | null>;
getNotiferScope(scopeName: string | null): NotifierScope | undefined;
getNotifierScopes(scopeNames: ReadonlyArray<string | null>): NotifierScopes | undefined;
addNotifierScope(notifierScope: Readonly<NotifierScope>): void;
addNotifierScopes(notifierScopes: NotifierScopes): void;
addNotifierToNotifierScope(scopeName: string | null, notifier: Subject<ScopedFile>): void;
removeNotifierScope(scopeName: string | null): void;
getSourceLocale(): LocaleConfig | undefined;
private _checkIfLocaleExists;
private _checkIfLocaleIsSourceLocale;
private _setStorageValue;
private _getStorageValue;
private _getScopeByScopeName;
private _getScopeByScopeNames;
private _appendScope;
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationStoreService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TranslationStoreService>;
}