LocalizedValueParser
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.
Functions
Link copied to clipboard
Parses a plain string (returned as-is) or a JSON-encoded {locale: value} map. A decoded locale map with no usable entry yields null (as the JsonElement overload does) rather than leaking the raw JSON into the UI. Non-string entries are handled exactly as the JsonElement overload handles them.
Link copied to clipboard
Returns the first non-blank value among preferredLocaleKeys, else the first non-blank value in values. A preferred locale present with a blank value is skipped, not returned.