Class LocalizationResourceAccessor
Represents the class that manages the localization for syncfusion controls.
Inheritance
Namespace: Syncfusion.UI.Xaml.Core
Assembly: Syncfusion.Core.WinUI.dll
Syntax
public abstract class LocalizationResourceAccessor : Object
Constructors
LocalizationResourceAccessor()
Initializes new instance of LocalizationResourceAccessor.
Declaration
public LocalizationResourceAccessor()
Properties
CustomResourceMap
Gets or sets the custom resource map.
Declaration
public ResourceMap CustomResourceMap { get; set; }
Property Value
| Type |
|---|
| Microsoft.Windows.ApplicationModel.Resources.ResourceMap |
DefaultResourceMap
Gets the default resource map of the controls in the assembly.
Declaration
protected ResourceMap DefaultResourceMap { get; set; }
Property Value
| Type |
|---|
| Microsoft.Windows.ApplicationModel.Resources.ResourceMap |
ResourceContext
Gets the resource context for the current executing assembly.
Declaration
public ResourceContext ResourceContext { get; }
Property Value
| Type |
|---|
| Microsoft.Windows.ApplicationModel.Resources.ResourceContext |
Methods
GetLocalizedStringResource(String)
Retrieves a localized string for the given resource name using a prioritized resolution strategy. The lookup considers the current Microsoft.Windows.ApplicationModel.Resources.ResourceContext.QualifierValues["Language"].
Resolution order:
- If a LocalizationProvider is configured, the resource is fetched from it.
If the provider returns
null, the lookup continues with the next source. - If no provider is set or the provider result is
null, but a CustomResourceMap exists, the resource is retrieved from that map. - If neither is available or the resource is not found, the value is returned from the DefaultResourceMap.
Declaration
public virtual string GetLocalizedStringResource(string resourcename)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | resourcename | The name of the resource to localize. |
Returns
| Type | Description |
|---|---|
| System.String | A localized string corresponding to the specified resource name. Returns the default resource value if no provider or custom mapping is available. |
GetSourceSubTree(String)
Helps to update the CustomResourceMap and DefaultResourceMap based on the resxfile name passed.
Declaration
public ResourceMap GetSourceSubTree(string resxfile)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | resxfile |
Returns
| Type |
|---|
| Microsoft.Windows.ApplicationModel.Resources.ResourceMap |