i18n-js v4.5.2
    Preparing search index...

    Class MissingTranslation

    Index

    Constructors

    Methods

    Constructors

    Methods

    • 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.

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

      Parameters

      • name: string

        The strategy name.

      • strategy: MissingTranslationStrategy

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

      Returns void

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

      i18n.missingBehavior = "oops";