LocalizedValueParser

class LocalizedValueParser(preferredLocaleKeys: List<String> = DEFAULT_PREFERRED_LOCALE_KEYS)

Parses a backend field that's either a plain string or a JSON-encoded {locale: value} map, preferring preferredLocaleKeys (falling back to the first non-blank value) when it's a map.

A common shape for backends that localize a single field without a full i18n response envelope.

Constructors

Link copied to clipboard
constructor(preferredLocaleKeys: List<String> = DEFAULT_PREFERRED_LOCALE_KEYS)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun parse(value: String?): String?
fun parse(element: JsonElement): String?
Link copied to clipboard