Interface ITlumachLocalizedErrorMessage
- Namespace
- Tlumach.DataAnnotations
- Assembly
- Tlumach.DataAnnotations.dll
Implemented by validation attributes that take their error message from a Tlumach translation.
The localized validation attributes of Tlumach derive from different attributes of System.ComponentModel.DataAnnotations and cannot share a common base class, so this interface is what TlumachMessageResolver talks to. The ErrorMessage and ErrorMessageResourceName members are satisfied by the properties that every implementer inherits from ValidationAttribute; an implementer does not write any code for them.
public interface ITlumachLocalizedErrorMessage
Properties
CultureSource
Gets the culture, for which the message is read.
TranslationCultureSource CultureSource { get; }
Property Value
ErrorMessage
Gets the literal error message. Mirrors ErrorMessage and is used to detect the invalid combination of a literal message and a Tlumach translation key.
string? ErrorMessage { get; }
Property Value
ErrorMessageResourceName
Gets the name of the resource that provides the error message. Mirrors ErrorMessageResourceName and is used to detect the invalid combination of a resource and a Tlumach translation key.
string? ErrorMessageResourceName { get; }
Property Value
TranslationClass
Gets the class created by Tlumach Generator, or a nested group class inside one, that provides the message.
Type? TranslationClass { get; }
Property Value
TranslationKey
Gets the name of the translation unit member in TranslationClass, or the key of a translation entry.
string? TranslationKey { get; }