2022-01-23 18:32:22 +01:00
|
|
|
using FluentValidation;
|
|
|
|
|
|
|
|
|
|
namespace zero.Localization;
|
|
|
|
|
|
|
|
|
|
public class TranslationValidator : ZeroValidator<Translation>
|
|
|
|
|
{
|
2022-01-24 00:08:44 +01:00
|
|
|
public TranslationValidator(IZeroStore store)
|
2022-01-23 18:32:22 +01:00
|
|
|
{
|
2022-01-24 00:08:44 +01:00
|
|
|
RuleFor(x => x.Key).NotEmpty().Length(2, 300).Unique(store);
|
2022-01-23 18:32:22 +01:00
|
|
|
RuleFor(x => x.Value).MaximumLength(10 * 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|