Exposes interpolation.format function added on init.
Is initialized
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].
Is set to an array of language-codes that will be used it order to lookup the translation value.
List of modules used
Current options
Optional resolvedIs set to the current resolved language. It can be used as primary used language, for example in a language switcher.
Internal container for all used plugins and implementation details like languageUtils, pluralResolvers, etc.
Internal container for translation resources
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.
Optional deep: booleanOptional Optional overwrite: booleanOptional 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.
Optional lng: stringOptional Optional callback: CallbackOptional 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.
Optional options: CloneOptionsOptional Optional callback: CallbackOptional 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).
Optional options: InitOptions<object>Optional Optional callback: CallbackOptional 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.
Rest ...args: [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix] | [lng: null, ns: Ns, keyPrefix?: TKPrefix]Rest Gets one value by given key.
Optional options: Pick<InitOptions<object>, "keySeparator" | "ignoreJSONStructure">Optional Checks if namespace has loaded yet. i.e. used by react-i18next
Optional options: { Optional
Optional lng?: string | readonly string[]Checks if a namespace has been loaded.
Optional options: Pick<InitOptions<object>, "fallbackLng">Optional 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.
Optional callback: Callbackwill be called after all translations were loaded or with an error when failed (in case of using a backend).
Optional Optional callback: CallbackOptional Loads additional languages not defined in init options (preload).
Optional callback: CallbackOptional Loads additional namespaces not defined in init options.
Optional callback: CallbackOptional 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 resources got added or removed.
Gets fired when changeLanguage got called.
Event listener
Rest ...args: any[]Rest 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.
Optional lngs: string | readonly string[]Optional Optional ns: string | readonly string[]Optional Optional callback: (() => void)Optional
Optional callback: (() => void)Optional
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.
Accepts a class or object
Generated using TypeDoc
Uses similar args as the t function and returns true if a key exists.