2009/6/21 Johannes <[email protected]>: > Sorry if the tries of solving the problem may read ridiculous. Tried to > query the mailinglist for hours now and couldn't get a clue how to make > localization work with HTML::FormFu. > > My Catalyst app already uses Catalyst::Plugin::I18N, has > MyApp::I18N::de > and > MyApp::I18N::en > > Using HTML::FormFu in Catalyst with regular .yml config files for each form > i've tried for example > > elements: > - type: Text > name: email > label_loc: email > > and had Email translated in the MyApp::I18N::de and MyApp::I18N::en. > > But just "email" got printed as label, no translation... > > How can I tell FormFu's yml's to use MyApp's I18N's?
To completely replace HTML::FormFu's own I18N files - see localize_class() http://search.cpan.org/~cfranks/HTML-FormFu-0.05000/lib/HTML/FormFu.pm#localize_class To supplement it, see the methods in HTML::FormFu::Localize - unfortunately they're not documented, and not very well tested. You'll probably want either add_localize_object() or add_localize_object_from_class() to set it in a config file. > for error messages on validation I'd be thankful too for hints how to tell > my forms/formconfigs to hand out localized error messages... > > something like: > elements: > - type: Text > name: email > label: "Email:" > constraints: > - message_loc: wrongemail > - Required > - Email That's an array of 3 items - each of which should be an individual constraint. The first will fail because it doesn't define a 'type' Did you mean this... ? constraints: - Required - type: Email message_loc: wrongemail Which is equivalent to: $field->constraint( 'Required' ); $field->constraint( { type => 'Email', message_loc => 'wrongemail', } ); _______________________________________________ HTML-FormFu mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
