Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MissingTranslation

Index

Constructors

Methods

Constructors

constructor

Methods

get

  • Return a missing translation message for the given parameters.

    Parameters

    • scope: Scope

      The translations' scope.

    • options: Dict

      The translations' options.

    Returns string

    The missing translation.

register

  • 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";
    

    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