You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
French translation for the default Validot's message set.
Placeholders support where applicable.
Fluent api extension method to ValidatorSettings so it can be nicely used from Validator.Factory.Create.
Feature in action
varvalidator= Validator.Factory.Create(
specification,s => s.WithFrenchTranslation());
validator.Settings.Translations["French"]// this is the full translation dictionaryvalidator.Validate(model).ToString(translationName:"French")// gets result error output in French
Feature implementation walkthrough
In Validot, even English language is implemented as a translation that maps the property names from MessageKey class to the human-readable phrases.
Take a look at the files in src/Validot/Translations directory and see how the other languages are implemented.
In the project's root directory execute pwsh build.ps1 --target AddTranslation --translationName French
There is also build.sh if you don't have pwsh installed.
Their role is to check whether the translation dictionary contains only the keys from the MessageKey class.
You don't need to include all keys translated, but if you want to skip something, please comment the line out instead of removing it (later it would be easier to check what's missing).
Done! Now you can make a PR! Thank you for your contribution!
The text was updated successfully, but these errors were encountered:
Feature description
ValidatorSettings
so it can be nicely used fromValidator.Factory.Create
.Feature in action
Feature implementation walkthrough
MessageKey
class to the human-readable phrases.pwsh build.ps1 --target AddTranslation --translationName French
build.sh
if you don't have pwsh installed.FrenchTranslation.cs
and translate the English phrases.MessageKey
class.The text was updated successfully, but these errors were encountered: