Struct UIString

Container for UI string - either raw value or string resource ID

struct UIString;

Set resource id (string) or plain unicode text (dstring) to it, and get dstring.

Constructors

NameDescription
this (id)
this (value) create string with raw value; deprecated, use fromRaw() instead
this (id, fallbackValue) create string with resource id and raw value as fallback for missing translations

Properties

NameTypeDescription
id[get] stringReturns string resource id
id[set] stringSets string resource id
value[get] dstringGet value (either raw or translated by id)
value[set] dstringSet raw value using property

Methods

NameDescription
empty () returns true if string is empty: neither resource nor string is assigned
fromId (ID, fallback) create UIString from id - will be translated; fallback value can be provided for cases if translation is not found
fromRaw (rawValue) Create UIString from raw utf32 string value - will not be translated
fromRaw (rawValue) Create UIString from raw utf8 string value - will not be translated
opAssign (rawValue) Assign raw value
opAssign (ID) Assign string resource id