Interface ILocalizedTextCatalog
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Namespace: Cephalon.Abstractions.Localization
Assembly: Cephalon.Abstractions.dll
Reads localized text resolved by the runtime.
public interface ILocalizedTextCatalogProperties
Section titled “Properties”DefaultCulture
Section titled “ DefaultCulture”Gets the default culture used by the catalog.
string DefaultCulture { get; }Property Value
Section titled “Property Value”SupportedCultures
Section titled “ SupportedCultures”Gets the cultures currently available in the catalog.
IReadOnlyList<string> SupportedCultures { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CreateSnapshot(string?)
Section titled “ CreateSnapshot(string?)”Creates an introspectable snapshot of the currently resolved localized resources.
LocalizedResourcesSnapshot CreateSnapshot(string? culture = null)Parameters
Section titled “Parameters”culture string?
The preferred culture, or null to use the default resolution flow.
Returns
Section titled “Returns”The localized-resource snapshot.
GetResources(string?)
Section titled “ GetResources(string?)”Returns the localized resources visible for one culture.
IReadOnlyDictionary<string, string> GetResources(string? culture = null)Parameters
Section titled “Parameters”culture string?
The preferred culture, or null to use the default resolution flow.
Returns
Section titled “Returns”IReadOnlyDictionary<string, string>
The localized resources visible for the requested culture.
ResolveText(string, string?, string?)
Section titled “ ResolveText(string, string?, string?)”Resolves one localized text value with an optional fallback.
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, or null to use the default resolution flow.
fallback string?
The fallback value to use when the key cannot be resolved.
Returns
Section titled “Returns”The resolved localized text value.
TryGet(string, string?, out string)
Section titled “ TryGet(string, string?, out string)”Attempts to resolve one localized text value.
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, or null to use the default resolution flow.
value string
The resolved text value when one is found.