[html-formfu] Setting a default message for a constraint

Octavian Rasnita orasnita at gmail.com
Wed Nov 10 21:24:00 GMT 2010


Hi,

If I want to distribute a constraint for HTML::FormFu which is not in the main distribution, how can I add a default message which is displayed if that constraint is not respected?

The messages in the main distribution can be stored in the I18N/lang.pm files for different languages, but this is not possible for a constraint which is not in the main distro.

(I have made a constraint for a personal numeric code which is used in Romania which wouldn't be very interesting for the HTML::FormFu users in other countries, but I like to be able to present the error message in the current language of the page.)

And another question... Is there a possibility of inserting the value of the current field in the I18N generated messages?

Something like: The number [_1] is not ok.
Where [_1] should be replaced with the value of the current field.

Thank you.

Octavian




More information about the HTML-FormFu mailing list