I18nConfiguration

@Serializable
class I18nConfiguration

Configuration class for i18next initialization.

This class encapsulates all the configuration options available for initializing i18next in a Kotlin/JS environment.

It uses kotlinx-serialization to serialize the configuration into a dynamic object that can be passed to the JavaScript init function.

See also

Properties

Link copied to clipboard

Appends the namespace to the key when in CIMode.

Link copied to clipboard

If true, appends the namespace to missing keys.

Link copied to clipboard
@Transient
var backend: dynamic

Holds the backend configuration. This is a dynamic field and is not serialized to dynamic with kotlinx-serialization.

Link copied to clipboard
@Transient
var cache: dynamic

Holds the cache configuration. This is a dynamic field and is not serialized to dynamic with kotlinx-serialization.

Link copied to clipboard

If true, cleans the language code.

Link copied to clipboard

Separator used for contexts.

Link copied to clipboard

Enables debug mode if set to true.

Link copied to clipboard
@SerialName(value = "defaultNS")
var defaultNamespace: String

Default namespace used if not specified in the translation function.

Link copied to clipboard
@Transient
var detection: dynamic

Holds the detection configuration. This is a dynamic field and is not serialized to dynamic with kotlinx-serialization.

Link copied to clipboard
@SerialName(value = "fallbackLng")
var fallbackLanguage: String

Fallback language if the specified language is not available. Defaults to "dev".

Link copied to clipboard
@SerialName(value = "fallbackNS")
var fallbackNamespaces: List<String>

List of fallback namespaces.

Link copied to clipboard

If true, ignores the JSON structure when flattening translations.

Link copied to clipboard

If false, initialization is delayed until resources are loaded.

Link copied to clipboard
@Transient
var interpolation: dynamic

Holds the interpolation configuration. This is a dynamic field and is not serialized to dynamic with kotlinx-serialization.

Link copied to clipboard

Specifies how to join arrays in translations.

Link copied to clipboard

Separator used for keys.

Link copied to clipboard
@SerialName(value = "lng")
var language: String?

Specifies the initial language to load.

Link copied to clipboard
@SerialName(value = "load")
var loadStrategy: String

Strategy for loading resources.

Link copied to clipboard
@SerialName(value = "lowerCaseLng")
var lowerCaseLanguageCode: Boolean

If true, language codes are converted to lower case.

Link copied to clipboard

Maximum number of parallel reads when loading resources.

Link copied to clipboard

If true, falls back to the key if no value is found and the key is missing.

Link copied to clipboard
@SerialName(value = "ns")
var namespaces: List<String>

List of namespaces to load.

Link copied to clipboard

Separator used for namespaces.

Link copied to clipboard

If true, non-explicit supported languages are allowed.

Link copied to clipboard

If true, partially bundles languages.

Link copied to clipboard

Separator used for plurals.

Link copied to clipboard

List of post-processing steps.

Link copied to clipboard

List of languages to preload.

Link copied to clipboard

If true, returns detailed information for missing translations.

Link copied to clipboard

If true, returns an empty string for missing translations.

Link copied to clipboard

If true, returns null for missing translations.

Link copied to clipboard

If true, returns objects instead of strings for missing translations.

Link copied to clipboard

If true, missing keys are sent to the backend.

Link copied to clipboard

If true, saves missing plurals.

Link copied to clipboard

Specifies where to save missing keys.

Link copied to clipboard

If true, skips interpolation.

Link copied to clipboard
@SerialName(value = "supportedLngs")
var supportedLanguages: List<String>?

List of supported languages.

Link copied to clipboard

If true, updates missing keys.

Functions

Link copied to clipboard
fun getAsDynamic(): dynamic

Serializes the configuration into a dynamic object suitable for passing to JavaScript.

Link copied to clipboard

Configures the interpolation using InterpolationConfiguration builder.

Link copied to clipboard
fun rawInterpolation(interpolationObject: dynamic)

Configures the interpolation options using a dynamic builder.

Link copied to clipboard
fun rawResources(resourcesObject: dynamic)

Configures the resources (translations) using a dynamic object.

Link copied to clipboard
fun I18nConfiguration.resources(resourcesBuilder: Resources.() -> Unit)

Configures the resources (translations) using Resources builder.