Table of Contents

Class TemplateTranslationOptions

Namespace
Tlumach.Templating
Assembly
Tlumach.dll

The options of TemplateTranslator, shared by the integrations with template engines, whose options derive from this class.

TemplateTranslator copies the values when it is created, so later changes of an options object do not affect a registered integration.

public class TemplateTranslationOptions
Inheritance
TemplateTranslationOptions
Derived
Inherited Members

Fields

DefaultCultureArgumentName

The default name of the argument that sets the culture of a call.

public const string DefaultCultureArgumentName = "culture"

Field Value

string

Properties

Configuration

Gets or sets the configuration, in which keys are looked up. When null, the default configuration of the translation manager is used. Translation units always use their own configuration.

public TranslationConfiguration? Configuration { get; set; }

Property Value

TranslationConfiguration

CultureArgumentName

Gets or sets the name of the named argument that sets the culture of a call. The argument is never used as a placeholder value. The default is "culture".

public string CultureArgumentName { get; set; }

Property Value

string

KeyPrefix

Gets or sets the text that is prepended to every key, e.g. "email." to look up email.subject for the key subject. It is not applied to translation units.

public string? KeyPrefix { get; set; }

Property Value

string

MissingKey

Gets or sets what is returned for a key that no translation contains. The default is ReturnKey.

public MissingKeyBehavior MissingKey { get; set; }

Property Value

MissingKeyBehavior

OnMissingKey

Gets or sets a function that is called with the full key (with the prefix) and the culture of a call when the key is missing. A non-null return value is used as the text and takes precedence over MissingKey. The function may also be used for logging.

public Func<string, CultureInfo, string?>? OnMissingKey { get; set; }

Property Value

Func<string, CultureInfo, string>