[html-formfu] I18N localization and Catalyst

Carl Franks fireartist at gmail.com
Thu Jun 25 09:47:35 GMT 2009


2009/6/25 Johannes <list100 at hoerburger.org>:
>
> ---
> add_localize_object: 'MyApp::I18N'
> indicator: submit
> elements:
> ...
>
> how can I make the label of a field localized? something like:
>
> elements:
>  - type: Text
>    name: email
>    label_loc: email
>    constraints:
>      - Required
>      - Email
>
> didn't do the trick.

add_localize_object() expects an object, not just a class name.
I've added a new add_localize_object_from_class() method ( svn -r1535
) that you'll need to use instead.
It'll be included in the next CPAN release (hopefully in the next week).

> The second question:
> How do I tell HTML::FormFu's yml's to what language it should localize the
> constraint errormessages (e.g. which /FormFu/I18N/lang.pm to use for that
> certain request)?
>
> it doesn't guess it by itself like $c->localize() does it in catalyst based
> on the browsers language defaults).

http://search.cpan.org/~cfranks/Catalyst-Controller-HTML-FormFu-0.04003/lib/Catalyst/Controller/HTML/FormFu.pm#languages_from_context

Cheers,
Carl



More information about the HTML-FormFu mailing list