Skip to content

Class LocalizedTextCatalog

Namespace: Cephalon.Engine.Localization
Assembly: Cephalon.Engine.dll

Resolves localized resources from built-in and configuration-supplied resource catalogs.

public sealed class LocalizedTextCatalog : ILocalizedTextCatalog

objectLocalizedTextCatalog

ILocalizedTextCatalog

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

LocalizedTextCatalog(LocalizationSettings)

Section titled “ LocalizedTextCatalog(LocalizationSettings)”

Initializes a new instance of the class.

public LocalizedTextCatalog(LocalizationSettings settings)

settings LocalizationSettings

The localization settings that supply culture and resource overrides.

Gets the default culture used when no explicit culture is requested.

public string DefaultCulture { get; }

string

Gets the supported cultures available from the merged resource catalog.

public IReadOnlyList<string> SupportedCultures { get; }

IReadOnlyList<string>

Creates a serialization-friendly snapshot of the merged localized resources.

public LocalizedResourcesSnapshot CreateSnapshot(string? culture = null)

culture string?

The preferred culture to resolve from.

LocalizedResourcesSnapshot

A snapshot of the resolved localization view.

Gets the merged resources visible for the specified culture.

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

culture string?

The preferred culture to resolve from.

IReadOnlyDictionary<string, string>

The merged resource dictionary for the resolved culture chain.

Resolves a localized value or returns the provided fallback.

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

key string

The resource key to resolve.

culture string?

The preferred culture to resolve from.

fallback string?

The fallback value to return when the resource cannot be resolved.

string

The resolved localized value or the fallback.

Attempts to resolve a localized value for the specified key and culture.

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

key string

The resource key to resolve.

culture string?

The preferred culture to resolve from.

value string

The resolved localized value when found.

bool

true when a value was resolved; otherwise, false.