I'm setup a new project with Catalyst with the Plugin Catalyst::Plugin::I18N and creating forms with HTML::FormFu my problem is that localization with the HTML::FormFu config files doesn't work.
I create my language files like written here: https://metacpan.org/pod/Catalyst::Plugin::I18N::Manual
I tried solutions like localize_class or add_localize_class_from_object but none didn't work
My Form config file looks like this:
action:
indicator: submit
auto_fieldset: 1
elements:
- type: Text
name: email
id: email
label_loc: form.add_user.email.label
constraints:
- type: Required
message_loc: form.add_user.email.constraint.required
- type: Email
message_loc: form.add_user.email.constraint.email
error_tag: div
render_method: tt
attributes_xml: { class: form-control }
container_attributes: { class: form-group }
The Action in the Catalyst Controller (I'm using Catalyst::Controller::HTML::FormFu)
sub add_user :Path('/admin/add/user') :FormConfig {
my ($self, $c) = @_;
my $form = $c->stash->{'form'};
$form->get_field('submit')->value($c->loc('form.add_user.submit.value'));
return if !$form->submitted_and_valid;
}
Content of the de.po File:
#: root/forms/admin/add_user.yml:9
msgid "form.add_user.email.label"
msgstr "E-Mail Adresse"
It displays all the Time: form.add_user.email.label instead of: E-Mail Adresse