i18next

  • Version 25.8.13
  • Published
  • 573 kB
  • 1 dependency
  • MIT license

Install

npm i i18next
yarn add i18next
pnpm add i18next

Overview

i18next internationalization framework

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Variables

variable ActualOptions

const ActualOptions: any;

    variable changeLanguage

    const changeLanguage: (
    lng?: string,
    callback?: Callback
    ) => Promise<TFunction<'translation', undefined>>;

      variable createInstance

      const createInstance: (options?: InitOptions<object>, callback?: Callback) => i18n;

        variable dir

        const dir: (lng?: string) => 'ltr' | 'rtl';

          variable exists

          const exists: ExistsFunction<string, $Dictionary<unknown>>;

            variable getFixedT

            const getFixedT: <
            Ns extends Namespace<string> = 'translation',
            TKPrefix extends string = undefined,
            ActualNs extends Namespace<string> = Ns extends null ? 'translation' : Ns
            >(
            ...args:
            | [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix]
            | [lng: null, ns: Ns, keyPrefix?: TKPrefix]
            ) => TFunction<ActualNs, TKPrefix>;

              variable hasLoadedNamespace

              const hasLoadedNamespace: (
              ns: string | readonly string[],
              options?: {
              lng?: string | readonly string[];
              fallbackLng?: false | FallbackLng;
              precheck?: (
              i18n: i18n,
              loadNotPending: (
              lng: string | readonly string[],
              ns: string | readonly string[]
              ) => boolean
              ) => boolean;
              }
              ) => boolean;

                variable i18next

                const i18next: i18n;

                  variable init

                  const init: {
                  (callback?: Callback): Promise<TFunction<'translation', undefined>>;
                  <T>(options: InitOptions<T>, callback?: Callback): Promise<
                  TFunction<'translation', undefined>
                  >;
                  };

                    variable Key

                    const Key: any;

                      variable loadLanguages

                      const loadLanguages: (
                      lngs: string | readonly string[],
                      callback?: Callback
                      ) => Promise<void>;

                        variable loadNamespaces

                        const loadNamespaces: (
                        ns: string | readonly string[],
                        callback?: Callback
                        ) => Promise<void>;

                          variable loadResources

                          const loadResources: (callback?: (err: any) => void) => void;

                            variable NewNs

                            const NewNs: any;

                              variable NsArg

                              const NsArg: any;

                                variable Opts

                                const Opts: any;

                                  variable ParseKeys

                                  const ParseKeys: any;

                                    variable reloadResources

                                    const reloadResources: {
                                    (
                                    lngs?: string | readonly string[],
                                    ns?: string | readonly string[],
                                    callback?: () => void
                                    ): Promise<void>;
                                    (
                                    lngs: null,
                                    ns: string | readonly string[],
                                    callback?: () => void
                                    ): Promise<void>;
                                    };

                                      variable Ret

                                      const Ret: any;

                                        variable SelectorOptions

                                        const SelectorOptions: any;

                                          variable setDefaultNamespace

                                          const setDefaultNamespace: (ns: string | readonly string[]) => void;

                                            variable t

                                            const t: TFunction<['translation', ...string[]], undefined>;

                                              variable TFunctionReturn

                                              const TFunctionReturn: any;

                                                variable TOpt

                                                const TOpt: any;

                                                  variable use

                                                  const use: <T extends Module>(module: T | NewableModule<T> | Newable<T>) => i18n;

                                                    Functions

                                                    function keyFromSelector

                                                    keyFromSelector: <S = Record<string, any>, T = string>(
                                                    selector: ($: S) => T
                                                    ) => T;

                                                      Classes

                                                      class ResourceStore

                                                      class ResourceStore {}

                                                        constructor

                                                        constructor(data: Resource, options: InitOptions<object>);

                                                          property data

                                                          data: Resource;

                                                            property options

                                                            options: InitOptions<object>;

                                                              method off

                                                              off: (
                                                              event: 'added' | 'removed',
                                                              callback?: (lng: string, ns: string) => void
                                                              ) => void;
                                                              • Remove event listener removes all callback when callback not specified

                                                              method on

                                                              on: (
                                                              event: 'added' | 'removed',
                                                              callback: (lng: string, ns: string) => void
                                                              ) => void;
                                                              • Gets fired when resources got added or removed

                                                              Interfaces

                                                              interface BackendModule

                                                              interface BackendModule<Options = object> extends Module {}
                                                              • Used to load data for i18next. Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next). For singleton set property type to 'backend' For a prototype constructor set static property.

                                                              property type

                                                              type: 'backend';

                                                                method create

                                                                create: (
                                                                languages: readonly string[],
                                                                namespace: string,
                                                                key: string,
                                                                fallbackValue: string
                                                                ) => void;
                                                                • Save the missing translation

                                                                method init

                                                                init: (
                                                                services: Services,
                                                                backendOptions: Options,
                                                                i18nextOptions: InitOptions
                                                                ) => void;

                                                                  method read

                                                                  read: (language: string, namespace: string, callback: ReadCallback) => void;

                                                                    method readMulti

                                                                    readMulti: (
                                                                    languages: readonly string[],
                                                                    namespaces: readonly string[],
                                                                    callback: MultiReadCallback
                                                                    ) => void;
                                                                    • Load multiple languages and namespaces. For backends supporting multiple resources loading

                                                                    method save

                                                                    save: (language: string, namespace: string, data: ResourceLanguage) => void;
                                                                    • Store the translation. For backends acting as cache layer

                                                                    interface Branded

                                                                    interface Branded<Ns extends Namespace> {}

                                                                      property $TFunctionBrand

                                                                      $TFunctionBrand: $IsResourcesDefined extends true
                                                                      ? `${Ns extends readonly any[] ? Ns[0] : Ns}`
                                                                      : never;

                                                                        interface CloneOptions

                                                                        interface CloneOptions extends InitOptions {}

                                                                          property forkResourceStore

                                                                          forkResourceStore?: boolean;
                                                                          • Will create a new instance of the resource store and import the existing translation resources. This way it will not shared the resource store instance. false

                                                                          interface CustomInstanceExtensions

                                                                          interface CustomInstanceExtensions {}

                                                                            interface CustomPluginOptions

                                                                            interface CustomPluginOptions {}
                                                                            • This interface can be augmented by users to add types to i18next default PluginOptions.

                                                                            interface CustomTypeOptions

                                                                            interface CustomTypeOptions {}
                                                                            • This interface can be augmented by users to add types to i18next default TypeOptions.

                                                                              Usage:

                                                                              // i18next.d.ts
                                                                              import 'i18next';
                                                                              declare module 'i18next' {
                                                                              interface CustomTypeOptions {
                                                                              defaultNS: 'custom';
                                                                              returnNull: false;
                                                                              returnObjects: false;
                                                                              nsSeparator: ':';
                                                                              keySeparator: '.';
                                                                              compatibilityJSON: 'v4';
                                                                              allowObjectInHTMLChildren: false;
                                                                              resources: {
                                                                              custom: {
                                                                              foo: 'foo';
                                                                              };
                                                                              };
                                                                              }
                                                                              }

                                                                            interface ExistsFunction

                                                                            interface ExistsFunction<
                                                                            TKeys extends string = string,
                                                                            TInterpolationMap extends object = $Dictionary
                                                                            > {}
                                                                            • Uses similar args as the t function and returns true if a key exists.

                                                                            call signature

                                                                            (key: TKeys | TKeys[], options?: TOptions<TInterpolationMap>): boolean;

                                                                              interface FallbackLngObjList

                                                                              interface FallbackLngObjList {}

                                                                                index signature

                                                                                [language: string]: readonly string[];

                                                                                  interface Formatter

                                                                                  interface Formatter {}

                                                                                    property format

                                                                                    format: FormatFunction;

                                                                                      method add

                                                                                      add: (
                                                                                      name: string,
                                                                                      fc: (value: any, lng: string | undefined, options: any) => string
                                                                                      ) => void;

                                                                                        method addCached

                                                                                        addCached: (
                                                                                        name: string,
                                                                                        fc: (lng: string | undefined, options: any) => (value: any) => string
                                                                                        ) => void;

                                                                                          method init

                                                                                          init: (services: Services, i18nextOptions: InitOptions) => void;

                                                                                            interface FormatterModule

                                                                                            interface FormatterModule extends Module, Formatter {}

                                                                                              property type

                                                                                              type: 'formatter';

                                                                                                interface i18n

                                                                                                interface i18n extends CustomInstanceExtensions {}

                                                                                                  property exists

                                                                                                  exists: ExistsFunction;
                                                                                                  • Uses similar args as the t function and returns true if a key exists.

                                                                                                  property format

                                                                                                  format: FormatFunction;
                                                                                                  • Exposes interpolation.format function added on init.

                                                                                                  property initializedLanguageOnce

                                                                                                  initializedLanguageOnce: boolean;
                                                                                                  • Language was initialized

                                                                                                  property initializedStoreOnce

                                                                                                  initializedStoreOnce: boolean;
                                                                                                  • Store was initialized

                                                                                                  property isInitialized

                                                                                                  isInitialized: boolean;
                                                                                                  • Is initialized

                                                                                                  property isInitializing

                                                                                                  isInitializing: boolean;
                                                                                                  • Is initializing

                                                                                                  property language

                                                                                                  language: string;
                                                                                                  • Is set to the current detected or set language. If you need the primary used language depending on your configuration (supportedLngs, load) you will prefer using i18next.languages[0].

                                                                                                  property languages

                                                                                                  languages: readonly string[];
                                                                                                  • Is set to an array of language-codes that will be used it order to lookup the translation value.

                                                                                                  property modules

                                                                                                  modules: Modules;
                                                                                                  • List of modules used

                                                                                                  property options

                                                                                                  options: InitOptions;
                                                                                                  • Current options

                                                                                                  property resolvedLanguage

                                                                                                  resolvedLanguage?: string;
                                                                                                  • Is set to the current resolved language. It can be used as primary used language, for example in a language switcher.

                                                                                                  property services

                                                                                                  services: Services;
                                                                                                  • Internal container for all used plugins and implementation details like languageUtils, pluralResolvers, etc.

                                                                                                  property store

                                                                                                  store: ResourceStore;
                                                                                                  • Internal container for translation resources

                                                                                                  property t

                                                                                                  t: TFunction<
                                                                                                  [
                                                                                                  ...$NormalizeIntoArray<DefaultNamespace>,
                                                                                                  ...Exclude<
                                                                                                  FlatNamespace,
                                                                                                  InferArrayValuesElseReturnType<DefaultNamespace>
                                                                                                  >[]
                                                                                                  ]
                                                                                                  >;

                                                                                                    method addResource

                                                                                                    addResource: (
                                                                                                    lng: string,
                                                                                                    ns: string,
                                                                                                    key: string,
                                                                                                    value: string,
                                                                                                    options?: { keySeparator?: string; silent?: boolean }
                                                                                                    ) => i18n;
                                                                                                    • Adds one key/value.

                                                                                                    method addResourceBundle

                                                                                                    addResourceBundle: (
                                                                                                    lng: string,
                                                                                                    ns: string,
                                                                                                    resources: any,
                                                                                                    deep?: boolean,
                                                                                                    overwrite?: boolean
                                                                                                    ) => i18n;
                                                                                                    • Adds a complete bundle. Setting deep param to true will extend existing translations in that file. Setting overwrite to true it will overwrite existing translations in that file.

                                                                                                    method addResources

                                                                                                    addResources: (lng: string, ns: string, resources: any) => i18n;
                                                                                                    • Adds multiple key/values.

                                                                                                    method changeLanguage

                                                                                                    changeLanguage: (lng?: string, callback?: Callback) => Promise<TFunction>;
                                                                                                    • Changes the language. The callback will be called as soon translations were loaded or an error occurs while loading. HINT: For easy testing - setting lng to 'cimode' will set t function to always return the key.

                                                                                                    method cloneInstance

                                                                                                    cloneInstance: (options?: CloneOptions, callback?: Callback) => i18n;
                                                                                                    • Creates a clone of the current instance. Shares store, plugins and initial configuration. Can be used to create an instance sharing storage but being independent on set language or namespaces.

                                                                                                    method createInstance

                                                                                                    createInstance: (options?: InitOptions, callback?: Callback) => i18n;
                                                                                                    • Will return a new i18next instance. Please read the options page for details on configuration options. Providing a callback will automatically call init. The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).

                                                                                                    method dir

                                                                                                    dir: (lng?: string) => 'ltr' | 'rtl';
                                                                                                    • Returns rtl or ltr depending on languages read direction.

                                                                                                    method emit

                                                                                                    emit: (eventName: string, ...args: any[]) => void;
                                                                                                    • Emit event

                                                                                                    method getDataByLanguage

                                                                                                    getDataByLanguage: (lng: string) => { [key: string]: { [key: string]: string } };
                                                                                                    • Returns a resource data by language.

                                                                                                    method getFixedT

                                                                                                    getFixedT: <
                                                                                                    Ns extends Namespace<string> = 'translation',
                                                                                                    TKPrefix extends string = undefined,
                                                                                                    ActualNs extends Namespace<string> = Ns extends null ? 'translation' : Ns
                                                                                                    >(
                                                                                                    ...args:
                                                                                                    | [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix]
                                                                                                    | [lng: null, ns: Ns, keyPrefix?: TKPrefix]
                                                                                                    ) => TFunction<ActualNs, TKPrefix>;
                                                                                                    • Returns a t function that defaults to given language or namespace. Both params could be arrays of languages or namespaces and will be treated as fallbacks in that case. On the returned function you can like in the t function override the languages or namespaces by passing them in options or by prepending namespace.

                                                                                                      Accepts optional keyPrefix that will be automatically applied to returned t function.

                                                                                                    method getResource

                                                                                                    getResource: (
                                                                                                    lng: string,
                                                                                                    ns: string,
                                                                                                    key: string,
                                                                                                    options?: Pick<InitOptions, 'keySeparator' | 'ignoreJSONStructure'>
                                                                                                    ) => any;
                                                                                                    • Gets one value by given key.

                                                                                                    method getResourceBundle

                                                                                                    getResourceBundle: (lng: string, ns: string) => any;
                                                                                                    • Returns a resource bundle.

                                                                                                    method hasLoadedNamespace

                                                                                                    hasLoadedNamespace: (
                                                                                                    ns: string | readonly string[],
                                                                                                    options?: {
                                                                                                    lng?: string | readonly string[];
                                                                                                    fallbackLng?: InitOptions['fallbackLng'];
                                                                                                    precheck?: (
                                                                                                    i18n: i18n,
                                                                                                    loadNotPending: (
                                                                                                    lng: string | readonly string[],
                                                                                                    ns: string | readonly string[]
                                                                                                    ) => boolean
                                                                                                    ) => boolean | undefined;
                                                                                                    }
                                                                                                    ) => boolean;
                                                                                                    • Checks if namespace has loaded yet. i.e. used by react-i18next

                                                                                                    method hasResourceBundle

                                                                                                    hasResourceBundle: (lng: string, ns: string) => boolean;
                                                                                                    • Checks if a resource bundle exists.

                                                                                                    method init

                                                                                                    init: {
                                                                                                    (callback?: Callback): Promise<TFunction>;
                                                                                                    <T>(options: InitOptions<T>, callback?: Callback): Promise<
                                                                                                    TFunction<'translation', undefined>
                                                                                                    >;
                                                                                                    };
                                                                                                    • The default of the i18next module is an i18next instance ready to be initialized by calling init. You can create additional instances using the createInstance function.

                                                                                                      Parameter options

                                                                                                      Initial options.

                                                                                                      Parameter callback

                                                                                                      will be called after all translations were loaded or with an error when failed (in case of using a backend).

                                                                                                    method loadLanguages

                                                                                                    loadLanguages: (
                                                                                                    lngs: string | readonly string[],
                                                                                                    callback?: Callback
                                                                                                    ) => Promise<void>;
                                                                                                    • Loads additional languages not defined in init options (preload).

                                                                                                    method loadNamespaces

                                                                                                    loadNamespaces: (
                                                                                                    ns: string | readonly string[],
                                                                                                    callback?: Callback
                                                                                                    ) => Promise<void>;
                                                                                                    • Loads additional namespaces not defined in init options.

                                                                                                    method loadResources

                                                                                                    loadResources: (callback?: (err: any) => void) => void;

                                                                                                      method off

                                                                                                      off: (event: string, listener?: (...args: any[]) => void) => void;
                                                                                                      • Remove event listener removes all callback when callback not specified

                                                                                                      method on

                                                                                                      on: {
                                                                                                      (event: 'initialized', callback: (options: InitOptions) => void): void;
                                                                                                      (
                                                                                                      event: 'loaded',
                                                                                                      callback: (loaded: {
                                                                                                      [language: string]: { [namespace: string]: boolean };
                                                                                                      }) => void
                                                                                                      ): void;
                                                                                                      (
                                                                                                      event: 'failedLoading',
                                                                                                      callback: (lng: string, ns: string, msg: string) => void
                                                                                                      ): void;
                                                                                                      (
                                                                                                      event: 'missingKey',
                                                                                                      callback: (
                                                                                                      lngs: readonly string[],
                                                                                                      namespace: string,
                                                                                                      key: string,
                                                                                                      res: string
                                                                                                      ) => void
                                                                                                      ): void;
                                                                                                      (event: 'languageChanged', callback: (lng: string) => void): void;
                                                                                                      (event: string, listener: (...args: any[]) => void): void;
                                                                                                      };
                                                                                                      • Gets fired after initialization.

                                                                                                      • Gets fired on loaded resources.

                                                                                                      • Gets fired if loading resources failed.

                                                                                                      • Gets fired on accessing a key not existing.

                                                                                                      • Gets fired when changeLanguage got called.

                                                                                                      • Event listener

                                                                                                      method reloadResources

                                                                                                      reloadResources: {
                                                                                                      (
                                                                                                      lngs?: string | readonly string[],
                                                                                                      ns?: string | readonly string[],
                                                                                                      callback?: () => void
                                                                                                      ): Promise<void>;
                                                                                                      (
                                                                                                      lngs: null,
                                                                                                      ns: string | readonly string[],
                                                                                                      callback?: () => void
                                                                                                      ): Promise<void>;
                                                                                                      };
                                                                                                      • Reloads resources on given state. Optionally you can pass an array of languages and namespaces as params if you don't want to reload all.

                                                                                                      method removeResourceBundle

                                                                                                      removeResourceBundle: (lng: string, ns: string) => i18n;
                                                                                                      • Removes an existing bundle.

                                                                                                      method setDefaultNamespace

                                                                                                      setDefaultNamespace: (ns: string | readonly string[]) => void;
                                                                                                      • Changes the default namespace.

                                                                                                      method toJSON

                                                                                                      toJSON: () => {
                                                                                                      options: InitOptions;
                                                                                                      store: ResourceStore;
                                                                                                      language: string;
                                                                                                      languages: readonly string[];
                                                                                                      resolvedLanguage?: string;
                                                                                                      };
                                                                                                      • Returns a JSON representation of the i18next instance for serialization.

                                                                                                      method use

                                                                                                      use: <T extends Module>(module: T | NewableModule<T> | Newable<T>) => this;
                                                                                                      • The use function is there to load additional plugins to i18next. For available module see the plugins page and don't forget to read the documentation of the plugin.

                                                                                                        Parameter module

                                                                                                        Accepts a class or object

                                                                                                      interface I18nFormatModule

                                                                                                      interface I18nFormatModule extends Module {}

                                                                                                        property type

                                                                                                        type: 'i18nFormat';

                                                                                                          interface InitOptions

                                                                                                          interface InitOptions<T = object> extends PluginOptions<T> {}

                                                                                                            property appendNamespaceToCIMode

                                                                                                            appendNamespaceToCIMode?: boolean;
                                                                                                            • Prefixes the namespace to the returned key when using cimode false

                                                                                                            property appendNamespaceToMissingKey

                                                                                                            appendNamespaceToMissingKey?: boolean;
                                                                                                            • Appends namespace to missing key false

                                                                                                            property cacheInBuiltFormats

                                                                                                            cacheInBuiltFormats?: boolean;
                                                                                                            • Initializes the internal formatter for the in-built formats as cached version. Can be set to false for this type of issues: https://github.com/i18next/i18next/issues/2227 true

                                                                                                            property cleanCode

                                                                                                            cleanCode?: boolean;
                                                                                                            • Language will be lowercased EN --> en while leaving full locales like en-US false

                                                                                                            property compatibilityJSON

                                                                                                            compatibilityJSON?: 'v4';
                                                                                                            • Compatibility JSON version only v4 is available and supported by typescript 'v4'

                                                                                                            property contextSeparator

                                                                                                            contextSeparator?: string;
                                                                                                            • Char to split context from key '_'

                                                                                                            property debug

                                                                                                            debug?: boolean;
                                                                                                            • Logs info level to console output. Helps finding issues with loading not working. false

                                                                                                            property defaultNS

                                                                                                            defaultNS?: string | false | readonly string[];
                                                                                                            • Default namespace used if not passed to translation function 'translation'

                                                                                                            property fallbackLng

                                                                                                            fallbackLng?: false | FallbackLng;
                                                                                                            • Language to use if translations in user language are not available. 'dev'

                                                                                                            property fallbackNS

                                                                                                            fallbackNS?: false | string | readonly string[];
                                                                                                            • String or array of namespaces to lookup key if not found in given namespace. false

                                                                                                            property ignoreJSONStructure

                                                                                                            ignoreJSONStructure?: boolean;
                                                                                                            • Automatically lookup for a flat key if a nested key is not found an vice-versa true

                                                                                                            property initAsync

                                                                                                            initAsync?: boolean;
                                                                                                            • Triggers resource loading in init function inside a setTimeout (default async behaviour). Set it to false if your backend loads resources sync - that way calling i18next.t after init is possible without relaying on the init callback. true

                                                                                                            property initImmediate

                                                                                                            initImmediate?: boolean;
                                                                                                            • Deprecated

                                                                                                              Use initAsync instead.

                                                                                                            property interpolation

                                                                                                            interpolation?: InterpolationOptions;
                                                                                                            • See Also

                                                                                                              • https://www.i18next.com/translation-function/interpolation

                                                                                                            property joinArrays

                                                                                                            joinArrays?: false | string;
                                                                                                            • Char, eg. '\n' that arrays will be joined by false

                                                                                                            property keySeparator

                                                                                                            keySeparator?: false | string;
                                                                                                            • Char to separate keys '.'

                                                                                                            property lng

                                                                                                            lng?: string;
                                                                                                            • Language to use (overrides language detection) undefined

                                                                                                            property load

                                                                                                            load?: 'all' | 'currentOnly' | 'languageOnly';
                                                                                                            • Language codes to lookup, given set language is 'en-US': 'all' --> ['en-US', 'en', 'dev'], 'currentOnly' --> 'en-US', 'languageOnly' --> 'en' 'all'

                                                                                                            property locizeLastUsed

                                                                                                            locizeLastUsed?: {
                                                                                                            /**
                                                                                                            * The id of your locize project
                                                                                                            */
                                                                                                            projectId: string;
                                                                                                            /**
                                                                                                            * An api key if you want to send missing keys
                                                                                                            */
                                                                                                            apiKey?: string;
                                                                                                            /**
                                                                                                            * The reference language of your project
                                                                                                            * @default 'en'
                                                                                                            */
                                                                                                            referenceLng?: string;
                                                                                                            /**
                                                                                                            * Version
                                                                                                            * @default 'latest'
                                                                                                            */
                                                                                                            version?: string;
                                                                                                            /**
                                                                                                            * Debounce interval to send data in milliseconds
                                                                                                            * @default 90000
                                                                                                            */
                                                                                                            debounceSubmit?: number;
                                                                                                            /**
                                                                                                            * Hostnames that are allowed to send last used data.
                                                                                                            * Please keep those to your local system, staging, test servers (not production)
                                                                                                            * @default ['localhost']
                                                                                                            */
                                                                                                            allowedHosts?: readonly string[];
                                                                                                            };
                                                                                                            • Options for https://github.com/locize/locize-lastused undefined

                                                                                                            property lowerCaseLng

                                                                                                            lowerCaseLng?: boolean;
                                                                                                            • Language will be lowercased eg. en-US --> en-us false

                                                                                                            property maxParallelReads

                                                                                                            maxParallelReads?: number;
                                                                                                            • Limit parallelism of calls to backend This is needed to prevent trying to open thousands of sockets or file descriptors, which can cause failures and actually make the entire process take longer. 10

                                                                                                            property maxRetries

                                                                                                            maxRetries?: number;
                                                                                                            • The maximum number of retries to perform. Note that retries are only performed when a request has no response and throws an error. The default value is used if value is set below 0. 5

                                                                                                            property missingInterpolationHandler

                                                                                                            missingInterpolationHandler?: (
                                                                                                            text: string,
                                                                                                            value: any,
                                                                                                            options: InitOptions
                                                                                                            ) => any;
                                                                                                            • Gets called in case a interpolation value is undefined. This method will not be called if the value is empty string or null noop

                                                                                                            property missingKeyHandler

                                                                                                            missingKeyHandler?:
                                                                                                            | false
                                                                                                            | ((
                                                                                                            lngs: readonly string[],
                                                                                                            ns: string,
                                                                                                            key: string,
                                                                                                            fallbackValue: string,
                                                                                                            updateMissing: boolean,
                                                                                                            options: any
                                                                                                            ) => void);
                                                                                                            • Used for custom missing key handling (needs saveMissing set to true!) false

                                                                                                            property missingKeyNoValueFallbackToKey

                                                                                                            missingKeyNoValueFallbackToKey?: boolean;
                                                                                                            • Used to not fallback to the key as default value, when using saveMissing functionality. i.e. when using with i18next-http-backend this will result in having a key with an empty string value. false

                                                                                                            property nonExplicitSupportedLngs

                                                                                                            nonExplicitSupportedLngs?: boolean;
                                                                                                            • If true will pass eg. en-US if finding en in supportedLngs false

                                                                                                            property ns

                                                                                                            ns?: string | readonly string[];
                                                                                                            • String or array of namespaces to load 'translation'

                                                                                                            property nsSeparator

                                                                                                            nsSeparator?: false | string;
                                                                                                            • Char to split namespace from key ':'

                                                                                                            property partialBundledLanguages

                                                                                                            partialBundledLanguages?: boolean;
                                                                                                            • Allow initializing with bundled resources while using a backend to load non bundled ones. false

                                                                                                            property pluralSeparator

                                                                                                            pluralSeparator?: string;
                                                                                                            • Char to split plural from key '_'

                                                                                                            property postProcess

                                                                                                            postProcess?: false | string | readonly string[];
                                                                                                            • String or array of postProcessors to apply per default false

                                                                                                            property postProcessPassResolved

                                                                                                            postProcessPassResolved?: boolean;
                                                                                                            • passthrough the resolved object including 'usedNS', 'usedLang' etc into options object of postprocessors as 'i18nResolved' property false

                                                                                                            property preload

                                                                                                            preload?: false | readonly string[];
                                                                                                            • Array of languages to preload. Important on server-side to assert translations are loaded before rendering views. false

                                                                                                            property react

                                                                                                            react?: ReactOptions;
                                                                                                            • Options for react - check documentation of plugin undefined

                                                                                                            property resources

                                                                                                            resources?: Resource;
                                                                                                            • Resources to initialize with (if not using loading or not appending using addResourceBundle) undefined

                                                                                                            property retryTimeout

                                                                                                            retryTimeout?: number;
                                                                                                            • Set how long to wait, in milliseconds, between retries of failed requests. This number is compounded by a factor of 2 for subsequent retry. The default value is used if value is set below 1ms. 350

                                                                                                            property returnDetails

                                                                                                            returnDetails?: boolean;
                                                                                                            • Returns an object that includes information about the used language, namespace, key and value false

                                                                                                            property returnEmptyString

                                                                                                            returnEmptyString?: boolean;
                                                                                                            • Allows empty string as valid translation true

                                                                                                            property returnNull

                                                                                                            returnNull?: boolean;
                                                                                                            • Allows null values as valid translation false

                                                                                                            property returnObjects

                                                                                                            returnObjects?: boolean;
                                                                                                            • Allows objects as valid translation result false

                                                                                                            property saveMissing

                                                                                                            saveMissing?: boolean;
                                                                                                            • Calls save missing key function on backend if key not found. false

                                                                                                            property saveMissingPlurals

                                                                                                            saveMissingPlurals?: boolean;
                                                                                                            • Calls save missing key function on backend if key not found also for plural forms. false

                                                                                                            property saveMissingTo

                                                                                                            saveMissingTo?: 'current' | 'all' | 'fallback';
                                                                                                            • 'fallback'

                                                                                                            property showSupportNotice

                                                                                                            showSupportNotice?: boolean;
                                                                                                            • Show support notice in console during initialization. true

                                                                                                            property simplifyPluralSuffix

                                                                                                            simplifyPluralSuffix?: boolean;
                                                                                                            • Will use 'plural' as suffix for languages only having 1 plural form, setting it to false will suffix all with numbers true

                                                                                                            property supportedLngs

                                                                                                            supportedLngs?: false | readonly string[];
                                                                                                            • Array of allowed languages false

                                                                                                            property updateMissing

                                                                                                            updateMissing?: boolean;
                                                                                                            • Experimental: enable to update default values using the saveMissing (Works only if defaultValue different from translated value. Only useful on initial development or when keeping code as source of truth not changing values outside of code. Only supported if backend supports it already) false

                                                                                                            method overloadTranslationOptionHandler

                                                                                                            overloadTranslationOptionHandler: (args: string[]) => TOptions;
                                                                                                            • Sets defaultValue args => ({ defaultValue: args[1] })

                                                                                                            method parseMissingKeyHandler

                                                                                                            parseMissingKeyHandler: (
                                                                                                            key: string,
                                                                                                            defaultValue?: string,
                                                                                                            options?: any
                                                                                                            ) => any;
                                                                                                            • Receives a key that was not found in t() and returns a value, that will be returned by t() noop

                                                                                                            method returnedObjectHandler

                                                                                                            returnedObjectHandler: (key: string, value: string, options: any) => void;
                                                                                                            • Gets called if object was passed in as key but returnObjects was set to false noop

                                                                                                            interface InterpolationOptions

                                                                                                            interface InterpolationOptions {}

                                                                                                              property alwaysFormat

                                                                                                              alwaysFormat?: boolean;
                                                                                                              • Always format interpolated values. false

                                                                                                              property defaultVariables

                                                                                                              defaultVariables?: { [index: string]: any };
                                                                                                              • Global variables to use in interpolation replacements undefined

                                                                                                              property escapeValue

                                                                                                              escapeValue?: boolean;
                                                                                                              • Escape passed in values to avoid xss injection true

                                                                                                              property format

                                                                                                              format?: FormatFunction;
                                                                                                              • Format function see formatting for details noop

                                                                                                              property formatSeparator

                                                                                                              formatSeparator?: string;
                                                                                                              • Used to separate format from interpolation value ','

                                                                                                              property maxReplaces

                                                                                                              maxReplaces?: number;
                                                                                                              • After how many interpolation runs to break out before throwing a stack overflow 1000

                                                                                                              property nestingOptionsSeparator

                                                                                                              nestingOptionsSeparator?: string;
                                                                                                              • Separates options from key ','

                                                                                                              property nestingPrefix

                                                                                                              nestingPrefix?: string;
                                                                                                              • Prefix for nesting '$t('

                                                                                                              property nestingPrefixEscaped

                                                                                                              nestingPrefixEscaped?: string;
                                                                                                              • Escaped prefix for nesting (regexSafe) undefined

                                                                                                              property nestingSuffix

                                                                                                              nestingSuffix?: string;
                                                                                                              • Suffix for nesting ')'

                                                                                                              property nestingSuffixEscaped

                                                                                                              nestingSuffixEscaped?: string;
                                                                                                              • Escaped suffix for nesting (regexSafe) undefined

                                                                                                              property prefix

                                                                                                              prefix?: string;
                                                                                                              • Prefix for interpolation '{{'

                                                                                                              property prefixEscaped

                                                                                                              prefixEscaped?: string;
                                                                                                              • Escaped prefix for interpolation (regexSafe) undefined

                                                                                                              property skipOnVariables

                                                                                                              skipOnVariables?: boolean;
                                                                                                              • If true, it will skip to interpolate the variables true

                                                                                                              property suffix

                                                                                                              suffix?: string;
                                                                                                              • Suffix for interpolation '}}'

                                                                                                              property suffixEscaped

                                                                                                              suffixEscaped?: string;
                                                                                                              • Escaped suffix for interpolation (regexSafe) undefined

                                                                                                              property unescapePrefix

                                                                                                              unescapePrefix?: string;
                                                                                                              • Prefix to unescaped mode '-'

                                                                                                              property unescapeSuffix

                                                                                                              unescapeSuffix?: string;
                                                                                                              • Suffix to unescaped mode undefined

                                                                                                              property useRawValueToEscape

                                                                                                              useRawValueToEscape?: boolean;
                                                                                                              • If true, then value passed into escape function is not casted to string, use with custom escape function that does its own type check false

                                                                                                              method escape

                                                                                                              escape: (str: string) => string;
                                                                                                              • Escape function str => str

                                                                                                              interface Interpolator

                                                                                                              interface Interpolator {}

                                                                                                                method init

                                                                                                                init: (options: InterpolationOptions, reset: boolean) => undefined;

                                                                                                                  method interpolate

                                                                                                                  interpolate: (
                                                                                                                  str: string,
                                                                                                                  data: object,
                                                                                                                  lng: string,
                                                                                                                  options: InterpolationOptions
                                                                                                                  ) => string;

                                                                                                                    method nest

                                                                                                                    nest: (
                                                                                                                    str: string,
                                                                                                                    fc: (...args: any[]) => any,
                                                                                                                    options: InterpolationOptions
                                                                                                                    ) => string;

                                                                                                                      method reset

                                                                                                                      reset: () => undefined;

                                                                                                                        method resetRegExp

                                                                                                                        resetRegExp: () => undefined;

                                                                                                                          interface LanguageDetectorAsyncModule

                                                                                                                          interface LanguageDetectorAsyncModule extends Module {}
                                                                                                                          • Used to detect language in user land. Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next). For singleton set property type to 'languageDetector' For a prototype constructor set static property.

                                                                                                                          property async

                                                                                                                          async: true;
                                                                                                                          • Set to true to enable async detection

                                                                                                                          property type

                                                                                                                          type: 'languageDetector';

                                                                                                                            method cacheUserLanguage

                                                                                                                            cacheUserLanguage: (lng: string) => void | Promise<void>;

                                                                                                                              method detect

                                                                                                                              detect: (
                                                                                                                              callback: (lng: string | readonly string[] | undefined) => void | undefined
                                                                                                                              ) => void | Promise<string | readonly string[] | undefined>;
                                                                                                                              • Must call callback passing detected language or return a Promise

                                                                                                                              method init

                                                                                                                              init: (
                                                                                                                              services: Services,
                                                                                                                              detectorOptions: object,
                                                                                                                              i18nextOptions: InitOptions
                                                                                                                              ) => void;

                                                                                                                                interface LanguageDetectorModule

                                                                                                                                interface LanguageDetectorModule extends Module {}
                                                                                                                                • Used to detect language in user land. Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next). For singleton set property type to 'languageDetector' For a prototype constructor set static property.

                                                                                                                                property type

                                                                                                                                type: 'languageDetector';

                                                                                                                                  method cacheUserLanguage

                                                                                                                                  cacheUserLanguage: (lng: string) => void;

                                                                                                                                    method detect

                                                                                                                                    detect: () => string | readonly string[] | undefined;
                                                                                                                                    • Must return detected language

                                                                                                                                    method init

                                                                                                                                    init: (
                                                                                                                                    services: Services,
                                                                                                                                    detectorOptions: object,
                                                                                                                                    i18nextOptions: InitOptions
                                                                                                                                    ) => void;

                                                                                                                                      interface LoggerModule

                                                                                                                                      interface LoggerModule extends Module {}
                                                                                                                                      • Override the built-in console logger. Do not need to be a prototype function.

                                                                                                                                      property type

                                                                                                                                      type: 'logger';

                                                                                                                                        method error

                                                                                                                                        error: (...args: any[]) => void;

                                                                                                                                          method log

                                                                                                                                          log: (...args: any[]) => void;

                                                                                                                                            method warn

                                                                                                                                            warn: (...args: any[]) => void;

                                                                                                                                              interface Module

                                                                                                                                              interface Module {}

                                                                                                                                                property type

                                                                                                                                                type: ModuleType;

                                                                                                                                                  interface Modules

                                                                                                                                                  interface Modules {}

                                                                                                                                                    property backend

                                                                                                                                                    backend?: BackendModule;

                                                                                                                                                      property external

                                                                                                                                                      external: ThirdPartyModule[];

                                                                                                                                                        property formatter

                                                                                                                                                        formatter?: FormatterModule;

                                                                                                                                                          property i18nFormat

                                                                                                                                                          i18nFormat?: I18nFormatModule;

                                                                                                                                                            property languageDetector

                                                                                                                                                            languageDetector?: LanguageDetectorModule | LanguageDetectorAsyncModule;

                                                                                                                                                              property logger

                                                                                                                                                              logger?: LoggerModule;

                                                                                                                                                                interface Newable

                                                                                                                                                                interface Newable<T> {}

                                                                                                                                                                  construct signature

                                                                                                                                                                  new (...args: any[]): T;

                                                                                                                                                                    interface NewableModule

                                                                                                                                                                    interface NewableModule<T extends Module> extends Newable<T> {}

                                                                                                                                                                      property type

                                                                                                                                                                      type: T['type'];

                                                                                                                                                                        interface PostProcessorModule

                                                                                                                                                                        interface PostProcessorModule extends Module {}
                                                                                                                                                                        • Used to extend or manipulate the translated values before returning them in t function. Need to be a singleton object.

                                                                                                                                                                        property name

                                                                                                                                                                        name: string;
                                                                                                                                                                        • Unique name

                                                                                                                                                                        property type

                                                                                                                                                                        type: 'postProcessor';

                                                                                                                                                                          method process

                                                                                                                                                                          process: (
                                                                                                                                                                          value: string,
                                                                                                                                                                          key: string | string[],
                                                                                                                                                                          options: TOptions,
                                                                                                                                                                          translator: any
                                                                                                                                                                          ) => string;

                                                                                                                                                                            interface ReactOptions

                                                                                                                                                                            interface ReactOptions {}

                                                                                                                                                                              property bindI18n

                                                                                                                                                                              bindI18n?: string | false;
                                                                                                                                                                              • Set which events trigger a re-render, can be set to false or string of events 'languageChanged'

                                                                                                                                                                              property bindI18nStore

                                                                                                                                                                              bindI18nStore?: string | false;
                                                                                                                                                                              • Set which events on store trigger a re-render, can be set to false or string of events ''

                                                                                                                                                                              property defaultTransParent

                                                                                                                                                                              defaultTransParent?: string;
                                                                                                                                                                              • Set it to the default parent element created by the Trans component. 'div'

                                                                                                                                                                              property keyPrefix

                                                                                                                                                                              keyPrefix?: string;
                                                                                                                                                                              • Optional keyPrefix that will be automatically applied to returned t function in useTranslation for example. undefined

                                                                                                                                                                              property nsMode

                                                                                                                                                                              nsMode?: 'default' | 'fallback';
                                                                                                                                                                              • Set it to fallback to let passed namespaces to translated hoc act as fallbacks 'default'

                                                                                                                                                                              property transDefaultProps

                                                                                                                                                                              transDefaultProps?: {
                                                                                                                                                                              tOptions?: TOptions;
                                                                                                                                                                              values?: object;
                                                                                                                                                                              shouldUnescape?: boolean;
                                                                                                                                                                              components?: readonly unknown[] | { readonly [tagName: string]: unknown }; // Use `unknown` (or `any`) to be permissive without importing React.
                                                                                                                                                                              };
                                                                                                                                                                              • Default props to apply to all Trans components. Component-level props will override these defaults.

                                                                                                                                                                              property transEmptyNodeValue

                                                                                                                                                                              transEmptyNodeValue?: string;
                                                                                                                                                                              • Set fallback value for Trans components without children undefined

                                                                                                                                                                              property transKeepBasicHtmlNodesFor

                                                                                                                                                                              transKeepBasicHtmlNodesFor?: readonly string[];
                                                                                                                                                                              • Which nodes not to convert in defaultValue generation in the Trans component. ['br', 'strong', 'i', 'p']

                                                                                                                                                                              property transSupportBasicHtmlNodes

                                                                                                                                                                              transSupportBasicHtmlNodes?: boolean;
                                                                                                                                                                              • Convert eg. found in translations to a react component of type br true

                                                                                                                                                                              property transWrapTextNodes

                                                                                                                                                                              transWrapTextNodes?: string;
                                                                                                                                                                              • Wrap text nodes in a user-specified element. ''

                                                                                                                                                                              property useSuspense

                                                                                                                                                                              useSuspense?: boolean;
                                                                                                                                                                              • Set it to false if you do not want to use Suspense true

                                                                                                                                                                              method hashTransKey

                                                                                                                                                                              hashTransKey: (
                                                                                                                                                                              defaultValue: TOptionsBase['defaultValue']
                                                                                                                                                                              ) => TOptionsBase['defaultValue'];
                                                                                                                                                                              • Function to generate an i18nKey from the defaultValue (or Trans children) when no key is provided. By default, the defaultValue (Trans text) itself is used as the key. If you want to require keys for all translations, supply a function that always throws an error. undefined

                                                                                                                                                                              method unescape

                                                                                                                                                                              unescape: (str: string) => string;
                                                                                                                                                                              • Unescape function by default it unescapes some basic html entities

                                                                                                                                                                              interface Resource

                                                                                                                                                                              interface Resource {}

                                                                                                                                                                                index signature

                                                                                                                                                                                [language: string]: ResourceLanguage;

                                                                                                                                                                                  interface ResourceLanguage

                                                                                                                                                                                  interface ResourceLanguage {}

                                                                                                                                                                                    index signature

                                                                                                                                                                                    [namespace: string]: ResourceKey;

                                                                                                                                                                                      interface SelectorFn

                                                                                                                                                                                      interface SelectorFn<Source, Target, Opts extends SelectorOptions<unknown>> {}

                                                                                                                                                                                        call signature

                                                                                                                                                                                        (translations: Select<Source, Opts['context']>): Target;

                                                                                                                                                                                          interface SelectorOptions

                                                                                                                                                                                          interface SelectorOptions<Ns = Namespace>
                                                                                                                                                                                          extends Omit<TOptionsBase, 'ns' | 'nsSeparator'>,
                                                                                                                                                                                          $Dictionary {}

                                                                                                                                                                                            property ns

                                                                                                                                                                                            ns?: Ns;

                                                                                                                                                                                              interface Services

                                                                                                                                                                                              interface Services {}

                                                                                                                                                                                                property backendConnector

                                                                                                                                                                                                backendConnector: any;

                                                                                                                                                                                                  property formatter

                                                                                                                                                                                                  formatter?: Formatter;

                                                                                                                                                                                                    property i18nFormat

                                                                                                                                                                                                    i18nFormat: any;

                                                                                                                                                                                                      property interpolator

                                                                                                                                                                                                      interpolator: Interpolator;

                                                                                                                                                                                                        property languageDetector

                                                                                                                                                                                                        languageDetector: any;

                                                                                                                                                                                                          property languageUtils

                                                                                                                                                                                                          languageUtils: any;

                                                                                                                                                                                                            property logger

                                                                                                                                                                                                            logger: any;

                                                                                                                                                                                                              property pluralResolver

                                                                                                                                                                                                              pluralResolver: any;

                                                                                                                                                                                                                property resourceStore

                                                                                                                                                                                                                resourceStore: ResourceStore;

                                                                                                                                                                                                                  interface TFunction

                                                                                                                                                                                                                  interface TFunction<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>
                                                                                                                                                                                                                  extends TFunctionSignature<Ns, KPrefix> {}

                                                                                                                                                                                                                    interface TFunctionNonStrict

                                                                                                                                                                                                                    interface TFunctionNonStrict<
                                                                                                                                                                                                                    Ns extends Namespace = DefaultNamespace,
                                                                                                                                                                                                                    KPrefix = undefined
                                                                                                                                                                                                                    > extends Branded<Ns> {}

                                                                                                                                                                                                                      interface TFunctionSelector

                                                                                                                                                                                                                      interface TFunctionSelector<Ns extends Namespace, KPrefix, Source>
                                                                                                                                                                                                                      extends Branded<Ns> {}

                                                                                                                                                                                                                        interface TFunctionStrict

                                                                                                                                                                                                                        interface TFunctionStrict<
                                                                                                                                                                                                                        Ns extends Namespace = DefaultNamespace,
                                                                                                                                                                                                                        KPrefix = undefined
                                                                                                                                                                                                                        > extends Branded<Ns> {}
                                                                                                                                                                                                                        • ************************ T function declaration * ************************

                                                                                                                                                                                                                        interface ThirdPartyModule

                                                                                                                                                                                                                        interface ThirdPartyModule extends Module {}

                                                                                                                                                                                                                          property type

                                                                                                                                                                                                                          type: '3rdParty';

                                                                                                                                                                                                                            method init

                                                                                                                                                                                                                            init: (i18next: i18n) => void;

                                                                                                                                                                                                                              interface TOptionsBase

                                                                                                                                                                                                                              interface TOptionsBase {}

                                                                                                                                                                                                                                property context

                                                                                                                                                                                                                                context?: unknown;
                                                                                                                                                                                                                                • Used for contexts (eg. male\female)

                                                                                                                                                                                                                                property count

                                                                                                                                                                                                                                count?: number;
                                                                                                                                                                                                                                • Count value used for plurals

                                                                                                                                                                                                                                property defaultValue

                                                                                                                                                                                                                                defaultValue?: unknown;
                                                                                                                                                                                                                                • Default value to return if a translation was not found

                                                                                                                                                                                                                                property fallbackLng

                                                                                                                                                                                                                                fallbackLng?: false | FallbackLng;
                                                                                                                                                                                                                                • Override language to lookup key if not found see fallbacks for details

                                                                                                                                                                                                                                property interpolation

                                                                                                                                                                                                                                interpolation?: InterpolationOptions;
                                                                                                                                                                                                                                • Override interpolation options

                                                                                                                                                                                                                                property joinArrays

                                                                                                                                                                                                                                joinArrays?: string;
                                                                                                                                                                                                                                • Char, eg. '\n' that arrays will be joined by (can be set globally too)

                                                                                                                                                                                                                                property keyPrefix

                                                                                                                                                                                                                                keyPrefix?: string;
                                                                                                                                                                                                                                • Optional keyPrefix that will be applied to the key before resolving. Only supported on the TFunction returned by getFixedT().

                                                                                                                                                                                                                                property keySeparator

                                                                                                                                                                                                                                keySeparator?: false | string;
                                                                                                                                                                                                                                • Override char to separate keys

                                                                                                                                                                                                                                property lng

                                                                                                                                                                                                                                lng?: string;
                                                                                                                                                                                                                                • Override language to use

                                                                                                                                                                                                                                property lngs

                                                                                                                                                                                                                                lngs?: readonly string[];
                                                                                                                                                                                                                                • Override languages to use

                                                                                                                                                                                                                                property ns

                                                                                                                                                                                                                                ns?: Namespace;
                                                                                                                                                                                                                                • Override namespaces (string or array)

                                                                                                                                                                                                                                property nsSeparator

                                                                                                                                                                                                                                nsSeparator?: false | string;
                                                                                                                                                                                                                                • Override char to split namespace from key

                                                                                                                                                                                                                                property ordinal

                                                                                                                                                                                                                                ordinal?: boolean;
                                                                                                                                                                                                                                • Ordinal flag for ordinal plurals

                                                                                                                                                                                                                                property postProcess

                                                                                                                                                                                                                                postProcess?: string | readonly string[];
                                                                                                                                                                                                                                • String or array of postProcessors to apply see interval plurals as a sample

                                                                                                                                                                                                                                property replace

                                                                                                                                                                                                                                replace?: any;
                                                                                                                                                                                                                                • Object with vars for interpolation - or put them directly in options

                                                                                                                                                                                                                                property returnDetails

                                                                                                                                                                                                                                returnDetails?: boolean;
                                                                                                                                                                                                                                • Returns an object that includes information about the used language, namespace, key and value

                                                                                                                                                                                                                                property returnObjects

                                                                                                                                                                                                                                returnObjects?: boolean;
                                                                                                                                                                                                                                • Accessing an object not a translation string (can be set globally too)

                                                                                                                                                                                                                                interface WithT

                                                                                                                                                                                                                                interface WithT<Ns extends Namespace = DefaultNamespace> {}

                                                                                                                                                                                                                                  property t

                                                                                                                                                                                                                                  t: TFunction<Ns>;

                                                                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                                                                    type $FirstNamespace

                                                                                                                                                                                                                                    type $FirstNamespace<Ns extends Namespace> = Ns extends readonly any[] ? Ns[0] : Ns;

                                                                                                                                                                                                                                      type $IsResourcesDefined

                                                                                                                                                                                                                                      type $IsResourcesDefined = [keyof _Resources] extends [never] ? false : true;

                                                                                                                                                                                                                                        type $ValueIfResourcesDefined

                                                                                                                                                                                                                                        type $ValueIfResourcesDefined<Value, Fallback> = $IsResourcesDefined extends true
                                                                                                                                                                                                                                        ? Value
                                                                                                                                                                                                                                        : Fallback;

                                                                                                                                                                                                                                          type AppendKeyPrefix

                                                                                                                                                                                                                                          type AppendKeyPrefix<Key, KPrefix> = KPrefix extends string
                                                                                                                                                                                                                                          ? `${KPrefix}${_KeySeparator}${Key & string}`
                                                                                                                                                                                                                                          : Key;

                                                                                                                                                                                                                                            type AppendNamespace

                                                                                                                                                                                                                                            type AppendNamespace<Ns, Keys> = `${Ns & string}${_NsSeparator}${Keys & string}`;

                                                                                                                                                                                                                                              type ApplyKeyPrefix

                                                                                                                                                                                                                                              type ApplyKeyPrefix<
                                                                                                                                                                                                                                              T extends [any],
                                                                                                                                                                                                                                              KPrefix
                                                                                                                                                                                                                                              > = KPrefix extends `${infer Head}${_KeySeparator}${infer Tail}`
                                                                                                                                                                                                                                              ? ApplyKeyPrefix<[T[0][Head]], Tail>
                                                                                                                                                                                                                                              : T[0][KPrefix & string];

                                                                                                                                                                                                                                                type ApplyTarget

                                                                                                                                                                                                                                                type ApplyTarget<
                                                                                                                                                                                                                                                Target,
                                                                                                                                                                                                                                                Opts extends { returnObjects?: unknown }
                                                                                                                                                                                                                                                > = Opts['returnObjects'] extends true ? unknown : Target;

                                                                                                                                                                                                                                                  type Callback

                                                                                                                                                                                                                                                  type Callback = (error: any, t: TFunction) => void;

                                                                                                                                                                                                                                                    type CallbackError

                                                                                                                                                                                                                                                    type CallbackError = Error | string | null | undefined;

                                                                                                                                                                                                                                                      type ConstrainTarget

                                                                                                                                                                                                                                                      type ConstrainTarget<Opts extends SelectorOptions<any>> = _ReturnObjects extends true
                                                                                                                                                                                                                                                      ? unknown
                                                                                                                                                                                                                                                      : Opts['returnObjects'] extends true
                                                                                                                                                                                                                                                      ? unknown
                                                                                                                                                                                                                                                      : $IsResourcesDefined extends false
                                                                                                                                                                                                                                                      ? unknown
                                                                                                                                                                                                                                                      : string;

                                                                                                                                                                                                                                                        type DefaultNamespace

                                                                                                                                                                                                                                                        type DefaultNamespace = TypeOptions['defaultNS'];

                                                                                                                                                                                                                                                          type DefaultTReturn

                                                                                                                                                                                                                                                          type DefaultTReturn<TOpt extends { returnObjects?: unknown }> =
                                                                                                                                                                                                                                                          | TReturnOptionalObjects<TOpt>
                                                                                                                                                                                                                                                          | TReturnOptionalNull;

                                                                                                                                                                                                                                                            type EffectiveKPrefix

                                                                                                                                                                                                                                                            type EffectiveKPrefix<KPrefix, TOpt> = TOpt extends {
                                                                                                                                                                                                                                                            keyPrefix: infer OptKP extends string;
                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                            ? OptKP
                                                                                                                                                                                                                                                            : KPrefix;
                                                                                                                                                                                                                                                            • Resolves the effective key prefix by preferring a per-call keyPrefix from options over the interface-level KPrefix (set via getFixedT's 3rd argument).

                                                                                                                                                                                                                                                            type FallbackLng

                                                                                                                                                                                                                                                            type FallbackLng =
                                                                                                                                                                                                                                                            | string
                                                                                                                                                                                                                                                            | readonly string[]
                                                                                                                                                                                                                                                            | FallbackLngObjList
                                                                                                                                                                                                                                                            | ((code: string) => string | readonly string[] | FallbackLngObjList);

                                                                                                                                                                                                                                                              type FallbackResourcesOf

                                                                                                                                                                                                                                                              type FallbackResourcesOf<FallbackNS, R> = FallbackNS extends readonly (infer FN)[]
                                                                                                                                                                                                                                                              ? R[FN & keyof R]
                                                                                                                                                                                                                                                              : [FallbackNS] extends [false]
                                                                                                                                                                                                                                                              ? never
                                                                                                                                                                                                                                                              : R[Extract<FallbackNS, keyof R> & keyof R];

                                                                                                                                                                                                                                                                type FilterKeys

                                                                                                                                                                                                                                                                type FilterKeys<T, Context> = never | T extends readonly any[]
                                                                                                                                                                                                                                                                ? { [I in keyof T]: FilterKeys<T[I], Context> }
                                                                                                                                                                                                                                                                : $Prune<
                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                [K in keyof T as T[K] extends object
                                                                                                                                                                                                                                                                ? K
                                                                                                                                                                                                                                                                : Context extends string
                                                                                                                                                                                                                                                                ? never
                                                                                                                                                                                                                                                                : K extends `${string}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                ? never
                                                                                                                                                                                                                                                                : K]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
                                                                                                                                                                                                                                                                } & {
                                                                                                                                                                                                                                                                [K in keyof T as T[K] extends object
                                                                                                                                                                                                                                                                ? never
                                                                                                                                                                                                                                                                : Context extends string
                                                                                                                                                                                                                                                                ? never
                                                                                                                                                                                                                                                                : K extends
                                                                                                                                                                                                                                                                | `${infer Prefix}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                | `${infer Prefix}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                ? Prefix
                                                                                                                                                                                                                                                                : never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
                                                                                                                                                                                                                                                                } & {
                                                                                                                                                                                                                                                                [K in keyof T as T[K] extends object
                                                                                                                                                                                                                                                                ? never
                                                                                                                                                                                                                                                                : Context extends string
                                                                                                                                                                                                                                                                ? K extends
                                                                                                                                                                                                                                                                | `${infer Prefix}${_ContextSeparator}${Context}`
                                                                                                                                                                                                                                                                | `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                ? Prefix
                                                                                                                                                                                                                                                                : never
                                                                                                                                                                                                                                                                : never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                >;

                                                                                                                                                                                                                                                                  type FilterKeysByContext

                                                                                                                                                                                                                                                                  type FilterKeysByContext<Keys, Context> = Context extends string
                                                                                                                                                                                                                                                                  ? Keys extends
                                                                                                                                                                                                                                                                  | `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                  | `${infer Prefix}${_ContextSeparator}${Context}`
                                                                                                                                                                                                                                                                  ? Prefix
                                                                                                                                                                                                                                                                  : never
                                                                                                                                                                                                                                                                  : Keys;

                                                                                                                                                                                                                                                                    type FlatNamespace

                                                                                                                                                                                                                                                                    type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;

                                                                                                                                                                                                                                                                      type FormatFunction

                                                                                                                                                                                                                                                                      type FormatFunction = (
                                                                                                                                                                                                                                                                      value: any,
                                                                                                                                                                                                                                                                      format?: string,
                                                                                                                                                                                                                                                                      lng?: string,
                                                                                                                                                                                                                                                                      options?: InterpolationOptions & $Dictionary<any>
                                                                                                                                                                                                                                                                      ) => string;

                                                                                                                                                                                                                                                                        type GetSource

                                                                                                                                                                                                                                                                        type GetSource<
                                                                                                                                                                                                                                                                        Ns extends Namespace,
                                                                                                                                                                                                                                                                        KPrefix,
                                                                                                                                                                                                                                                                        Res = Ns extends readonly [keyof Resources, any, ...any]
                                                                                                                                                                                                                                                                        ? Resources[Ns[0]] & PickNamespaces<Resources, Ns[number]>
                                                                                                                                                                                                                                                                        : Resources[$FirstNamespace<Ns>]
                                                                                                                                                                                                                                                                        > = KPrefix extends keyof Res
                                                                                                                                                                                                                                                                        ? Res[KPrefix]
                                                                                                                                                                                                                                                                        : undefined extends KPrefix
                                                                                                                                                                                                                                                                        ? Res
                                                                                                                                                                                                                                                                        : ApplyKeyPrefix<[Res], KPrefix>;

                                                                                                                                                                                                                                                                          type InterpolationMap

                                                                                                                                                                                                                                                                          type InterpolationMap<Ret> = $PreservedValue<
                                                                                                                                                                                                                                                                          $StringKeyPathToRecord<ParseInterpolationValues<Ret>, unknown>,
                                                                                                                                                                                                                                                                          Record<string, unknown>
                                                                                                                                                                                                                                                                          >;

                                                                                                                                                                                                                                                                            type JoinKeys

                                                                                                                                                                                                                                                                            type JoinKeys<K1, K2> = `${K1 & string}${_KeySeparator}${K2 & string}`;

                                                                                                                                                                                                                                                                              type KeyPrefix

                                                                                                                                                                                                                                                                              type KeyPrefix<Ns extends Namespace> =
                                                                                                                                                                                                                                                                              | ResourceKeys<true>[$FirstNamespace<Ns>]
                                                                                                                                                                                                                                                                              | undefined;

                                                                                                                                                                                                                                                                                type KeysBuilder

                                                                                                                                                                                                                                                                                type KeysBuilder<Res, WithReturnObjects> = $IsResourcesDefined extends true
                                                                                                                                                                                                                                                                                ? WithReturnObjects extends true
                                                                                                                                                                                                                                                                                ? keyof Res | KeysBuilderWithReturnObjects<Res>
                                                                                                                                                                                                                                                                                : KeysBuilderWithoutReturnObjects<Res>
                                                                                                                                                                                                                                                                                : string;

                                                                                                                                                                                                                                                                                  type KeysBuilderWithoutReturnObjects

                                                                                                                                                                                                                                                                                  type KeysBuilderWithoutReturnObjects<
                                                                                                                                                                                                                                                                                  Res,
                                                                                                                                                                                                                                                                                  Key = keyof $OmitArrayKeys<Res>
                                                                                                                                                                                                                                                                                  > = Key extends keyof Res
                                                                                                                                                                                                                                                                                  ? Res[Key] extends $Dictionary | readonly unknown[]
                                                                                                                                                                                                                                                                                  ? JoinKeys<Key, KeysBuilderWithoutReturnObjects<Res[Key]>>
                                                                                                                                                                                                                                                                                  : Key
                                                                                                                                                                                                                                                                                  : never;

                                                                                                                                                                                                                                                                                    type KeysBuilderWithReturnObjects

                                                                                                                                                                                                                                                                                    type KeysBuilderWithReturnObjects<Res, Key = keyof Res> = Key extends keyof Res
                                                                                                                                                                                                                                                                                    ? Res[Key] extends $Dictionary | readonly unknown[]
                                                                                                                                                                                                                                                                                    ?
                                                                                                                                                                                                                                                                                    | JoinKeys<Key, WithOrWithoutPlural<keyof $OmitArrayKeys<Res[Key]>>>
                                                                                                                                                                                                                                                                                    | JoinKeys<Key, KeysBuilderWithReturnObjects<Res[Key]>>
                                                                                                                                                                                                                                                                                    : never
                                                                                                                                                                                                                                                                                    : never;
                                                                                                                                                                                                                                                                                    • **************************************************** Build all keys and key prefixes based on Resources * ****************************************************

                                                                                                                                                                                                                                                                                    type KeysByTOptions

                                                                                                                                                                                                                                                                                    type KeysByTOptions<TOpt extends TOptions> = TOpt['returnObjects'] extends true
                                                                                                                                                                                                                                                                                    ? ResourceKeys<true>
                                                                                                                                                                                                                                                                                    : ResourceKeys;
                                                                                                                                                                                                                                                                                    • ********************************************************************** Parse t function keys based on the namespace, options and key prefix * **********************************************************************

                                                                                                                                                                                                                                                                                    type KeysWithoutReturnObjects

                                                                                                                                                                                                                                                                                    type KeysWithoutReturnObjects = {
                                                                                                                                                                                                                                                                                    [Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], false>>;
                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                      type KeysWithReturnObjects

                                                                                                                                                                                                                                                                                      type KeysWithReturnObjects = {
                                                                                                                                                                                                                                                                                      [Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], true>>;
                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                        type KeyWithContext

                                                                                                                                                                                                                                                                                        type KeyWithContext<Key, TOpt extends TOptions> = TOpt['context'] extends string
                                                                                                                                                                                                                                                                                        ? `${Key & string}${_ContextSeparator}${TOpt['context']}`
                                                                                                                                                                                                                                                                                        : Key;

                                                                                                                                                                                                                                                                                          type ModuleType

                                                                                                                                                                                                                                                                                          type ModuleType =
                                                                                                                                                                                                                                                                                          | 'backend'
                                                                                                                                                                                                                                                                                          | 'logger'
                                                                                                                                                                                                                                                                                          | 'languageDetector'
                                                                                                                                                                                                                                                                                          | 'postProcessor'
                                                                                                                                                                                                                                                                                          | 'i18nFormat'
                                                                                                                                                                                                                                                                                          | 'formatter'
                                                                                                                                                                                                                                                                                          | '3rdParty';

                                                                                                                                                                                                                                                                                            type MultiReadCallback

                                                                                                                                                                                                                                                                                            type MultiReadCallback = (
                                                                                                                                                                                                                                                                                            err: CallbackError,
                                                                                                                                                                                                                                                                                            data: Resource | null | undefined
                                                                                                                                                                                                                                                                                            ) => void;

                                                                                                                                                                                                                                                                                              type Namespace

                                                                                                                                                                                                                                                                                              type Namespace<T = FlatNamespace> = T | readonly T[];

                                                                                                                                                                                                                                                                                                type NsArg

                                                                                                                                                                                                                                                                                                type NsArg<Ns extends Namespace> = Ns[number] | readonly Ns[number][];

                                                                                                                                                                                                                                                                                                  type NsByTOptions

                                                                                                                                                                                                                                                                                                  type NsByTOptions<
                                                                                                                                                                                                                                                                                                  Ns extends Namespace,
                                                                                                                                                                                                                                                                                                  TOpt extends TOptions
                                                                                                                                                                                                                                                                                                  > = TOpt['ns'] extends Namespace ? TOpt['ns'] : Ns;

                                                                                                                                                                                                                                                                                                    type ParseActualValue

                                                                                                                                                                                                                                                                                                    type ParseActualValue<Ret> =
                                                                                                                                                                                                                                                                                                    Ret extends `${_UnescapePrefix}${infer ActualValue}${_UnescapeSuffix}`
                                                                                                                                                                                                                                                                                                    ? TrimSpaces<ActualValue>
                                                                                                                                                                                                                                                                                                    : Ret;
                                                                                                                                                                                                                                                                                                    • ******************************************************* Parse t function return type and interpolation values * *******************************************************

                                                                                                                                                                                                                                                                                                    type ParseInterpolationValues

                                                                                                                                                                                                                                                                                                    type ParseInterpolationValues<Ret> =
                                                                                                                                                                                                                                                                                                    Ret extends `${string}${_InterpolationPrefix}${infer Value}${_InterpolationSuffix}${infer Rest}`
                                                                                                                                                                                                                                                                                                    ?
                                                                                                                                                                                                                                                                                                    | (Value extends `${infer ActualValue},${string}`
                                                                                                                                                                                                                                                                                                    ? ParseActualValue<ActualValue>
                                                                                                                                                                                                                                                                                                    : ParseActualValue<Value>)
                                                                                                                                                                                                                                                                                                    | ParseInterpolationValues<Rest>
                                                                                                                                                                                                                                                                                                    : never;

                                                                                                                                                                                                                                                                                                      type ParseKeys

                                                                                                                                                                                                                                                                                                      type ParseKeys<
                                                                                                                                                                                                                                                                                                      Ns extends Namespace = DefaultNamespace,
                                                                                                                                                                                                                                                                                                      TOpt extends TOptions = {},
                                                                                                                                                                                                                                                                                                      KPrefix = undefined,
                                                                                                                                                                                                                                                                                                      Keys extends $Dictionary = KeysByTOptions<TOpt>,
                                                                                                                                                                                                                                                                                                      ActualNS extends Namespace = NsByTOptions<Ns, TOpt>,
                                                                                                                                                                                                                                                                                                      Context extends TOpt['context'] = TOpt['context']
                                                                                                                                                                                                                                                                                                      > = $IsResourcesDefined extends true
                                                                                                                                                                                                                                                                                                      ? FilterKeysByContext<
                                                                                                                                                                                                                                                                                                      | ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
                                                                                                                                                                                                                                                                                                      | ParseKeysByNamespaces<ActualNS, Keys>
                                                                                                                                                                                                                                                                                                      | ParseKeysByFallbackNs<Keys>,
                                                                                                                                                                                                                                                                                                      Context
                                                                                                                                                                                                                                                                                                      >
                                                                                                                                                                                                                                                                                                      : string;

                                                                                                                                                                                                                                                                                                        type ParseKeysByFallbackNs

                                                                                                                                                                                                                                                                                                        type ParseKeysByFallbackNs<Keys extends $Dictionary> =
                                                                                                                                                                                                                                                                                                        _FallbackNamespace extends false
                                                                                                                                                                                                                                                                                                        ? never
                                                                                                                                                                                                                                                                                                        : _FallbackNamespace extends (infer UnionFallbackNs extends string)[]
                                                                                                                                                                                                                                                                                                        ? Keys[UnionFallbackNs]
                                                                                                                                                                                                                                                                                                        : Keys[_FallbackNamespace & string];

                                                                                                                                                                                                                                                                                                          type ParseKeysByKeyPrefix

                                                                                                                                                                                                                                                                                                          type ParseKeysByKeyPrefix<Keys, KPrefix> = KPrefix extends string
                                                                                                                                                                                                                                                                                                          ? Keys extends `${KPrefix}${_KeySeparator}${infer Key}`
                                                                                                                                                                                                                                                                                                          ? Key
                                                                                                                                                                                                                                                                                                          : never
                                                                                                                                                                                                                                                                                                          : Keys;

                                                                                                                                                                                                                                                                                                            type ParseKeysByNamespaces

                                                                                                                                                                                                                                                                                                            type ParseKeysByNamespaces<
                                                                                                                                                                                                                                                                                                            Ns extends Namespace,
                                                                                                                                                                                                                                                                                                            Keys
                                                                                                                                                                                                                                                                                                            > = Ns extends readonly (infer UnionNsps)[]
                                                                                                                                                                                                                                                                                                            ? UnionNsps extends keyof Keys
                                                                                                                                                                                                                                                                                                            ? AppendNamespace<UnionNsps, Keys[UnionNsps]>
                                                                                                                                                                                                                                                                                                            : never
                                                                                                                                                                                                                                                                                                            : never;

                                                                                                                                                                                                                                                                                                              type ParseTReturn

                                                                                                                                                                                                                                                                                                              type ParseTReturn<Key, Res, TOpt extends TOptions = {}> = ParseTReturnWithFallback<
                                                                                                                                                                                                                                                                                                              Key,
                                                                                                                                                                                                                                                                                                              Key extends `${infer K1}${_KeySeparator}${infer RestKey}`
                                                                                                                                                                                                                                                                                                              ? ParseTReturn<RestKey, Res[K1 & keyof Res], TOpt>
                                                                                                                                                                                                                                                                                                              : // Process plurals only if count is provided inside options
                                                                                                                                                                                                                                                                                                              TOpt['count'] extends number
                                                                                                                                                                                                                                                                                                              ? TOpt['ordinal'] extends boolean
                                                                                                                                                                                                                                                                                                              ? ParseTReturnPluralOrdinal<Res, Key>
                                                                                                                                                                                                                                                                                                              : ParseTReturnPlural<Res, Key>
                                                                                                                                                                                                                                                                                                              : // otherwise access plain key without adding plural and ordinal suffixes
                                                                                                                                                                                                                                                                                                              Res extends readonly unknown[]
                                                                                                                                                                                                                                                                                                              ? Key extends `${infer NKey extends number}`
                                                                                                                                                                                                                                                                                                              ? Res[NKey]
                                                                                                                                                                                                                                                                                                              : never
                                                                                                                                                                                                                                                                                                              : Res[Key & keyof Res]
                                                                                                                                                                                                                                                                                                              >;

                                                                                                                                                                                                                                                                                                                type ParseTReturnPlural

                                                                                                                                                                                                                                                                                                                type ParseTReturnPlural<
                                                                                                                                                                                                                                                                                                                Res,
                                                                                                                                                                                                                                                                                                                Key,
                                                                                                                                                                                                                                                                                                                KeyWithPlural = `${Key & string}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                                                                > = Res[(KeyWithPlural | Key) & keyof Res];

                                                                                                                                                                                                                                                                                                                  type ParseTReturnPluralOrdinal

                                                                                                                                                                                                                                                                                                                  type ParseTReturnPluralOrdinal<
                                                                                                                                                                                                                                                                                                                  Res,
                                                                                                                                                                                                                                                                                                                  Key,
                                                                                                                                                                                                                                                                                                                  KeyWithOrdinalPlural = `${Key &
                                                                                                                                                                                                                                                                                                                  string}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                                                                  > = Res[(KeyWithOrdinalPlural | Key) & keyof Res];

                                                                                                                                                                                                                                                                                                                    type ParseTReturnWithFallback

                                                                                                                                                                                                                                                                                                                    type ParseTReturnWithFallback<Key, Val> = Val extends ''
                                                                                                                                                                                                                                                                                                                    ? _ReturnEmptyString extends true
                                                                                                                                                                                                                                                                                                                    ? ''
                                                                                                                                                                                                                                                                                                                    : Key
                                                                                                                                                                                                                                                                                                                    : Val extends null
                                                                                                                                                                                                                                                                                                                    ? _ReturnNull extends true
                                                                                                                                                                                                                                                                                                                    ? null
                                                                                                                                                                                                                                                                                                                    : Key
                                                                                                                                                                                                                                                                                                                    : Val;

                                                                                                                                                                                                                                                                                                                      type PickNamespaces

                                                                                                                                                                                                                                                                                                                      type PickNamespaces<T, K extends keyof any> = {
                                                                                                                                                                                                                                                                                                                      [P in K as P extends keyof T ? P : never]: T[P & keyof T];
                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                        type PluginOptions

                                                                                                                                                                                                                                                                                                                        type PluginOptions<T> = $MergeBy<
                                                                                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                                                                        * Options for language detection - check documentation of plugin
                                                                                                                                                                                                                                                                                                                        * @default undefined
                                                                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                                                                        detection?: object;
                                                                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                                                                        * Options for backend - check documentation of plugin
                                                                                                                                                                                                                                                                                                                        * @default undefined
                                                                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                                                                        backend?: T;
                                                                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                                                                        * Options for cache layer - check documentation of plugin
                                                                                                                                                                                                                                                                                                                        * @default undefined
                                                                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                                                                        cache?: object;
                                                                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                                                                        * Options for i18n message format - check documentation of plugin
                                                                                                                                                                                                                                                                                                                        * @default undefined
                                                                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                                                                        i18nFormat?: object;
                                                                                                                                                                                                                                                                                                                        },
                                                                                                                                                                                                                                                                                                                        CustomPluginOptions
                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                          type PluralSuffix

                                                                                                                                                                                                                                                                                                                          type PluralSuffix = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';

                                                                                                                                                                                                                                                                                                                            type ProcessReturnValue

                                                                                                                                                                                                                                                                                                                            type ProcessReturnValue<Target, DefaultValue> = $Turtles extends Target
                                                                                                                                                                                                                                                                                                                            ? string
                                                                                                                                                                                                                                                                                                                            : [DefaultValue] extends [never]
                                                                                                                                                                                                                                                                                                                            ? Target
                                                                                                                                                                                                                                                                                                                            : unknown extends DefaultValue
                                                                                                                                                                                                                                                                                                                            ? Target
                                                                                                                                                                                                                                                                                                                            : Target | DefaultValue;

                                                                                                                                                                                                                                                                                                                              type ReadCallback

                                                                                                                                                                                                                                                                                                                              type ReadCallback = (
                                                                                                                                                                                                                                                                                                                              err: CallbackError,
                                                                                                                                                                                                                                                                                                                              data: ResourceKey | boolean | null | undefined
                                                                                                                                                                                                                                                                                                                              ) => void;

                                                                                                                                                                                                                                                                                                                                type ResourceKey

                                                                                                                                                                                                                                                                                                                                type ResourceKey =
                                                                                                                                                                                                                                                                                                                                | string
                                                                                                                                                                                                                                                                                                                                | {
                                                                                                                                                                                                                                                                                                                                [key: string]: any;
                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                  type ResourceKeys

                                                                                                                                                                                                                                                                                                                                  type ResourceKeys<WithReturnObjects = _ReturnObjects> =
                                                                                                                                                                                                                                                                                                                                  WithReturnObjects extends true
                                                                                                                                                                                                                                                                                                                                  ? KeysWithReturnObjects
                                                                                                                                                                                                                                                                                                                                  : KeysWithoutReturnObjects;

                                                                                                                                                                                                                                                                                                                                    type Resources

                                                                                                                                                                                                                                                                                                                                    type Resources = $ValueIfResourcesDefined<_Resources, $Dictionary<string>>;

                                                                                                                                                                                                                                                                                                                                      type Select

                                                                                                                                                                                                                                                                                                                                      type Select<T, Context> = $IsResourcesDefined extends false
                                                                                                                                                                                                                                                                                                                                      ? $Turtles
                                                                                                                                                                                                                                                                                                                                      : [_EnableSelector] extends ['optimize']
                                                                                                                                                                                                                                                                                                                                      ? T
                                                                                                                                                                                                                                                                                                                                      : FilterKeys<T, Context>;

                                                                                                                                                                                                                                                                                                                                        type SelectorReturn

                                                                                                                                                                                                                                                                                                                                        type SelectorReturn<
                                                                                                                                                                                                                                                                                                                                        Target,
                                                                                                                                                                                                                                                                                                                                        Opts extends { defaultValue?: unknown; returnObjects?: boolean }
                                                                                                                                                                                                                                                                                                                                        > = $IsResourcesDefined extends true
                                                                                                                                                                                                                                                                                                                                        ? TFunctionReturnOptionalDetails<
                                                                                                                                                                                                                                                                                                                                        ProcessReturnValue<Target, Opts['defaultValue']>,
                                                                                                                                                                                                                                                                                                                                        Opts
                                                                                                                                                                                                                                                                                                                                        >
                                                                                                                                                                                                                                                                                                                                        : DefaultTReturn<Opts>;

                                                                                                                                                                                                                                                                                                                                          type TFunctionDetailedResult

                                                                                                                                                                                                                                                                                                                                          type TFunctionDetailedResult<T = string, TOpt extends TOptions = {}> = {
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The plain used key
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          usedKey: string;
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The translation result.
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          res: T;
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The key with context / plural
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          exactUsedKey: string;
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The used language for this translation.
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          usedLng: string;
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The used namespace for this translation.
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          usedNS: string;
                                                                                                                                                                                                                                                                                                                                          /**
                                                                                                                                                                                                                                                                                                                                          * The parameters used for interpolation.
                                                                                                                                                                                                                                                                                                                                          */
                                                                                                                                                                                                                                                                                                                                          usedParams: InterpolationMap<T> & { count?: TOpt['count'] };
                                                                                                                                                                                                                                                                                                                                          };

                                                                                                                                                                                                                                                                                                                                            type TFunctionProcessReturnValue

                                                                                                                                                                                                                                                                                                                                            type TFunctionProcessReturnValue<Ret, DefaultValue> = Ret extends
                                                                                                                                                                                                                                                                                                                                            | string
                                                                                                                                                                                                                                                                                                                                            | $SpecialObject
                                                                                                                                                                                                                                                                                                                                            | null
                                                                                                                                                                                                                                                                                                                                            ? Ret
                                                                                                                                                                                                                                                                                                                                            : [DefaultValue] extends [never]
                                                                                                                                                                                                                                                                                                                                            ? Ret
                                                                                                                                                                                                                                                                                                                                            : DefaultValue;

                                                                                                                                                                                                                                                                                                                                              type TFunctionReturn

                                                                                                                                                                                                                                                                                                                                              type TFunctionReturn<
                                                                                                                                                                                                                                                                                                                                              Ns extends Namespace,
                                                                                                                                                                                                                                                                                                                                              Key,
                                                                                                                                                                                                                                                                                                                                              TOpt extends TOptions,
                                                                                                                                                                                                                                                                                                                                              ActualNS extends Namespace = NsByTOptions<Ns, TOpt>,
                                                                                                                                                                                                                                                                                                                                              ActualKey = KeyWithContext<Key, TOpt>
                                                                                                                                                                                                                                                                                                                                              > = $IsResourcesDefined extends true
                                                                                                                                                                                                                                                                                                                                              ? ActualKey extends `${infer Nsp}${_NsSeparator}${infer RestKey}`
                                                                                                                                                                                                                                                                                                                                              ? ParseTReturn<RestKey, Resources[Nsp & keyof Resources], TOpt>
                                                                                                                                                                                                                                                                                                                                              : $FirstNamespace<ActualNS> extends infer PrimaryNS
                                                                                                                                                                                                                                                                                                                                              ? [PrimaryNS] extends [keyof Resources]
                                                                                                                                                                                                                                                                                                                                              ? [_PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt>] extends [
                                                                                                                                                                                                                                                                                                                                              never
                                                                                                                                                                                                                                                                                                                                              ]
                                                                                                                                                                                                                                                                                                                                              ? [_FallbackParse<ActualKey, _FallbackNamespace, TOpt>] extends [
                                                                                                                                                                                                                                                                                                                                              never
                                                                                                                                                                                                                                                                                                                                              ]
                                                                                                                                                                                                                                                                                                                                              ? DefaultTReturn<TOpt>
                                                                                                                                                                                                                                                                                                                                              : _FallbackParse<ActualKey, _FallbackNamespace, TOpt>
                                                                                                                                                                                                                                                                                                                                              : _PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt>
                                                                                                                                                                                                                                                                                                                                              : never
                                                                                                                                                                                                                                                                                                                                              : never
                                                                                                                                                                                                                                                                                                                                              : DefaultTReturn<TOpt>;

                                                                                                                                                                                                                                                                                                                                                type TFunctionReturnOptionalDetails

                                                                                                                                                                                                                                                                                                                                                type TFunctionReturnOptionalDetails<
                                                                                                                                                                                                                                                                                                                                                Ret,
                                                                                                                                                                                                                                                                                                                                                TOpt extends TOptions
                                                                                                                                                                                                                                                                                                                                                > = TOpt['returnDetails'] extends true ? TFunctionDetailedResult<Ret, TOpt> : Ret;

                                                                                                                                                                                                                                                                                                                                                  type TFunctionSignature

                                                                                                                                                                                                                                                                                                                                                  type TFunctionSignature<
                                                                                                                                                                                                                                                                                                                                                  Ns extends Namespace = DefaultNamespace,
                                                                                                                                                                                                                                                                                                                                                  KPrefix = undefined
                                                                                                                                                                                                                                                                                                                                                  > = _EnableSelector extends true | 'optimize'
                                                                                                                                                                                                                                                                                                                                                  ? TFunctionSelector<Ns, KPrefix, GetSource<Ns, KPrefix>>
                                                                                                                                                                                                                                                                                                                                                  : _StrictKeyChecks extends true
                                                                                                                                                                                                                                                                                                                                                  ? TFunctionStrict<Ns, KPrefix>
                                                                                                                                                                                                                                                                                                                                                  : TFunctionNonStrict<Ns, KPrefix>;

                                                                                                                                                                                                                                                                                                                                                    type TOptions

                                                                                                                                                                                                                                                                                                                                                    type TOptions<TInterpolationMap extends object = $Dictionary> = TOptionsBase &
                                                                                                                                                                                                                                                                                                                                                    TInterpolationMap;

                                                                                                                                                                                                                                                                                                                                                      type TReturnOptionalNull

                                                                                                                                                                                                                                                                                                                                                      type TReturnOptionalNull = _ReturnNull extends true ? null : never;

                                                                                                                                                                                                                                                                                                                                                        type TReturnOptionalObjects

                                                                                                                                                                                                                                                                                                                                                        type TReturnOptionalObjects<TOpt extends { returnObjects?: unknown }> =
                                                                                                                                                                                                                                                                                                                                                        _ReturnObjects extends true
                                                                                                                                                                                                                                                                                                                                                        ? $SpecialObject | string
                                                                                                                                                                                                                                                                                                                                                        : TOpt['returnObjects'] extends true
                                                                                                                                                                                                                                                                                                                                                        ? $SpecialObject
                                                                                                                                                                                                                                                                                                                                                        : string;

                                                                                                                                                                                                                                                                                                                                                          type TrimSpaces

                                                                                                                                                                                                                                                                                                                                                          type TrimSpaces<
                                                                                                                                                                                                                                                                                                                                                          T extends string,
                                                                                                                                                                                                                                                                                                                                                          Acc extends string = ''
                                                                                                                                                                                                                                                                                                                                                          > = T extends `${infer Char}${infer Rest}`
                                                                                                                                                                                                                                                                                                                                                          ? Char extends ' '
                                                                                                                                                                                                                                                                                                                                                          ? TrimSpaces<Rest, Acc>
                                                                                                                                                                                                                                                                                                                                                          : TrimSpaces<Rest, `${Acc}${Char}`>
                                                                                                                                                                                                                                                                                                                                                          : T extends ''
                                                                                                                                                                                                                                                                                                                                                          ? Acc
                                                                                                                                                                                                                                                                                                                                                          : never;

                                                                                                                                                                                                                                                                                                                                                            type TypeOptions

                                                                                                                                                                                                                                                                                                                                                            type TypeOptions = $MergeBy<
                                                                                                                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.returnNull} */
                                                                                                                                                                                                                                                                                                                                                            returnNull: false;
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.returnEmptyString} */
                                                                                                                                                                                                                                                                                                                                                            returnEmptyString: true;
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.returnObjects} */
                                                                                                                                                                                                                                                                                                                                                            returnObjects: false;
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.keySeparator} */
                                                                                                                                                                                                                                                                                                                                                            keySeparator: '.';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.nsSeparator} */
                                                                                                                                                                                                                                                                                                                                                            nsSeparator: ':';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.pluralSeparator} */
                                                                                                                                                                                                                                                                                                                                                            pluralSeparator: '_';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.contextSeparator} */
                                                                                                                                                                                                                                                                                                                                                            contextSeparator: '_';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.defaultNS} */
                                                                                                                                                                                                                                                                                                                                                            defaultNS: 'translation';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.fallbackNS} */
                                                                                                                                                                                                                                                                                                                                                            fallbackNS: false;
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.compatibilityJSON} */
                                                                                                                                                                                                                                                                                                                                                            compatibilityJSON: 'v4';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InitOptions.resources} */
                                                                                                                                                                                                                                                                                                                                                            resources: object;
                                                                                                                                                                                                                                                                                                                                                            /**
                                                                                                                                                                                                                                                                                                                                                            * Flag that allows HTML elements to receive objects. This is only useful for React applications
                                                                                                                                                                                                                                                                                                                                                            * where you pass objects to HTML elements so they can be replaced to their respective interpolation
                                                                                                                                                                                                                                                                                                                                                            * values (mostly with Trans component)
                                                                                                                                                                                                                                                                                                                                                            */
                                                                                                                                                                                                                                                                                                                                                            allowObjectInHTMLChildren: false;
                                                                                                                                                                                                                                                                                                                                                            /**
                                                                                                                                                                                                                                                                                                                                                            * Flag that enables strict key checking even if a `defaultValue` has been provided.
                                                                                                                                                                                                                                                                                                                                                            * This ensures all calls of `t` function don't accidentally use implicitly missing keys.
                                                                                                                                                                                                                                                                                                                                                            */
                                                                                                                                                                                                                                                                                                                                                            strictKeyChecks: false;
                                                                                                                                                                                                                                                                                                                                                            /**
                                                                                                                                                                                                                                                                                                                                                            * Prefix for interpolation
                                                                                                                                                                                                                                                                                                                                                            */
                                                                                                                                                                                                                                                                                                                                                            interpolationPrefix: '{{';
                                                                                                                                                                                                                                                                                                                                                            /**
                                                                                                                                                                                                                                                                                                                                                            * Suffix for interpolation
                                                                                                                                                                                                                                                                                                                                                            */
                                                                                                                                                                                                                                                                                                                                                            interpolationSuffix: '}}';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InterpolationOptions.unescapePrefix} */
                                                                                                                                                                                                                                                                                                                                                            unescapePrefix: '-';
                                                                                                                                                                                                                                                                                                                                                            /** @see {InterpolationOptions.unescapeSuffix} */
                                                                                                                                                                                                                                                                                                                                                            unescapeSuffix: '';
                                                                                                                                                                                                                                                                                                                                                            /**
                                                                                                                                                                                                                                                                                                                                                            * Use a proxy-based selector to select a translation.
                                                                                                                                                                                                                                                                                                                                                            *
                                                                                                                                                                                                                                                                                                                                                            * Enables features like go-to definition, and better DX/faster autocompletion
                                                                                                                                                                                                                                                                                                                                                            * for TypeScript developers.
                                                                                                                                                                                                                                                                                                                                                            *
                                                                                                                                                                                                                                                                                                                                                            * If you're working with an especially large set of translations and aren't
                                                                                                                                                                                                                                                                                                                                                            * using context, you set `enableSelector` to `"optimize"` and i18next won't do
                                                                                                                                                                                                                                                                                                                                                            * any type-level processing of your translations at all.
                                                                                                                                                                                                                                                                                                                                                            *
                                                                                                                                                                                                                                                                                                                                                            * With `enableSelector` set to `"optimize"`, i18next is capable of supporting
                                                                                                                                                                                                                                                                                                                                                            * arbitrarily large/deep translation sets without causing any IDE slowdown
                                                                                                                                                                                                                                                                                                                                                            * whatsoever.
                                                                                                                                                                                                                                                                                                                                                            *
                                                                                                                                                                                                                                                                                                                                                            * @default false
                                                                                                                                                                                                                                                                                                                                                            */
                                                                                                                                                                                                                                                                                                                                                            enableSelector: false;
                                                                                                                                                                                                                                                                                                                                                            },
                                                                                                                                                                                                                                                                                                                                                            CustomTypeOptions
                                                                                                                                                                                                                                                                                                                                                            >;

                                                                                                                                                                                                                                                                                                                                                              type WithOrWithoutPlural

                                                                                                                                                                                                                                                                                                                                                              type WithOrWithoutPlural<Key> = _CompatibilityJSON extends 'v4'
                                                                                                                                                                                                                                                                                                                                                              ? Key extends `${infer KeyWithoutOrdinalPlural}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                                                                                                              ? KeyWithoutOrdinalPlural | Key
                                                                                                                                                                                                                                                                                                                                                              : Key extends `${infer KeyWithoutPlural}${_PluralSeparator}${PluralSuffix}`
                                                                                                                                                                                                                                                                                                                                                              ? KeyWithoutPlural | Key
                                                                                                                                                                                                                                                                                                                                                              : Key
                                                                                                                                                                                                                                                                                                                                                              : Key;

                                                                                                                                                                                                                                                                                                                                                                Package Files (3)

                                                                                                                                                                                                                                                                                                                                                                Dependencies (1)

                                                                                                                                                                                                                                                                                                                                                                Dev Dependencies (39)

                                                                                                                                                                                                                                                                                                                                                                Peer Dependencies (1)

                                                                                                                                                                                                                                                                                                                                                                Badge

                                                                                                                                                                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/i18next.

                                                                                                                                                                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/i18next)
                                                                                                                                                                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/i18next"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>