Class Locales

Hierarchy

  • Locales

Constructors

Methods

Constructors

Methods

  • Return a list of all locales that must be tried before returning the missing translation message. By default, this will consider the inline option, current locale and fallback locale.

    i18n.locales.get("de-DE");
    // ["de-DE", "de", "en"]

    Returns

    The list of locales.

    Parameters

    • locale: string

      The locale query.

    Returns string[]

  • You can define custom rules for any locale. Just make sure you return an array containing all locales.

    // Default the Wookie locale to English.
    i18n.locales.register("wk", (_i18n, locale) => {
    return ["en"];
    });

    Returns

    Parameters

    • locale: string

      The locale's name.

    • localeResolver: string | string[] | LocaleResolver

      The locale resolver strategy.

    Returns void

Generated using TypeDoc