Skip to content

Interface ILocalizedTextCatalog

Namespace: Cephalon.Abstractions.Localization
Assembly: Cephalon.Abstractions.dll

Reads localized text resolved by the runtime.

public interface ILocalizedTextCatalog

Gets the default culture used by the catalog.

string DefaultCulture { get; }

string

Gets the cultures currently available in the catalog.

IReadOnlyList<string> SupportedCultures { get; }

IReadOnlyList<string>

Creates an introspectable snapshot of the currently resolved localized resources.

LocalizedResourcesSnapshot CreateSnapshot(string? culture = null)

culture string?

The preferred culture, or null to use the default resolution flow.

LocalizedResourcesSnapshot

The localized-resource snapshot.

Returns the localized resources visible for one culture.

IReadOnlyDictionary<string, string> GetResources(string? culture = null)

culture string?

The preferred culture, or null to use the default resolution flow.

IReadOnlyDictionary<string, string>

The localized resources visible for the requested culture.

Resolves one localized text value with an optional fallback.

string ResolveText(string key, string? culture = null, string? fallback = null)

key string

The resource key to resolve.

culture string?

The preferred culture, or null to use the default resolution flow.

fallback string?

The fallback value to use when the key cannot be resolved.

string

The resolved localized text value.

Attempts to resolve one localized text value.

bool TryGet(string key, string? culture, out string value)

key string

The resource key to resolve.

culture string?

The preferred culture, or null to use the default resolution flow.

value string

The resolved text value when one is found.

bool

true when the value was resolved; otherwise false.