Class TlumachSyncfusionLocalizer
- Namespace
- Tlumach.Syncfusion.Blazor
- Assembly
- Tlumach.Syncfusion.Blazor.dll
An Syncfusion.Blazor.ISyncfusionStringLocalizer that takes the built-in texts of Syncfusion Blazor components from Tlumach, in the culture of the user (LocalizerCulture).
A key is looked up in this order: the translation for the culture of the user (or its parent culture) in TranslationManager, the same in FallbackTranslationManager, the default file of TranslationManager, the default file of FallbackTranslationManager, and the English text built into Syncfusion. An empty text counts as missing, and an empty text of a culture does not hide the text of the default file of the same manager. Each manager is queried once, and a second time, for its default file, only when it has an empty text for the user's culture.
The texts are returned as they are; Syncfusion replaces their placeholders, such as {0} or ${count}, itself.
public class TlumachSyncfusionLocalizer : ISyncfusionStringLocalizer
- Inheritance
-
TlumachSyncfusionLocalizer
- Implements
-
ISyncfusionStringLocalizer
- Inherited Members
Constructors
TlumachSyncfusionLocalizer(TranslationManager, string?, TranslationManager?, string?, TlumachCultureState)
Initializes a new instance of the TlumachSyncfusionLocalizer class.
public TlumachSyncfusionLocalizer(TranslationManager manager, string? group, TranslationManager? fallbackManager, string? fallbackGroup, TlumachCultureState cultureState)
Parameters
managerTranslationManagerThe translation manager that holds the texts.
groupstringThe group, in which the keys are stored in
manager(see Group), or null.fallbackManagerTranslationManagerAn optional second translation manager (see FallbackTranslationManager), or null.
fallbackGroupstringThe group, in which the keys are stored in
fallbackManager, or null.cultureStateTlumachCultureStateThe culture state of the user.
Properties
FallbackGroup
Gets the group, in which the keys are stored in FallbackTranslationManager, or null when they are stored at the root.
public string? FallbackGroup { get; }
Property Value
FallbackTranslationManager
Gets the second translation manager, which is asked for the keys that TranslationManager does not have, or null.
public TranslationManager? FallbackTranslationManager { get; }
Property Value
Group
Gets the group, in which the keys are stored in TranslationManager, or null when they are stored at the root.
public string? Group { get; }
Property Value
ResourceManager
Gets null: the texts come from Tlumach, and Syncfusion components do not read this property.
public ResourceManager? ResourceManager { get; }
Property Value
TranslationManager
Gets the translation manager that holds the texts.
public TranslationManager TranslationManager { get; }
Property Value
Methods
GetText(string)
Gets the text with the given key in the culture of the user.
public string? GetText(string key)
Parameters
keystringThe key used by Syncfusion, such as
Grid_EmptyRecord.