Table of Contents

Class LocalizedText

Namespace
Pamoja.Profile
Assembly
Pamoja.Profile.dll

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

IReadOnlyDictionary<string, string>

Text

Gets the text shown in every locale, when one text serves all.

public string? Text { get; init; }

Property Value

string

Operators

implicit operator LocalizedText(Dictionary<string, string>)

Wraps per-locale text.

public static implicit operator LocalizedText(Dictionary<string, string> perLocale)

Parameters

perLocale Dictionary<string, string>

The text by locale tag.

Returns

LocalizedText

implicit operator LocalizedText(string)

Wraps one text for every locale.

public static implicit operator LocalizedText(string text)

Parameters

text string

The text.

Returns

LocalizedText