Table of Contents

Namespace Tlumach.FluentValidation

Classes

TlumachDisplayNameResolver

Provides the display names of properties from a Tlumach translation, for ValidatorOptions.Global.DisplayNameResolver.

For the property Name of the class Customer, the resolver looks up two keys: the type-qualified key {DisplayNamesGroup}.Customer.Name and the member key {DisplayNamesGroup}.Name. The type is the type of the object that FluentValidation validates (the root object). A name in the language of the message is preferred to a name in another language, so the first of these is returned:

  1. The text of the type-qualified key, found for the culture or its basic culture.
  2. The text of the member key, found for the culture or its basic culture.
  3. The text of the type-qualified key from the default file, or a text supplied by an OnTranslationValueNotFound handler.
  4. The text of the member key from the default file, or a text supplied by an OnTranslationValueNotFound handler.

When neither key has text, the resolver returns null, and FluentValidation uses its default name. A rule that calls WithName is not affected.

The name is read when the rule is validated, for the same culture as the messages of the language manager.

TlumachFluentValidationOptions

The options of AddTlumachFluentValidation(IServiceCollection, Action<TlumachFluentValidationOptions>).

TlumachFluentValidationServiceCollectionExtensions

Registers the Tlumach integration of FluentValidation.

TlumachLanguageManager

The language manager of FluentValidation that takes the messages from Tlumach translations and falls back to the messages built into FluentValidation.

Assign an instance to ValidatorOptions.Global.LanguageManager, or call AddTlumachFluentValidation. The setting is process-wide, as FluentValidation offers no other way to supply a language manager.

TlumachLanguageManagerOptions

The options of TlumachLanguageManager. The language manager copies the values when it is created.

TlumachRuleBuilderExtensions

Sets the message and the display name of a rule from a Tlumach translation. The text is read when the rule is validated, so it follows the culture of that moment.

Enums

MessageCultureSource

Selects the culture, for which a validation message is read when neither the caller nor LanguageManager.Culture specifies one.