Class MissingTranslation

Hierarchy

  • MissingTranslation

Constructors

Methods

Constructors

Methods

  • Return a missing translation message for the given parameters.

    Returns

    The missing translation.

    Parameters

    • scope: Scope

      The translations' scope.

    • options: Dict

      The translations' options.

    Returns string

  • Registers a new missing translation strategy. This is how messages are defined when a translation cannot be found.

    The follow example registers a strategy that always return the phrase "Oops! Missing translation.".

    Example

    i18n.missingTranslation.register(
    "oops",
    (i18n, scope, options) => "Oops! Missing translation."
    );

    i18n.missingBehavior = "oops";

    Returns

    Parameters

    • name: string

      The strategy name.

    • strategy: MissingTranslationStrategy

      A function that returns a string the result of a missing translation scope.

    Returns void

Generated using TypeDoc