I18n

external class I18n

Represents the i18next instance.

This external class corresponds to the i18next JavaScript library's main object.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The current language code in use.

Functions

Link copied to clipboard
fun changeLanguage(language: String)

Changes the current language.

Link copied to clipboard
fun exists(key: String): Boolean

Checks if a translation key exists.

Link copied to clipboard

Checks if a namespace has been loaded.

Link copied to clipboard
fun I18n.init(configurationBuilder: I18nConfiguration.() -> Unit): Promise<TranslationFunction>

Initializes the i18next instance with a type-safe configuration.

Link copied to clipboard
fun initInternal(configuration: dynamic, callback: (dynamic, dynamic) -> Unit = definedExternally): Promise<TranslationFunction>

Initializes the i18next instance with the given configuration.

Link copied to clipboard
fun t(key: String): String

Translates a given key.

Link copied to clipboard
fun use(module: dynamic): I18n

Uses a plugin or module with the i18next instance.