t

fun t(key: String, default: String?, table: String? = null): String?(source)

Retrieves the translation for a given key immediately. If no translation is found, falls back to the provided default value or bundle localization.

Return

The localized string if found, or the default value if provided. Returns null if none is available.

Parameters

key

The key to look up for translation.

default

The default value to return if no translation is found. Can be null.

table

The optional localization table where the key is searched. Can be null.


fun t(key: String, default: String?, table: String? = null, vararg args: Any): String?(source)

Retrieves an immediate translation string for the given key with optional parameters and a fallback.

If the key is not found or no translations are loaded, it falls back to a localized string obtained from a resource bundle or returns the provided default value.

Return

The translated and optionally formatted string, or null if no translation is found and no default is provided.

Parameters

key

The key to identify the desired translation string.

default

The fallback string to be used if the key is not found or no translation is available. Can be null.

table

The lookup table name for the translation, if applicable. Defaults to null.

args

Optional arguments to be used for formatting the translation string.