struct LocalizedTextextension LocalizedText : AutomationValue, Decodable, Encodable, Equatable, Hashable, Sendable, SendableMetatype, StructDataRepresentableRepresents a localized string and its corresponding locale.
This struct maps to Google_Type_LocalizedText, defined here:
google3/google/type/localized_text.proto.
-
The actual localized text.
Declaration
Swift
let text: String -
The BCP-47 locale (e.g. “en-US”).
Declaration
Swift
let locale: Locale -
Undocumented
Declaration
Swift
init(text: String, locale: Locale) -
Initializes
LocalizedTextwith the trait decoder.Declaration
Swift
init(decoder: TraitDecoder) throwsParameters
decoderThe trait decoder to decode the localized text.
-
Encodes
LocalizedTextto the trait encoder.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
Creates a new instance by decoding from the given decoder.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
Declaration
Swift
init(from decoder: any Decoder) throws