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

    Class Locales

    Index

    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"]

      Parameters

      • locale: string

        The locale query.

      Returns string[]

      The list of locales.

    • 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"];
      });

      Parameters

      • locale: string

        The locale's name.

      • localeResolver: string | string[] | LocaleResolver

        The locale resolver strategy.

      Returns void