Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "i18"

Index

Variables

Let globalTranslator

globalTranslator: i18next.TranslationFunction

Functions

create

  • create(lang?: string): Promise<i18next.TranslationFunction>
  • Creates a new the language repository.

    Parameters

    • Optional lang: string

    Returns Promise<i18next.TranslationFunction>

    The promise with the translation function.

init

  • init(): Promise<boolean>
  • Initializes the global translations.

    Returns Promise<boolean>

    The promise that indicates if operation was succcessful or not.

initForWorkspace

  • initForWorkspace(): Promise<i18next.TranslationFunction>
  • Initializes the language repository for a workspace.

    Returns Promise<i18next.TranslationFunction>

    The promise with the translation function.

normalizeLangName

  • normalizeLangName(lang: string): string
  • Parameters

    • lang: string

    Returns string

t

  • t(key: string, ...args: any[]): string
  • Returns a translated string by key.

    Parameters

    • key: string

      The key.

    • Rest ...args: any[]

    Returns string

    The "translated" string.

translateWith

  • translateWith(func: i18next.TranslationFunction, fallback: function, key: string, ...args: any[]): string
  • Returns a translated string by key and a specific function.

    Parameters

    • func: i18next.TranslationFunction

      The function to use.

    • fallback: function

      The fallback function.

        • (): string
        • Returns string

    • key: string

      The key.

    • Rest ...args: any[]

    Returns string

    The "translated" string.

Generated using TypeDoc