Table of Contents

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

manager TranslationManager

The translation manager that holds the texts.

group string

The group, in which the keys are stored in manager (see Group), or null.

fallbackManager TranslationManager

An optional second translation manager (see FallbackTranslationManager), or null.

fallbackGroup string

The group, in which the keys are stored in fallbackManager, or null.

cultureState TlumachCultureState

The 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

string

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

TranslationManager

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

string

ResourceManager

Gets null: the texts come from Tlumach, and Syncfusion components do not read this property.

public ResourceManager? ResourceManager { get; }

Property Value

ResourceManager

TranslationManager

Gets the translation manager that holds the texts.

public TranslationManager TranslationManager { get; }

Property Value

TranslationManager

Methods

GetText(string)

Gets the text with the given key in the culture of the user.

public string? GetText(string key)

Parameters

key string

The key used by Syncfusion, such as Grid_EmptyRecord.

Returns

string

The text, or the English text built into Syncfusion when Tlumach does not have it, or null when Syncfusion does not know the key either.