I18n

class I18n(localeData: Pair<String, JsAny>) : LocaleChangeListener

Provides translations by the underlying gettext library.

Constructors

Link copied to clipboard
constructor(vararg localeData: Pair<String, JsAny>)

Functions

Link copied to clipboard
@Composable
fun marktr(text: String): String

Mark text for translation, but do not translate it.

Link copied to clipboard
open override fun setLocale(locale: Locale)
Link copied to clipboard
@Composable
fun tr(text: String): String

Translate text.

@Composable
fun tr(text: String, vararg args: Pair<String, String>): String

Translate formatted text with provided args.

Link copied to clipboard
@Composable
fun trc(context: String, text: String): String

Translate text in a given context.

@Composable
fun trc(context: String, text: String, vararg args: Pair<String, String>): String

Translate formatted text with provided args in a given context.

Link copied to clipboard
@Composable
fun trn(text: String, plural: String, n: Int): String
@Composable
fun trn(text: String, plural: String, n: Long): String

Translate text with different plural form, chosen based on provided number n.

@Composable
fun trn(text: String, plural: String, n: Int, vararg args: Pair<String, String>): String
@Composable
fun trn(text: String, plural: String, n: Long, vararg args: Pair<String, String>): String

Translate formatted text with different plural form with provided args, chosen based on provided number n.

Link copied to clipboard
@Composable
fun trnc(context: String, text: String, plural: String, n: Int): String
@Composable
fun trnc(context: String, text: String, plural: String, n: Long): String

Translate text with different plural form, chosen based on provided number n in a given context.

@Composable
fun trnc(context: String, text: String, plural: String, n: Int, vararg args: Pair<String, String>): String
@Composable
fun trnc(context: String, text: String, plural: String, n: Long, vararg args: Pair<String, String>): String

Translate formatted text with different plural form with provided args, chosen based on provided number n in a given context.