@ngx-translate/core

  • Version 18.1.0
  • Published
  • 241 kB
  • 1 dependency
  • MIT license

Install

npm i @ngx-translate/core
yarn add @ngx-translate/core
pnpm add @ngx-translate/core

Overview

Translation library (i18n) for Angular

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Variables

variable TRANSLATE_SERVICE_CONFIG

const TRANSLATE_SERVICE_CONFIG: InjectionToken<TranslateServiceConfig>;

    Functions

    function equals

    equals: (o1: unknown, o2: unknown) => boolean;
    • Determines if two objects or two values are equivalent.

      Two objects or values are considered equivalent if at least one of the following is true:

      * Both objects or values pass === comparison. * Both objects or values are of the same type and all of their properties are equal by comparing them with equals.

      Parameter o1

      Object or value to compare.

      Parameter o2

      Object or value to compare.

      Returns

      true if arguments are equal.

    function getValue

    getValue: (target: unknown, key: string) => unknown;
    • Retrieves a value from a nested object using a dot-separated key path.

      Example usage:

      getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA'); // returns 'valueI'

      Parameter target

      The source object from which to retrieve the value.

      Parameter key

      Dot-separated key path specifying the value to retrieve.

      Returns

      The value at the specified key path, or undefined if not found.

    function insertValue

    insertValue: <T>(target: Readonly<T>, key: string, value: unknown) => T;
    • Sets a value on object using a dot separated key. Returns a clone of the object without modifying it insertValue({a:{b:{c: "test"}}}, 'a.b.c', "test2") ==> {a:{b:{c: "test2"}}}

      Parameter target

      an object

      Parameter key

      E.g. "a.b.c"

      Parameter value

      to set

    function isArray

    isArray: (value: unknown) => value is unknown[];

      function isDefined

      isDefined: <T>(value: T | null | undefined) => value is T;

        function isDefinedAndNotNull

        isDefinedAndNotNull: <T>(value: T | null | undefined) => value is T;

          function isDict

          isDict: (value: unknown) => value is InterpolatableTranslationObject;

            function isFunction

            isFunction: (value: unknown) => boolean;

              function isObject

              isObject: (value: unknown) => value is Record<string, unknown>;

                function isString

                isString: (value: unknown) => value is string;

                  function mergeDeep

                  mergeDeep: (target: Readonly<unknown>, source: Readonly<unknown>) => any;

                    function provideChildTranslateService

                    provideChildTranslateService: (
                    config?: ChildTranslateServiceConfig
                    ) => Provider[];

                      function provideMissingTranslationHandler

                      provideMissingTranslationHandler: {
                      (handler: Type<MissingTranslationHandler>): ClassProvider;
                      (factory: () => MissingTranslationHandler): FactoryProvider;
                      };

                        function provideTranslateCompiler

                        provideTranslateCompiler: {
                        (compiler: Type<TranslateCompiler>): ClassProvider;
                        (factory: () => TranslateCompiler): FactoryProvider;
                        };

                          function provideTranslateLoader

                          provideTranslateLoader: {
                          (loader: Type<TranslateLoader>): ClassProvider;
                          (factory: () => TranslateLoader): FactoryProvider;
                          };

                            function provideTranslateParser

                            provideTranslateParser: {
                            (parser: Type<TranslateParser>): ClassProvider;
                            (factory: () => TranslateParser): FactoryProvider;
                            };

                              function provideTranslateService

                              provideTranslateService: (config?: RootTranslateServiceConfig) => Provider[];

                                function translate

                                translate: (
                                key: string | string[] | (() => string | string[]),
                                params?: InterpolationParameters | (() => InterpolationParameters | undefined),
                                lang?: Language | (() => Language | undefined)
                                ) => Signal<any>;
                                • Returns a Signal with the translation for the given key, resolved against the current language. Must be called in an Angular injection context.

                                  Parameters accept plain values or arrow functions. Signal reads inside the function are tracked reactively. Signals themselves are also accepted directly, since Signal is callable.

                                  Example 1

                                  greeting = translate('HELLO');

                                  Example 2

                                  model = signal({ currentKey: 'HELLO' }); greeting = translate(() => this.model().currentKey);

                                Classes

                                class DefaultMissingTranslationHandler

                                class DefaultMissingTranslationHandler implements MissingTranslationHandler {}
                                • This handler is just a placeholder that does nothing; in case you don't need a missing translation handler at all

                                property ɵfac

                                static ɵfac: i0.ɵɵFactoryDeclaration<DefaultMissingTranslationHandler, never>;

                                  property ɵprov

                                  static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                    method handle

                                    handle: (params: MissingTranslationHandlerParams) => string;

                                      class ITranslateService

                                      abstract class ITranslateService {}

                                        property currentLang

                                        abstract readonly currentLang: Signal<string>;
                                        • The current language as a reactive Signal. Use getCurrentLang() for a non-reactive snapshot.

                                        property fallbackLang

                                        abstract readonly fallbackLang: Signal<string>;
                                        • The fallback language as a reactive Signal. Use getFallbackLang() for a non-reactive snapshot.

                                        property isLoading

                                        abstract readonly isLoading: Signal<boolean>;
                                        • true while one or more language loads are in flight at this service or any of its ancestors in the service hierarchy.

                                          Loading scope propagates DOWNWARD: a load triggered at the root marks the root and all descendants as loading. A load triggered at a child (e.g. a lazy-route bootstrap fetching its translations) marks only that child's subtree. Siblings and ancestors are unaffected by a descendant's loads.

                                          Drive a spinner by reading it from the service injected at the scope where the spinner should live: root for an app-shell spinner, the nearest child for a local spinner inside a lazy-loaded subtree.

                                        property onFallbackLangChange

                                        abstract readonly onFallbackLangChange: Observable<FallbackLangChangeEvent>;

                                          property onLangChange

                                          abstract readonly onLangChange: Observable<LangChangeEvent>;

                                            property onTranslationChange

                                            abstract readonly onTranslationChange: Observable<TranslationChangeEvent>;

                                              property onTranslationRefresh

                                              abstract readonly onTranslationRefresh: Observable<void>;
                                              • A combined Observable that emits whenever translations might need to be refreshed. This includes: language changes, translation updates for the current language, and fallback language changes.

                                              method addLangs

                                              abstract addLangs: (languages: Language[]) => void;

                                                method get

                                                abstract get: (
                                                key: string | string[],
                                                interpolateParams?: InterpolationParameters,
                                                lang?: Language
                                                ) => Observable<any>;

                                                  method getBrowserCultureLang

                                                  abstract getBrowserCultureLang: () => Language | undefined;

                                                    method getBrowserLang

                                                    abstract getBrowserLang: () => Language | undefined;

                                                      method getCurrentLang

                                                      abstract getCurrentLang: () => Language | null;
                                                      • Returns the current language as a plain value (non-reactive). Use currentLang signal for reactive usage.

                                                      method getFallbackLang

                                                      abstract getFallbackLang: () => Language | null;

                                                        method getLangs

                                                        abstract getLangs: () => readonly Language[];

                                                          method getParent

                                                          abstract getParent: () => ITranslateService | null;
                                                          • Returns the service this one inherits translations from, or null if this is a root (a top-level service or an isolated subtree root).

                                                            A null return means the service is the terminus of its translation fallback chain — equivalent to "is this a root?".

                                                          method getParsedResult

                                                          abstract getParsedResult: (
                                                          key: string | string[],
                                                          interpolateParams?: InterpolationParameters,
                                                          lang?: Language
                                                          ) => StrictTranslation | Observable<StrictTranslation>;

                                                            method getRoot

                                                            abstract getRoot: () => ITranslateService;
                                                            • Returns the root of this service's hierarchy — the topmost service in the getParent() chain. For an isolated subtree, returns the subtree's root (since getParent() returns null at the isolation boundary).

                                                              A root service returns itself.

                                                            method getStreamOnTranslationChange

                                                            abstract getStreamOnTranslationChange: (
                                                            key: string | string[],
                                                            interpolateParams?: InterpolationParameters,
                                                            lang?: Language
                                                            ) => Observable<any>;

                                                              method getTranslations

                                                              abstract getTranslations: (
                                                              language: Language
                                                              ) => InterpolatableTranslationObject;
                                                              • Returns the loaded translations for the given language.

                                                              method instant

                                                              abstract instant: (
                                                              key: string | string[],
                                                              interpolateParams?: InterpolationParameters,
                                                              lang?: Language
                                                              ) => Translation;

                                                                method reloadLang

                                                                abstract reloadLang: (
                                                                lang: Language
                                                                ) => Observable<InterpolatableTranslationObject>;

                                                                  method resetLang

                                                                  abstract resetLang: (lang: Language) => void;

                                                                    method set

                                                                    abstract set: (
                                                                    key: string,
                                                                    translation: string | TranslationObject,
                                                                    lang?: Language
                                                                    ) => void;

                                                                      method setCompiledTranslation

                                                                      abstract setCompiledTranslation: (
                                                                      lang: Language,
                                                                      translations: InterpolatableTranslationObject,
                                                                      shouldMerge?: boolean
                                                                      ) => void;

                                                                        method setFallbackLang

                                                                        abstract setFallbackLang: (
                                                                        lang: Language
                                                                        ) => Observable<InterpolatableTranslationObject>;

                                                                          method setTranslation

                                                                          abstract setTranslation: (
                                                                          lang: Language,
                                                                          translations: TranslationObject,
                                                                          shouldMerge?: boolean
                                                                          ) => void;

                                                                            method stream

                                                                            abstract stream: (
                                                                            key: string | string[],
                                                                            interpolateParams?: InterpolationParameters,
                                                                            lang?: Language
                                                                            ) => Observable<any>;

                                                                              method translate

                                                                              abstract translate: (
                                                                              key: string | string[] | (() => string | string[]),
                                                                              params?:
                                                                              | InterpolationParameters
                                                                              | (() => InterpolationParameters | undefined),
                                                                              lang?: Language | (() => Language | undefined)
                                                                              ) => Signal<any>;
                                                                              • Returns a Signal that provides the translated value and automatically updates whenever the currentLang, fallbackLang, or the translations change.

                                                                                Parameters accept plain values or arrow functions. Signal reads inside the function are tracked reactively. Signals themselves are also accepted directly, since Signal is callable.

                                                                                Parameter key

                                                                                The translation key (or array of keys), a function returning one

                                                                                Parameter params

                                                                                Optional interpolation parameters, or a function returning them

                                                                                Parameter lang

                                                                                Optional language override, or a function returning one

                                                                                Returns

                                                                                A Signal that emits the translated value

                                                                              method use

                                                                              abstract use: (lang: Language) => Observable<InterpolatableTranslationObject>;

                                                                                class MissingTranslationHandler

                                                                                abstract class MissingTranslationHandler {}

                                                                                  method handle

                                                                                  abstract handle: (
                                                                                  params: MissingTranslationHandlerParams
                                                                                  ) => StrictTranslation | Observable<StrictTranslation>;
                                                                                  • A function that handles missing translations.

                                                                                    Parameter params

                                                                                    context for resolving a missing translation

                                                                                    Returns

                                                                                    a value or an observable

                                                                                    If it returns a value, then this value is used. If it returns an observable, the value returned by this observable will be used (except if the method was "instant"). If it returns undefined, the key will be used as a value

                                                                                  class TranslateBlockContext

                                                                                  class TranslateBlockContext {}

                                                                                    constructor

                                                                                    constructor(
                                                                                    $implicit: (key: string, params?: InterpolationParameters) => Translation
                                                                                    );

                                                                                      property $implicit

                                                                                      $implicit: (key: string, params?: InterpolationParameters) => Translation;

                                                                                        class TranslateBlockDirective

                                                                                        class TranslateBlockDirective implements OnInit {}

                                                                                          property ɵdir

                                                                                          static ɵdir: i0.ɵɵDirectiveDeclaration<
                                                                                          TranslateBlockDirective,
                                                                                          '[translateBlock]',
                                                                                          never,
                                                                                          {},
                                                                                          {},
                                                                                          never,
                                                                                          never,
                                                                                          true,
                                                                                          never
                                                                                          >;

                                                                                            property ɵfac

                                                                                            static ɵfac: i0.ɵɵFactoryDeclaration<TranslateBlockDirective, never>;

                                                                                              method ngOnInit

                                                                                              ngOnInit: () => void;

                                                                                                method ngTemplateContextGuard

                                                                                                static ngTemplateContextGuard: (
                                                                                                _dir: TranslateBlockDirective,
                                                                                                _ctx: unknown
                                                                                                ) => _ctx is TranslateBlockContext;

                                                                                                  class TranslateCompiler

                                                                                                  abstract class TranslateCompiler {}

                                                                                                    method compile

                                                                                                    abstract compile: (value: string, lang: string) => InterpolatableTranslation;

                                                                                                      method compileTranslations

                                                                                                      abstract compileTranslations: (
                                                                                                      translations: TranslationObject,
                                                                                                      lang: string
                                                                                                      ) => InterpolatableTranslationObject;

                                                                                                        class TranslateDefaultParser

                                                                                                        class TranslateDefaultParser extends TranslateParser {}

                                                                                                          property ɵfac

                                                                                                          static ɵfac: i0.ɵɵFactoryDeclaration<TranslateDefaultParser, never>;

                                                                                                            property ɵprov

                                                                                                            static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                              property templateMatcher

                                                                                                              templateMatcher: RegExp;

                                                                                                                method formatValue

                                                                                                                protected formatValue: (
                                                                                                                value: unknown,
                                                                                                                context?: InterpolationContext
                                                                                                                ) => string | undefined;
                                                                                                                • Converts a value into a useful string representation.

                                                                                                                  Parameter value

                                                                                                                  The value to format.

                                                                                                                  Returns

                                                                                                                  A string representation of the value.

                                                                                                                method getInterpolationReplacement

                                                                                                                protected getInterpolationReplacement: (
                                                                                                                params: InterpolationParameters,
                                                                                                                key: string,
                                                                                                                context?: InterpolationContext
                                                                                                                ) => string | undefined;
                                                                                                                • Returns the replacement for an interpolation parameter @params:

                                                                                                                method interpolate

                                                                                                                interpolate: (
                                                                                                                expr: InterpolateFunction | string,
                                                                                                                params?: InterpolationParameters,
                                                                                                                context?: InterpolationContext
                                                                                                                ) => string | undefined;

                                                                                                                  method interpolateFunction

                                                                                                                  protected interpolateFunction: (
                                                                                                                  fn: InterpolateFunction,
                                                                                                                  params?: InterpolationParameters,
                                                                                                                  context?: InterpolationContext
                                                                                                                  ) => string;

                                                                                                                    method interpolateString

                                                                                                                    protected interpolateString: (
                                                                                                                    expr: string,
                                                                                                                    params?: InterpolationParameters,
                                                                                                                    context?: InterpolationContext
                                                                                                                    ) => string;

                                                                                                                      class TranslateDirective

                                                                                                                      class TranslateDirective implements AfterViewChecked {}

                                                                                                                        constructor

                                                                                                                        constructor();

                                                                                                                          property ɵdir

                                                                                                                          static ɵdir: i0.ɵɵDirectiveDeclaration<
                                                                                                                          TranslateDirective,
                                                                                                                          '[translate],[ngx-translate],[ngxTranslate]',
                                                                                                                          never,
                                                                                                                          {
                                                                                                                          translate: { alias: 'translate'; required: false };
                                                                                                                          ngxTranslate: { alias: 'ngxTranslate'; required: false };
                                                                                                                          translateParams: { alias: 'translateParams'; required: false };
                                                                                                                          },
                                                                                                                          {},
                                                                                                                          never,
                                                                                                                          never,
                                                                                                                          true,
                                                                                                                          never
                                                                                                                          >;

                                                                                                                            property ɵfac

                                                                                                                            static ɵfac: i0.ɵɵFactoryDeclaration<TranslateDirective, never>;

                                                                                                                              method ngAfterViewChecked

                                                                                                                              ngAfterViewChecked: () => void;

                                                                                                                                class TranslateLoader

                                                                                                                                abstract class TranslateLoader {}

                                                                                                                                  method getTranslation

                                                                                                                                  abstract getTranslation: (lang: string) => Observable<TranslationObject>;

                                                                                                                                    class TranslateNoOpCompiler

                                                                                                                                    class TranslateNoOpCompiler extends TranslateCompiler {}
                                                                                                                                    • This compiler is just a placeholder that does nothing; in case you don't need a compiler at all

                                                                                                                                    property ɵfac

                                                                                                                                    static ɵfac: i0.ɵɵFactoryDeclaration<TranslateNoOpCompiler, never>;

                                                                                                                                      property ɵprov

                                                                                                                                      static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                                                        method compile

                                                                                                                                        compile: (value: string, lang: string) => string | InterpolateFunction;

                                                                                                                                          method compileTranslations

                                                                                                                                          compileTranslations: (
                                                                                                                                          translations: TranslationObject,
                                                                                                                                          lang: string
                                                                                                                                          ) => InterpolatableTranslationObject;

                                                                                                                                            class TranslateNoOpLoader

                                                                                                                                            class TranslateNoOpLoader extends TranslateLoader {}
                                                                                                                                            • This loader is just a placeholder that does nothing; in case you don't need a loader at all

                                                                                                                                            property ɵfac

                                                                                                                                            static ɵfac: i0.ɵɵFactoryDeclaration<TranslateNoOpLoader, never>;

                                                                                                                                              property ɵprov

                                                                                                                                              static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                                                                method getTranslation

                                                                                                                                                getTranslation: (lang: string) => Observable<TranslationObject>;

                                                                                                                                                  class TranslateParser

                                                                                                                                                  abstract class TranslateParser {}

                                                                                                                                                    method interpolate

                                                                                                                                                    abstract interpolate: (
                                                                                                                                                    expr: InterpolateFunction | string,
                                                                                                                                                    params?: InterpolationParameters,
                                                                                                                                                    context?: InterpolationContext
                                                                                                                                                    ) => string | undefined;
                                                                                                                                                    • Interpolates a string to replace parameters "This is a {{ key }}" ==> "This is a value", with params = { key: "value" }

                                                                                                                                                      Parameter expr

                                                                                                                                                      Parameter params

                                                                                                                                                      Parameter context

                                                                                                                                                    class TranslatePipe

                                                                                                                                                    class TranslatePipe implements PipeTransform {}

                                                                                                                                                      property ɵfac

                                                                                                                                                      static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;

                                                                                                                                                        property ɵpipe

                                                                                                                                                        static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, 'translate', true>;

                                                                                                                                                          property ɵprov

                                                                                                                                                          static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                                                                            method transform

                                                                                                                                                            transform: (query: string | undefined | null, ...args: any[]) => any;

                                                                                                                                                              class TranslateService

                                                                                                                                                              class TranslateService implements ITranslateService {}

                                                                                                                                                                constructor

                                                                                                                                                                constructor();

                                                                                                                                                                  property compiler

                                                                                                                                                                  protected compiler: TranslateCompiler;

                                                                                                                                                                    property currentLang

                                                                                                                                                                    readonly currentLang: Signal<string>;
                                                                                                                                                                    • The current language as a reactive Signal. Use getCurrentLang() for a non-reactive snapshot.

                                                                                                                                                                    property currentLoader

                                                                                                                                                                    protected currentLoader: TranslateLoader;

                                                                                                                                                                      property fallbackLang

                                                                                                                                                                      readonly fallbackLang: Signal<string>;
                                                                                                                                                                      • The fallback language as a reactive Signal. Use getFallbackLang() for a non-reactive snapshot.

                                                                                                                                                                      property fallbackLangs

                                                                                                                                                                      readonly fallbackLangs: Signal<readonly string[]>;
                                                                                                                                                                      • The ordered fallback chain as a reactive Signal.

                                                                                                                                                                      property isLoading

                                                                                                                                                                      readonly isLoading: Signal<boolean>;
                                                                                                                                                                      • Signal that is true while one or more language loads are in flight at this service or any of its ancestors in the service hierarchy.

                                                                                                                                                                        Loading scope propagates DOWNWARD: a load triggered at the root marks the root and all descendants as loading. A load triggered at a child (e.g. a lazy-route bootstrap fetching its translations) marks only that child's subtree. Siblings and ancestors are unaffected by a descendant's loads.

                                                                                                                                                                        Drive a spinner by reading it from the service injected at the scope where the spinner should live: root for an app-shell spinner, the nearest child for a local spinner inside a lazy-loaded subtree.

                                                                                                                                                                      property isRoot

                                                                                                                                                                      readonly isRoot: boolean;

                                                                                                                                                                        property lastUseLanguage

                                                                                                                                                                        protected lastUseLanguage: string;

                                                                                                                                                                          property loadingTranslations

                                                                                                                                                                          protected readonly loadingTranslations: LoadingTranslationsRegistry;

                                                                                                                                                                            property missingTranslationHandler

                                                                                                                                                                            protected missingTranslationHandler: MissingTranslationHandler;

                                                                                                                                                                              property onFallbackLangChange

                                                                                                                                                                              readonly onFallbackLangChange: Observable<FallbackLangChangeEvent>;
                                                                                                                                                                              • An Observable to listen to fallback lang change events onFallbackLangChange.subscribe((params: FallbackLangChangeEvent) => { // do something });

                                                                                                                                                                              property onLangChange

                                                                                                                                                                              readonly onLangChange: Observable<LangChangeEvent>;
                                                                                                                                                                              • An Observable to listen to lang change events onLangChange.subscribe((params: LangChangeEvent) => { // do something });

                                                                                                                                                                              property onTranslationChange

                                                                                                                                                                              readonly onTranslationChange: Observable<TranslationChangeEvent>;
                                                                                                                                                                              • An Observable to listen to translation change events onTranslationChange.subscribe((params: TranslationChangeEvent) => { // do something });

                                                                                                                                                                              property onTranslationRefresh

                                                                                                                                                                              readonly onTranslationRefresh: Observable<void>;
                                                                                                                                                                              • A combined Observable that emits whenever translations might need to be refreshed. This includes: language changes, translation updates for the current or fallback language, and fallback language changes.

                                                                                                                                                                              property ɵfac

                                                                                                                                                                              static ɵfac: i0.ɵɵFactoryDeclaration<TranslateService, never>;

                                                                                                                                                                                property ɵprov

                                                                                                                                                                                static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                                                                                                  property parent

                                                                                                                                                                                  protected readonly parent: TranslateService;

                                                                                                                                                                                    property parser

                                                                                                                                                                                    protected parser: TranslateParser;

                                                                                                                                                                                      property store

                                                                                                                                                                                      protected store: TranslateStore;

                                                                                                                                                                                        method addLangs

                                                                                                                                                                                        addLangs: (languages: Language[]) => void;
                                                                                                                                                                                        • Add available languages

                                                                                                                                                                                        method chainTranslationChange$

                                                                                                                                                                                        protected chainTranslationChange$: () => Observable<TranslationChangeEvent>;

                                                                                                                                                                                          method changeLang

                                                                                                                                                                                          protected changeLang: (lang: Language, requestId?: number) => void;
                                                                                                                                                                                          • Changes the current lang

                                                                                                                                                                                          method deleteLanguage

                                                                                                                                                                                          deleteLanguage: (lang: Language) => void;
                                                                                                                                                                                          • Deletes the language lang entirely: removes its translations from the store, unregisters it from getLangs(), and clears any in-flight load entry — isLoading() flips to false immediately on this service.

                                                                                                                                                                                            This restores the pre-v18 escape hatch delete translate.translations[lang], which left the language registered in getLangs().

                                                                                                                                                                                            If lang is the currently used language, the current-language pointer is kept: it is not reset and no onLangChange is emitted, matching the old delete workaround. Removing stored translations emits onTranslationChange with an empty translation object so subscribers refresh through the usual parent, fallback, or missing-translation lookup.

                                                                                                                                                                                            All earlier loads and retries for this language owned by this service are unsubscribed. Late responses cannot restore it or apply a delayed current/fallback language change. Other services are unaffected, and a subsequent use() or reloadLang() can load it again. A child also ignores automatic loads from ancestor language requests started before deletion; later explicit requests can load it again. Subscribers to a cancelled load complete without another value or error. Completed load results remain readable. Pending lookups resolve through the usual parent, fallback, or missing-translation handling. Current and fallback language pointers are kept.

                                                                                                                                                                                          method get

                                                                                                                                                                                          get: (
                                                                                                                                                                                          key: string | string[],
                                                                                                                                                                                          interpolateParams?: InterpolationParameters,
                                                                                                                                                                                          lang?: Language
                                                                                                                                                                                          ) => Observable<any>;
                                                                                                                                                                                          • Gets the translated value of a key (or an array of keys)

                                                                                                                                                                                            Returns

                                                                                                                                                                                            the translated key, or an object of translated keys

                                                                                                                                                                                          method getActiveRequestedLang

                                                                                                                                                                                          protected getActiveRequestedLang: () => Language | null;
                                                                                                                                                                                          • The language most recently requested via use(). Always read from the root, because use() delegates to the root (parent!.use(lang)) and only the root ever assigns lastUseLanguage. A child's own lastUseLanguage stays null, so reading it directly would make get() miss the child's in-flight load. null until the first use() runs.

                                                                                                                                                                                          method getAsync

                                                                                                                                                                                          getAsync: (
                                                                                                                                                                                          key: string | string[],
                                                                                                                                                                                          interpolateParams?: InterpolationParameters,
                                                                                                                                                                                          lang?: Language
                                                                                                                                                                                          ) => Promise<Translation>;
                                                                                                                                                                                          • Gets the translated value of a key (or an array of keys) as a Promise, for usage in async functions without wrapping get into firstValueFrom.

                                                                                                                                                                                            Returns

                                                                                                                                                                                            a promise resolving with the translated key, or an object of translated keys

                                                                                                                                                                                          method getBrowserCultureLang

                                                                                                                                                                                          static getBrowserCultureLang: () => Language | undefined;
                                                                                                                                                                                          • Returns the culture language code name from the browser, e.g. "de-DE"

                                                                                                                                                                                          method getBrowserLang

                                                                                                                                                                                          static getBrowserLang: () => Language | undefined;
                                                                                                                                                                                          • Returns the language code name from the browser, e.g. "de"

                                                                                                                                                                                          method getCurrentLang

                                                                                                                                                                                          getCurrentLang: () => Language | null;

                                                                                                                                                                                            method getFallbackLang

                                                                                                                                                                                            getFallbackLang: () => Language | null;
                                                                                                                                                                                            • Gets the fallback language. null if none is defined

                                                                                                                                                                                            method getFallbackLangs

                                                                                                                                                                                            getFallbackLangs: () => readonly Language[];
                                                                                                                                                                                            • Returns the ordered fallback chain, or an empty array when none is configured.

                                                                                                                                                                                            method getLangs

                                                                                                                                                                                            getLangs: () => readonly Language[];

                                                                                                                                                                                              method getMissingTranslationHandler

                                                                                                                                                                                              protected getMissingTranslationHandler: () => MissingTranslationHandler;

                                                                                                                                                                                                method getParent

                                                                                                                                                                                                getParent: () => TranslateService | null;
                                                                                                                                                                                                • Returns the service this one inherits translations from, or null if this is a root (a top-level service or an isolated subtree root).

                                                                                                                                                                                                  A null return means the service is the terminus of its translation fallback chain — equivalent to "is this a root?".

                                                                                                                                                                                                method getParsedResult

                                                                                                                                                                                                getParsedResult: (
                                                                                                                                                                                                key: string | string[],
                                                                                                                                                                                                interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                lang?: Language
                                                                                                                                                                                                ) => StrictTranslation | Observable<StrictTranslation>;
                                                                                                                                                                                                • Returns the parsed result of the translations

                                                                                                                                                                                                method getParsedResultForArray

                                                                                                                                                                                                protected getParsedResultForArray: (
                                                                                                                                                                                                key: string[],
                                                                                                                                                                                                interpolateParams: InterpolationParameters | undefined,
                                                                                                                                                                                                lang?: Language
                                                                                                                                                                                                ) => TranslationObject | Observable<TranslationObject>;

                                                                                                                                                                                                  method getParsedResultForKey

                                                                                                                                                                                                  protected getParsedResultForKey: (
                                                                                                                                                                                                  key: string,
                                                                                                                                                                                                  interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                  lang?: Language
                                                                                                                                                                                                  ) => StrictTranslation | Observable<StrictTranslation>;

                                                                                                                                                                                                    method getRoot

                                                                                                                                                                                                    getRoot: () => TranslateService;
                                                                                                                                                                                                    • Returns the root of this service's hierarchy — the topmost service in the getParent() chain. For an isolated subtree, returns the subtree's root (since parent === null at the isolation boundary).

                                                                                                                                                                                                      A root service returns itself. Equivalent to walking getParent() until it returns null, but provided as a convenience.

                                                                                                                                                                                                    method getStreamOnTranslationChange

                                                                                                                                                                                                    getStreamOnTranslationChange: (
                                                                                                                                                                                                    key: string | string[],
                                                                                                                                                                                                    interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                    lang?: Language
                                                                                                                                                                                                    ) => Observable<any>;
                                                                                                                                                                                                    • Returns a stream of translated values of a key (or an array of keys) which updates whenever the translation changes.

                                                                                                                                                                                                      Returns

                                                                                                                                                                                                      A stream of the translated key, or an object of translated keys

                                                                                                                                                                                                    method getTextToInterpolate

                                                                                                                                                                                                    protected getTextToInterpolate: (
                                                                                                                                                                                                    key: string,
                                                                                                                                                                                                    lang?: Language,
                                                                                                                                                                                                    onLookup?: (lookup: TranslationLookupResult) => void
                                                                                                                                                                                                    ) => InterpolatableTranslation | undefined;
                                                                                                                                                                                                    • Forward onLookup when overriding this method to preserve parser language context.

                                                                                                                                                                                                    method getTranslations

                                                                                                                                                                                                    getTranslations: (
                                                                                                                                                                                                    language: Language
                                                                                                                                                                                                    ) => DeepReadonly<InterpolatableTranslationObject>;
                                                                                                                                                                                                    • Returns

                                                                                                                                                                                                      The loaded translations for the given language

                                                                                                                                                                                                    method hasTranslationInChain

                                                                                                                                                                                                    protected hasTranslationInChain: (lang: Language) => boolean;

                                                                                                                                                                                                      method hasTranslationKey

                                                                                                                                                                                                      hasTranslationKey: (key: string, lang?: Language) => boolean;
                                                                                                                                                                                                      • Checks whether a translation exists for the given key, without invoking the missing-translation handler and without interpolating.

                                                                                                                                                                                                        Resolution mirrors instant(): with lang, the lookup goes directly to the specified language (and up the parent service chain); without, it falls back to the current language, then the fallback language, then up the parent chain.

                                                                                                                                                                                                        An empty string counts as an existing translation; an explicit null counts as missing (both match instant() / get() resolution).

                                                                                                                                                                                                        Returns

                                                                                                                                                                                                        true if the key resolves to a translation, false for a missing, empty, or undefined key

                                                                                                                                                                                                      method instant

                                                                                                                                                                                                      instant: (
                                                                                                                                                                                                      key: string | string[],
                                                                                                                                                                                                      interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                      lang?: Language
                                                                                                                                                                                                      ) => Translation;
                                                                                                                                                                                                      • Returns a translation instantly from the internal state of loaded translation. All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.

                                                                                                                                                                                                        When lang is provided, the lookup goes directly to the specified language, bypassing the current language and fallback chain.

                                                                                                                                                                                                      method keyToObject

                                                                                                                                                                                                      protected keyToObject: (
                                                                                                                                                                                                      key: string | string[]
                                                                                                                                                                                                      ) => string | Record<string, string>;

                                                                                                                                                                                                        method loadAndCompileTranslations

                                                                                                                                                                                                        protected loadAndCompileTranslations: (
                                                                                                                                                                                                        lang: Language
                                                                                                                                                                                                        ) => Observable<InterpolatableTranslationObject>;
                                                                                                                                                                                                        • Loads translations for lang via the configured TranslateLoader, compiles them, and stores the result. Tracking via the protected loadingTranslations registry happens automatically.

                                                                                                                                                                                                          Subclasses that override this method bypass isLoading tracking unless they call this.loadingTranslations.set(lang, obs) and arrange a token-aware finalize (this.loadingTranslations.clearIfOwner(lang, obs)) from the override.

                                                                                                                                                                                                        method loadOrExtendLanguage

                                                                                                                                                                                                        protected loadOrExtendLanguage: (
                                                                                                                                                                                                        lang: Language
                                                                                                                                                                                                        ) => Observable<InterpolatableTranslationObject> | undefined;
                                                                                                                                                                                                        • Retrieves the given translations

                                                                                                                                                                                                        method reloadLang

                                                                                                                                                                                                        reloadLang: (lang: Language) => Observable<InterpolatableTranslationObject>;
                                                                                                                                                                                                        • Allows reloading the lang file from the file

                                                                                                                                                                                                        method resetLang

                                                                                                                                                                                                        resetLang: (lang: Language) => void;
                                                                                                                                                                                                        • Deletes stored translations for lang and clears the in-flight registry entry — isLoading() flips to false immediately on this service.

                                                                                                                                                                                                          Does NOT cancel the underlying network call: if the loader is mid-flight when this method returns, the request can still complete and tap() translations back into the store. To replace state and re-fetch deterministically, follow with reloadLang(lang).

                                                                                                                                                                                                        method runInterpolation

                                                                                                                                                                                                        protected runInterpolation: (
                                                                                                                                                                                                        translations: InterpolatableTranslation,
                                                                                                                                                                                                        interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                        context?: InterpolationContext
                                                                                                                                                                                                        ) => StrictTranslation;

                                                                                                                                                                                                          method runInterpolationOnArray

                                                                                                                                                                                                          protected runInterpolationOnArray: (
                                                                                                                                                                                                          translations: InterpolatableTranslation,
                                                                                                                                                                                                          interpolateParams: InterpolationParameters | undefined,
                                                                                                                                                                                                          context?: InterpolationContext
                                                                                                                                                                                                          ) => StrictTranslation[];

                                                                                                                                                                                                            method runInterpolationOnDict

                                                                                                                                                                                                            protected runInterpolationOnDict: (
                                                                                                                                                                                                            translations: InterpolatableTranslationObject,
                                                                                                                                                                                                            interpolateParams: InterpolationParameters | undefined,
                                                                                                                                                                                                            context?: InterpolationContext
                                                                                                                                                                                                            ) => TranslationObject;

                                                                                                                                                                                                              method set

                                                                                                                                                                                                              set: (
                                                                                                                                                                                                              key: string,
                                                                                                                                                                                                              translation: string | TranslationObject,
                                                                                                                                                                                                              lang?: Language
                                                                                                                                                                                                              ) => void;
                                                                                                                                                                                                              • Sets the translated value of a key, after compiling it

                                                                                                                                                                                                              method setCompiledTranslation

                                                                                                                                                                                                              setCompiledTranslation: (
                                                                                                                                                                                                              lang: Language,
                                                                                                                                                                                                              translations: InterpolatableTranslationObject,
                                                                                                                                                                                                              shouldMerge?: boolean
                                                                                                                                                                                                              ) => void;
                                                                                                                                                                                                              • Stores an already-compiled translation object for the given language, bypassing the configured TranslateCompiler.

                                                                                                                                                                                                                Use this when you have translations in their final, interpolator-ready form — e.g. interpolation functions produced at build time. For raw translations that still need to go through the compiler, use setTranslation instead.

                                                                                                                                                                                                              method setFallbackLang

                                                                                                                                                                                                              setFallbackLang: (lang: Language) => Observable<InterpolatableTranslationObject>;
                                                                                                                                                                                                              • Sets the fallback language to use if a translation is not found in the current language

                                                                                                                                                                                                              method setFallbackLangs

                                                                                                                                                                                                              setFallbackLangs: (
                                                                                                                                                                                                              languages: readonly Language[]
                                                                                                                                                                                                              ) => Observable<InterpolatableTranslationObject[]>;
                                                                                                                                                                                                              • Loads an ordered fallback chain. An empty array disables fallback. Emits the loaded dictionaries in order; the most recent request wins.

                                                                                                                                                                                                              method setTranslation

                                                                                                                                                                                                              setTranslation: (
                                                                                                                                                                                                              lang: Language,
                                                                                                                                                                                                              translations: TranslationObject,
                                                                                                                                                                                                              shouldMerge?: boolean
                                                                                                                                                                                                              ) => void;
                                                                                                                                                                                                              • Manually sets an object of translations for a given language, passing it through the configured TranslateCompiler first.

                                                                                                                                                                                                                If you already have translations in their final compiled form (e.g. interpolation functions produced at build time), use setCompiledTranslation instead — it stores the data directly and skips the compiler.

                                                                                                                                                                                                              method stream

                                                                                                                                                                                                              stream: (
                                                                                                                                                                                                              key: string | string[],
                                                                                                                                                                                                              interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                              lang?: Language
                                                                                                                                                                                                              ) => Observable<any>;
                                                                                                                                                                                                              • Returns a stream of translated values of a key (or an array of keys) which updates whenever the language changes, the requested language's translations are (re)loaded, or the explicitly-requested lang argument's translations change.

                                                                                                                                                                                                                Without lang: re-emits on onLangChange (active-language switches via use). With lang: also re-emits when translations for that specific language are loaded or updated via store.translationChange$, so an explicit stream("KEY", undefined, "de") updates once "de" finishes loading.

                                                                                                                                                                                                                Returns

                                                                                                                                                                                                                A stream of the translated key, or an object of translated keys

                                                                                                                                                                                                              method translate

                                                                                                                                                                                                              translate: (
                                                                                                                                                                                                              key: string | string[] | (() => string | string[]),
                                                                                                                                                                                                              params?:
                                                                                                                                                                                                              | InterpolationParameters
                                                                                                                                                                                                              | (() => InterpolationParameters | undefined),
                                                                                                                                                                                                              lang?: Language | (() => Language | undefined)
                                                                                                                                                                                                              ) => Signal<any>;
                                                                                                                                                                                                              • Returns a Signal that provides the translated value and automatically updates when the language changes or translations are reloaded.

                                                                                                                                                                                                                Parameters accept plain values or arrow functions. Signal reads inside the function are tracked reactively. Signals themselves are also accepted directly, since Signal is callable.

                                                                                                                                                                                                                Parameter key

                                                                                                                                                                                                                The translation key (or array of keys), a function returning one

                                                                                                                                                                                                                Parameter params

                                                                                                                                                                                                                Optional interpolation parameters, or a function returning them

                                                                                                                                                                                                                Parameter lang

                                                                                                                                                                                                                Optional language override, or a function returning one

                                                                                                                                                                                                                Returns

                                                                                                                                                                                                                A Signal that emits the translated value(s)

                                                                                                                                                                                                                Example 1

                                                                                                                                                                                                                // Static key greeting = this.translate.translate('HELLO');

                                                                                                                                                                                                                Example 2

                                                                                                                                                                                                                // Derived key from another signal (no separate computed needed) model = signal({ currentKey: 'HELLO' }); greeting = this.translate.translate(() => this.model().currentKey);

                                                                                                                                                                                                                Example 3

                                                                                                                                                                                                                // Multi-key lookup labels = this.translate.translate(['SAVE', 'CANCEL']);

                                                                                                                                                                                                              method use

                                                                                                                                                                                                              use: (lang: Language) => Observable<InterpolatableTranslationObject>;
                                                                                                                                                                                                              • Changes the lang currently used

                                                                                                                                                                                                              class TranslateSlotDirective

                                                                                                                                                                                                              class TranslateSlotDirective {}

                                                                                                                                                                                                                property name

                                                                                                                                                                                                                readonly name: any;

                                                                                                                                                                                                                  property ɵdir

                                                                                                                                                                                                                  static ɵdir: i0.ɵɵDirectiveDeclaration<
                                                                                                                                                                                                                  TranslateSlotDirective,
                                                                                                                                                                                                                  'ng-template[translateSlot]',
                                                                                                                                                                                                                  never,
                                                                                                                                                                                                                  { name: { alias: 'translateSlot'; required: true; isSignal: true } },
                                                                                                                                                                                                                  {},
                                                                                                                                                                                                                  never,
                                                                                                                                                                                                                  never,
                                                                                                                                                                                                                  true,
                                                                                                                                                                                                                  never
                                                                                                                                                                                                                  >;

                                                                                                                                                                                                                    property ɵfac

                                                                                                                                                                                                                    static ɵfac: i0.ɵɵFactoryDeclaration<TranslateSlotDirective, never>;

                                                                                                                                                                                                                      property template

                                                                                                                                                                                                                      readonly template: TemplateRef<any>;

                                                                                                                                                                                                                        class TranslateSlotsComponent

                                                                                                                                                                                                                        class TranslateSlotsComponent {}

                                                                                                                                                                                                                          property key

                                                                                                                                                                                                                          readonly key: any;

                                                                                                                                                                                                                            property ɵcmp

                                                                                                                                                                                                                            static ɵcmp: i0.ɵɵComponentDeclaration<
                                                                                                                                                                                                                            TranslateSlotsComponent,
                                                                                                                                                                                                                            '[translateSlots]',
                                                                                                                                                                                                                            never,
                                                                                                                                                                                                                            {
                                                                                                                                                                                                                            key: { alias: 'translateSlots'; required: true; isSignal: true };
                                                                                                                                                                                                                            translateParams: {
                                                                                                                                                                                                                            alias: 'translateParams';
                                                                                                                                                                                                                            required: false;
                                                                                                                                                                                                                            isSignal: true;
                                                                                                                                                                                                                            };
                                                                                                                                                                                                                            },
                                                                                                                                                                                                                            {},
                                                                                                                                                                                                                            ['slots'],
                                                                                                                                                                                                                            never,
                                                                                                                                                                                                                            true,
                                                                                                                                                                                                                            never
                                                                                                                                                                                                                            >;

                                                                                                                                                                                                                              property ɵfac

                                                                                                                                                                                                                              static ɵfac: i0.ɵɵFactoryDeclaration<TranslateSlotsComponent, never>;

                                                                                                                                                                                                                                property parts

                                                                                                                                                                                                                                protected readonly parts: any;

                                                                                                                                                                                                                                  property translateParams

                                                                                                                                                                                                                                  readonly translateParams: any;

                                                                                                                                                                                                                                    class TranslateStore

                                                                                                                                                                                                                                    class TranslateStore {}

                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                      constructor();

                                                                                                                                                                                                                                        property languages

                                                                                                                                                                                                                                        readonly languages: Signal<string[]>;

                                                                                                                                                                                                                                          property lastTranslationChange

                                                                                                                                                                                                                                          readonly lastTranslationChange: Signal<TranslationChangeEvent>;

                                                                                                                                                                                                                                            property ɵfac

                                                                                                                                                                                                                                            static ɵfac: i0.ɵɵFactoryDeclaration<TranslateStore, never>;

                                                                                                                                                                                                                                              property ɵprov

                                                                                                                                                                                                                                              static ɵprov: i0.ɵɵInjectableDeclaration<any>;

                                                                                                                                                                                                                                                property translationChange$

                                                                                                                                                                                                                                                readonly translationChange$: Observable<TranslationChangeEvent>;

                                                                                                                                                                                                                                                  property translations

                                                                                                                                                                                                                                                  readonly translations: Signal<Record<string, InterpolatableTranslationObject>>;

                                                                                                                                                                                                                                                    method addLanguages

                                                                                                                                                                                                                                                    addLanguages: (langs: Language[]) => void;

                                                                                                                                                                                                                                                      method deleteTranslations

                                                                                                                                                                                                                                                      deleteTranslations: (lang: string) => void;

                                                                                                                                                                                                                                                        method getLanguages

                                                                                                                                                                                                                                                        getLanguages: () => readonly Language[];

                                                                                                                                                                                                                                                          method getTranslations

                                                                                                                                                                                                                                                          getTranslations: (
                                                                                                                                                                                                                                                          language: Language
                                                                                                                                                                                                                                                          ) => DeepReadonly<InterpolatableTranslationObject>;

                                                                                                                                                                                                                                                            method getTranslationValue

                                                                                                                                                                                                                                                            getTranslationValue: (
                                                                                                                                                                                                                                                            language: Language,
                                                                                                                                                                                                                                                            key: string
                                                                                                                                                                                                                                                            ) => InterpolatableTranslation;

                                                                                                                                                                                                                                                              method hasTranslationFor

                                                                                                                                                                                                                                                              hasTranslationFor: (lang: string) => boolean;

                                                                                                                                                                                                                                                                method removeLanguages

                                                                                                                                                                                                                                                                removeLanguages: (langs: Language[]) => void;

                                                                                                                                                                                                                                                                  method setTranslations

                                                                                                                                                                                                                                                                  setTranslations: (
                                                                                                                                                                                                                                                                  language: Language,
                                                                                                                                                                                                                                                                  translations: InterpolatableTranslationObject,
                                                                                                                                                                                                                                                                  extend: boolean
                                                                                                                                                                                                                                                                  ) => void;

                                                                                                                                                                                                                                                                    Interfaces

                                                                                                                                                                                                                                                                    interface FallbackLangChangeEvent

                                                                                                                                                                                                                                                                    interface FallbackLangChangeEvent {}

                                                                                                                                                                                                                                                                      property lang

                                                                                                                                                                                                                                                                      lang: string;
                                                                                                                                                                                                                                                                      • First fallback language, or an empty string when the chain is cleared.

                                                                                                                                                                                                                                                                      property langs

                                                                                                                                                                                                                                                                      langs?: readonly Language[];
                                                                                                                                                                                                                                                                      • Ordered chain when multiple fallbacks are configured, or [] when cleared.

                                                                                                                                                                                                                                                                      property translations

                                                                                                                                                                                                                                                                      translations: InterpolatableTranslationObject;

                                                                                                                                                                                                                                                                        interface InterpolatableTranslationObject

                                                                                                                                                                                                                                                                        interface InterpolatableTranslationObject {}

                                                                                                                                                                                                                                                                          index signature

                                                                                                                                                                                                                                                                          [key: string]: InterpolatableTranslation;

                                                                                                                                                                                                                                                                            interface InterpolationContext

                                                                                                                                                                                                                                                                            interface InterpolationContext {}
                                                                                                                                                                                                                                                                            • Context for custom parsers and compiled translation functions.

                                                                                                                                                                                                                                                                            property key

                                                                                                                                                                                                                                                                            key?: string;
                                                                                                                                                                                                                                                                            • The translation key requested from TranslateService.

                                                                                                                                                                                                                                                                            property lang

                                                                                                                                                                                                                                                                            lang?: string;
                                                                                                                                                                                                                                                                            • The language that supplied the translation being interpolated. Undefined when a custom lookup does not report context for its returned value.

                                                                                                                                                                                                                                                                            interface ITranslateService

                                                                                                                                                                                                                                                                            interface ITranslateService {}
                                                                                                                                                                                                                                                                            • v18.1 capabilities stay optional for existing implementations and subclasses. TranslateService itself always provides these methods.

                                                                                                                                                                                                                                                                            property fallbackLangs

                                                                                                                                                                                                                                                                            readonly fallbackLangs?: Signal<readonly Language[]>;

                                                                                                                                                                                                                                                                              method deleteLanguage

                                                                                                                                                                                                                                                                              deleteLanguage: (lang: Language) => void;

                                                                                                                                                                                                                                                                                method getAsync

                                                                                                                                                                                                                                                                                getAsync: (
                                                                                                                                                                                                                                                                                key: string | string[],
                                                                                                                                                                                                                                                                                interpolateParams?: InterpolationParameters,
                                                                                                                                                                                                                                                                                lang?: Language
                                                                                                                                                                                                                                                                                ) => Promise<Translation>;

                                                                                                                                                                                                                                                                                  method getFallbackLangs

                                                                                                                                                                                                                                                                                  getFallbackLangs: () => readonly Language[];

                                                                                                                                                                                                                                                                                    method hasTranslationKey

                                                                                                                                                                                                                                                                                    hasTranslationKey: (key: string, lang?: Language) => boolean;

                                                                                                                                                                                                                                                                                      method setFallbackLangs

                                                                                                                                                                                                                                                                                      setFallbackLangs: (
                                                                                                                                                                                                                                                                                      langs: readonly Language[]
                                                                                                                                                                                                                                                                                      ) => Observable<InterpolatableTranslationObject[]>;

                                                                                                                                                                                                                                                                                        interface LangChangeEvent

                                                                                                                                                                                                                                                                                        interface LangChangeEvent {}

                                                                                                                                                                                                                                                                                          property lang

                                                                                                                                                                                                                                                                                          lang: string;

                                                                                                                                                                                                                                                                                            property translations

                                                                                                                                                                                                                                                                                            translations: InterpolatableTranslationObject;

                                                                                                                                                                                                                                                                                              interface MissingTranslationHandlerParams

                                                                                                                                                                                                                                                                                              interface MissingTranslationHandlerParams {}

                                                                                                                                                                                                                                                                                                property interpolateParams

                                                                                                                                                                                                                                                                                                interpolateParams?: object;
                                                                                                                                                                                                                                                                                                • interpolation params that were passed along for translating the given key.

                                                                                                                                                                                                                                                                                                property key

                                                                                                                                                                                                                                                                                                key: string;
                                                                                                                                                                                                                                                                                                • the key that's missing in translation files

                                                                                                                                                                                                                                                                                                property translateService

                                                                                                                                                                                                                                                                                                translateService: TranslateService;
                                                                                                                                                                                                                                                                                                • an instance of the service that was unable to translate the key.

                                                                                                                                                                                                                                                                                                interface RootTranslateServiceConfig

                                                                                                                                                                                                                                                                                                interface RootTranslateServiceConfig extends ChildTranslateServiceConfig {}

                                                                                                                                                                                                                                                                                                  property fallbackLang

                                                                                                                                                                                                                                                                                                  fallbackLang?: Language;

                                                                                                                                                                                                                                                                                                    property fallbackLangs

                                                                                                                                                                                                                                                                                                    fallbackLangs?: readonly Language[];
                                                                                                                                                                                                                                                                                                    • Ordered fallback chain. Takes precedence over fallbackLang, including when empty.

                                                                                                                                                                                                                                                                                                    property lang

                                                                                                                                                                                                                                                                                                    lang?: Language;

                                                                                                                                                                                                                                                                                                      property langs

                                                                                                                                                                                                                                                                                                      langs?: Language[];

                                                                                                                                                                                                                                                                                                        interface TranslateProviders

                                                                                                                                                                                                                                                                                                        interface TranslateProviders {}

                                                                                                                                                                                                                                                                                                          property compiler

                                                                                                                                                                                                                                                                                                          compiler?: TranslateProvider;

                                                                                                                                                                                                                                                                                                            property loader

                                                                                                                                                                                                                                                                                                            loader?: TranslateProvider;

                                                                                                                                                                                                                                                                                                              property missingTranslationHandler

                                                                                                                                                                                                                                                                                                              missingTranslationHandler?: TranslateProvider;

                                                                                                                                                                                                                                                                                                                property parser

                                                                                                                                                                                                                                                                                                                parser?: TranslateProvider;

                                                                                                                                                                                                                                                                                                                  interface TranslateRetryConfig

                                                                                                                                                                                                                                                                                                                  interface TranslateRetryConfig {}
                                                                                                                                                                                                                                                                                                                  • Retry policy for a failed language load.

                                                                                                                                                                                                                                                                                                                  property count

                                                                                                                                                                                                                                                                                                                  count: number;
                                                                                                                                                                                                                                                                                                                  • Maximum retries after the initial attempt. Zero or negative values disable retries.

                                                                                                                                                                                                                                                                                                                  property delay

                                                                                                                                                                                                                                                                                                                  delay?: number | ((error: unknown, retryAttempt: number) => number);
                                                                                                                                                                                                                                                                                                                  • Delay in milliseconds (default 100). The first retry has retryAttempt = 1. Values must be finite and between 0 and 2147483647; invalid values fail with RangeError. Exceptions from this callback or shouldRetry terminate the load with that exception.

                                                                                                                                                                                                                                                                                                                  property shouldRetry

                                                                                                                                                                                                                                                                                                                  shouldRetry?: (error: unknown) => boolean;
                                                                                                                                                                                                                                                                                                                  • Return false to immediately propagate the original error. Defaults to retrying all errors.

                                                                                                                                                                                                                                                                                                                  interface TranslateServiceConfig

                                                                                                                                                                                                                                                                                                                  interface TranslateServiceConfig {}
                                                                                                                                                                                                                                                                                                                  • Configuration object for the translation service.

                                                                                                                                                                                                                                                                                                                    Provides options to customize translation behavior, including setting the primary language, specifying a fallback language, and other deprecated flags for legacy support.

                                                                                                                                                                                                                                                                                                                  property fallbackLang

                                                                                                                                                                                                                                                                                                                  fallbackLang?: Language | null;

                                                                                                                                                                                                                                                                                                                    property fallbackLangs

                                                                                                                                                                                                                                                                                                                    fallbackLangs?: readonly Language[];
                                                                                                                                                                                                                                                                                                                    • Ordered fallback chain. Takes precedence over fallbackLang, including when empty.

                                                                                                                                                                                                                                                                                                                    property isRoot

                                                                                                                                                                                                                                                                                                                    isRoot: boolean;

                                                                                                                                                                                                                                                                                                                      property lang

                                                                                                                                                                                                                                                                                                                      lang?: Language;

                                                                                                                                                                                                                                                                                                                        property langs

                                                                                                                                                                                                                                                                                                                        langs?: Language[];

                                                                                                                                                                                                                                                                                                                          property retry

                                                                                                                                                                                                                                                                                                                          retry?: number | TranslateRetryConfig;
                                                                                                                                                                                                                                                                                                                          • Automatic retries for a failed language load (default 0). A number uses a fixed 100 ms delay; a policy customizes timing and error filtering. With @ngx-translate/http-loader, requires failOnError: true on the loader. Combining loader-level and service-level retries can multiply attempts.

                                                                                                                                                                                                                                                                                                                          interface TranslationChangeEvent

                                                                                                                                                                                                                                                                                                                          interface TranslationChangeEvent {}

                                                                                                                                                                                                                                                                                                                            property lang

                                                                                                                                                                                                                                                                                                                            lang: string;

                                                                                                                                                                                                                                                                                                                              property translations

                                                                                                                                                                                                                                                                                                                              translations: InterpolatableTranslationObject;

                                                                                                                                                                                                                                                                                                                                interface TranslationObject

                                                                                                                                                                                                                                                                                                                                interface TranslationObject {}

                                                                                                                                                                                                                                                                                                                                  index signature

                                                                                                                                                                                                                                                                                                                                  [key: string]: StrictTranslation;

                                                                                                                                                                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                                                                                                                                                                    type ChildTranslateServiceConfig

                                                                                                                                                                                                                                                                                                                                    type ChildTranslateServiceConfig = Partial<TranslateProviders> & {
                                                                                                                                                                                                                                                                                                                                    /** Retry policy for this service's own loads; not inherited from the parent. */
                                                                                                                                                                                                                                                                                                                                    retry?: TranslateServiceConfig['retry'];
                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                      type DeepReadonly

                                                                                                                                                                                                                                                                                                                                      type DeepReadonly<T> = {
                                                                                                                                                                                                                                                                                                                                      readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
                                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                                        type InterpolatableTranslation

                                                                                                                                                                                                                                                                                                                                        type InterpolatableTranslation =
                                                                                                                                                                                                                                                                                                                                        | string
                                                                                                                                                                                                                                                                                                                                        | InterpolatableTranslation[]
                                                                                                                                                                                                                                                                                                                                        | InterpolateFunction
                                                                                                                                                                                                                                                                                                                                        | InterpolatableTranslationObject
                                                                                                                                                                                                                                                                                                                                        | undefined
                                                                                                                                                                                                                                                                                                                                        | null;

                                                                                                                                                                                                                                                                                                                                          type InterpolateFunction

                                                                                                                                                                                                                                                                                                                                          type InterpolateFunction = (
                                                                                                                                                                                                                                                                                                                                          params?: InterpolationParameters,
                                                                                                                                                                                                                                                                                                                                          context?: InterpolationContext
                                                                                                                                                                                                                                                                                                                                          ) => string;

                                                                                                                                                                                                                                                                                                                                            type InterpolationParameters

                                                                                                                                                                                                                                                                                                                                            type InterpolationParameters = Record<string, any>;

                                                                                                                                                                                                                                                                                                                                              type Language

                                                                                                                                                                                                                                                                                                                                              type Language = string;

                                                                                                                                                                                                                                                                                                                                                type StrictTranslation

                                                                                                                                                                                                                                                                                                                                                type StrictTranslation =
                                                                                                                                                                                                                                                                                                                                                | string
                                                                                                                                                                                                                                                                                                                                                | StrictTranslation[]
                                                                                                                                                                                                                                                                                                                                                | TranslationObject
                                                                                                                                                                                                                                                                                                                                                | undefined
                                                                                                                                                                                                                                                                                                                                                | null;

                                                                                                                                                                                                                                                                                                                                                  type TranslateProvider

                                                                                                                                                                                                                                                                                                                                                  type TranslateProvider = Provider | (() => unknown);
                                                                                                                                                                                                                                                                                                                                                  • Provider shape accepted by the four plugin slots on RootTranslateServiceConfig and ChildTranslateServiceConfig.

                                                                                                                                                                                                                                                                                                                                                    Accepts any Angular Provider — including bare classes (TypeProvider) and bare factory functions. When a bare class or factory is passed, it is automatically wrapped by the corresponding provideTranslate* helper so it is registered under the correct DI token.

                                                                                                                                                                                                                                                                                                                                                  type Translation

                                                                                                                                                                                                                                                                                                                                                  type Translation = StrictTranslation | any;

                                                                                                                                                                                                                                                                                                                                                    Package Files (1)

                                                                                                                                                                                                                                                                                                                                                    Dependencies (1)

                                                                                                                                                                                                                                                                                                                                                    Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                    No dev dependencies.

                                                                                                                                                                                                                                                                                                                                                    Peer Dependencies (3)

                                                                                                                                                                                                                                                                                                                                                    Badge

                                                                                                                                                                                                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ngx-translate/core.

                                                                                                                                                                                                                                                                                                                                                    • Markdown
                                                                                                                                                                                                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@ngx-translate/core)
                                                                                                                                                                                                                                                                                                                                                    • HTML
                                                                                                                                                                                                                                                                                                                                                      <a href="https://www.jsdocs.io/package/@ngx-translate/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>