Namespace Tlumach.FluentValidation
Classes
- TlumachDisplayNameResolver
Provides the display names of properties from a Tlumach translation, for
ValidatorOptions.Global.DisplayNameResolver.For the property
Nameof the classCustomer, the resolver looks up two keys: the type-qualified key{DisplayNamesGroup}.Customer.Nameand 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:- The text of the type-qualified key, found for the culture or its basic culture.
- The text of the member key, found for the culture or its basic culture.
- The text of the type-qualified key from the default file, or a text supplied by an
OnTranslationValueNotFoundhandler. - The text of the member key from the default file, or a text supplied by an
OnTranslationValueNotFoundhandler.
When neither key has text, the resolver returns null, and FluentValidation uses its default name. A rule that calls
WithNameis 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 callAddTlumachFluentValidation. 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.Culturespecifies one.