LocalizedStringMap

A simple implementation of LocalizedString that maps a locale values to string values.

Attributes may also be specified with the attributes parameter.

Constructors

Link copied to clipboard
constructor(vararg messages: Pair<Locale, String>, attributes: LocalizedAttributable? = null)
constructor(messages: Map<Locale, String>, attributes: LocalizedAttributable?)

Functions

Link copied to clipboard
open override fun getAttribute(attributeName: CharSequence, locale: Locale?): String?

Returns the value of the attribute with the given name in the given locale or null if the attribute value is not defined for the locale.

Link copied to clipboard
open operator fun invoke(): String
open operator fun invoke(locale: Locale?): String

Shortcut for toString

Link copied to clipboard

Combines the two LocalizedString into one

Combines the LocalizedString and the String into a LocalizedString

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

Returns the string value based on the currently set Locale in de.comahe.i18n4k.i18n4k (de.comahe.i18n4k.config.I18n4kConfig.locale)

open override fun toString(locale: Locale?): String

Returns the string value based on the given Locale.