bartoszlenar / Validot

Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers.
MIT License
311 stars 19 forks source link

Invalid argument names in DateTimeOffsetRules, DateTimeRules, and TimeSpanRules #32

Closed adambajguz closed 1 year ago

adambajguz commented 2 years ago

DateTimeOffsetRules, DateTimeRules, and TimeSpanRules use min and max argument names but translations use value as a placeholder.

EXAMPLE: https://github.com/bartoszlenar/Validot/blob/79ef1cbfe05e6c93bdb79ea27127e037b82a88cf/src/Validot/Rules/TimeSpanRules.cs#L30-L76

https://github.com/bartoszlenar/Validot/blob/79ef1cbfe05e6c93bdb79ea27127e037b82a88cf/src/Validot/Translations/English/EnglishTranslation.cs#L72-L76

adambajguz commented 2 years ago

Similar problem occurs also for collections: size is used instead of min/max.

adambajguz commented 2 years ago

... and for numbers (see e.g. MessageKey.Numbers.GreaterThanOrEqualTo).

bartoszlenar commented 2 years ago

Thank you @adambajguz , I'll address this bug in the upcoming release.

bartoszlenar commented 1 year ago

Fixed. Thank you, @adambajguz .

To ensure that won't happen again, I've added some tests that will validate all placeholders used in the translations.

bartoszlenar commented 1 year ago

@adambajguz At first I planned to include it along with #34 in a single release, but the progress on the other feature is so slow (and I'm on the edge of not doing it at all), that I decided to go with this alone in the fix release.

So here it is, v2.4.1.