LocalizedString
data class LocalizedString(val translations: Map<String?, LocalizedString.Translation> = emptyMap()) : JSONable, Parcelable
Represents a string with multiple translations indexed by a BCP 47 language tag.
Constructors
Link copied to clipboard
Shortcut to create a LocalizedString using a single string for a given language.
Properties
Functions
Link copied to clipboard
Returns a new LocalizedString after adding (or replacing) the translation with the given language.
Link copied to clipboard
Link copied to clipboard
Returns the first translation for the given language BCP–47 tag. If not found, then fallback: 1. on the default Locale 2. on the undefined language 3. on the English language 4. the first translation found
Link copied to clipboard
fun mapLanguages(transform: (Map.Entry<String?, LocalizedString.Translation>) -> String?): LocalizedString
Returns a new LocalizedString after applying the transform function to each language.
Link copied to clipboard
fun mapTranslations(transform: (Map.Entry<String?, LocalizedString.Translation>) -> LocalizedString.Translation): LocalizedString
Returns a new LocalizedString after applying the transform function to each translation.
Link copied to clipboard
Serializes a LocalizedString to its RWPM JSON representation.
Link copied to clipboard