DefaultLocalizationTemplate

Default implementation for LocalizationTemplate.

This is effectively MessageFormat, but with named parameters.

To declare a variable inside your localization template, you may use {variable_name}.

As this supports MessageFormat, you can also specify format types, such as: {variable_name, number}, and format styles, such as: {user_amount, choice, 0#users|1#user|1<users}.

Full example: "There are {user_amount} {user_amount, choice, 0#users|1#user|1<users} and my up-time is {uptime, number} seconds"

Constructors

Link copied to clipboard
constructor(context: BContext, template: String, locale: Locale)

Functions

Link copied to clipboard
open override fun localize(vararg args: Localization.Entry): String

Processes the localization template and replaces the named parameters by their values

Link copied to clipboard

Processes the localization template and replaces the named parameters by their values

Link copied to clipboard
open override fun toString(): String