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 : ILocalizedTextCatalogInheritance
Section titled “Inheritance”Implements
Section titled “Implements”ILocalizedTextCatalog
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
Section titled “Constructors”LocalizedTextCatalog(LocalizationSettings)
Section titled “ LocalizedTextCatalog(LocalizationSettings)”Initializes a new instance of the
public LocalizedTextCatalog(LocalizationSettings settings)Parameters
Section titled “Parameters”settings LocalizationSettings
The localization settings that supply culture and resource overrides.
Properties
Section titled “Properties”DefaultCulture
Section titled “ DefaultCulture”Gets the default culture used when no explicit culture is requested.
public string DefaultCulture { get; }Property Value
Section titled “Property Value”SupportedCultures
Section titled “ SupportedCultures”Gets the supported cultures available from the merged resource catalog.
public IReadOnlyList<string> SupportedCultures { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CreateSnapshot(string?)
Section titled “ CreateSnapshot(string?)”Creates a serialization-friendly snapshot of the merged localized resources.
public LocalizedResourcesSnapshot CreateSnapshot(string? culture = null)Parameters
Section titled “Parameters”culture string?
The preferred culture to resolve from.
Returns
Section titled “Returns”LocalizedResourcesSnapshot
A snapshot of the resolved localization view.
GetResources(string?)
Section titled “ GetResources(string?)”Gets the merged resources visible for the specified culture.
public IReadOnlyDictionary<string, string> GetResources(string? culture = null)Parameters
Section titled “Parameters”culture string?
The preferred culture to resolve from.
Returns
Section titled “Returns”IReadOnlyDictionary<string, string>
The merged resource dictionary for the resolved culture chain.
ResolveText(string, string?, string?)
Section titled “ ResolveText(string, string?, string?)”Resolves a localized value or returns the provided fallback.
public string ResolveText(string key, string? culture = null, string? fallback = null)Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”The resolved localized value or the fallback.
TryGet(string, string?, out string)
Section titled “ TryGet(string, string?, out string)”Attempts to resolve a localized value for the specified key and culture.
public bool TryGet(string key, string? culture, out string value)Parameters
Section titled “Parameters”key string
The resource key to resolve.
culture string?
The preferred culture to resolve from.
value string
The resolved localized value when found.