i18n Integration
Internationalization
If you are using i18n (Internationalization and Localization) in your ColdBox applications you can also localize your validation error messages from the ColdBox validators.
You will do this by our lovely conventions for you resource bundle keys:
Domain Objects:
Forms with Shared Constraints Name
Forms with No Shared Constraints (A-la-carte constraints)
Usage
When your resource bundle keys are ready, you then specify the locale
argument in your validation calls to put them into play:
Key Replacements
We also setup lots of global {Key}
replacements for your messages and also several that the core constraint validators offer as well:
Global Replacements
{rejectedValue}
- The rejected value{field}
or property - The property or field that was validated{validationType}
- The name of the constraint validator{validationData}
- The value of the constraint definition, e.g size=5..10, then this value is 5..10{targetName}
- The name of the user, shared constraint or form
i18n Validator Replacements
{DiscreteValidator}
- operation, operationValue{InListValidator}
- inList{MaxValidator}
- max{MinValidator}
- min{RangeValidator}
- range, min, max{RegexValidator}
- regex{SameAsValidator}
,{SameAsNoCaseValidator}
- SameAs{SizeValidator}
- size, min, max{TypeValidator}
- type
Examples
Last updated
Was this helpful?