Class LocalizedText
A piece of text a profile supplies for one of its codes: one string for every locale, or a map from locale tag to text.
[JsonConverter(typeof(LocalizedTextConverter))]
public sealed record LocalizedText : IEquatable<LocalizedText>
- Inheritance
-
LocalizedText
- Implements
- Inherited Members
Remarks
Exactly one of Text and PerLocale is set. A string
converts implicitly, so messages["state.flushing"] = "Flushing" reads as it
would in a manifest.
Properties
PerLocale
Gets the per-locale text, keyed by locale tag (en, sw, ...).
public IReadOnlyDictionary<string, string>? PerLocale { get; init; }
Property Value
Text
Gets the text shown in every locale, when one text serves all.
public string? Text { get; init; }
Property Value
Operators
implicit operator LocalizedText(Dictionary<string, string>)
Wraps per-locale text.
public static implicit operator LocalizedText(Dictionary<string, string> perLocale)
Parameters
perLocaleDictionary<string, string>The text by locale tag.
Returns
implicit operator LocalizedText(string)
Wraps one text for every locale.
public static implicit operator LocalizedText(string text)
Parameters
textstringThe text.