If you are using the standard &validationErrorMessage property, use lexicon tags for the value instead of a text string.
There is also the option the custom error message as described here
https://rtfm.modx.com/extras/revo/formit/formit.validators#FormIt.Validators-CustomErrorMessages
Again, use lexicon tags instead of strings for these.
-
- 3 Posts
Hi
Thank you for your response. I've seen these possibilites in the docu but I thought there might be a functionality to pre set the language to German and use the existing validation messages coming from the lexicons without using my own text.
I have set only this:
&validate=`contact_name:required:minLength=^3^`
<span class="label label-danger">[[!+fi.error.contact_name]]</span>
Result: Please enter a value for this field. This field must be at least 3 characters long.
It gives me back the wanted text in English, but I don't know how to get the German version of it.
Regards
Andrea
discuss.answer
-
- 5,888 Posts
by default FormIt should take care of the current cultureKey-setting, but I think you can set the language also with
-
- 5,888 Posts
Because of that line:
https://github.com/Sterc/FormIt/blob/develop/core/components/formit/model/formit/formit.class.php#L132
, I would think, this could work
[[!Formit?
&language=`de`
.
.
.
]]
But seems, I was wrong, when you say, it doesn't work.