Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zend Fieldset translation breaks when using formRow helper before #26

Open
weierophinney opened this issue Dec 31, 2019 · 0 comments
Open

Comments

@weierophinney
Copy link
Member

Hi, in a view, when using $this->formRow on a fieldset element then translation is not working for helper $this->formLabel on another element of the same fieldset.

I'm using zend 2.5.1. My simplified view is like this:

$form->prepare();
$busquedas = $form->get('busquedasFS');
echo $this->form()->openTag($form). "\n\n";
echo $this->formRow($busquedas->get('tipoBusqueda')). "\n";
echo $this->formLabel($busquedas->get('palabrasClaveBusqAvanzada')). ' - '.
$this->formText($busquedas->get('palabrasClaveBusqAvanzada')). "\n";
echo $this->form()->closeTag();

$busquedas is a fieldset. With this code translation is not working for element palabrasClaveBusqAvanzada. But if I change $this->formRow($busquedas->get('tipoBusqueda')) for $this->formHidden($busquedas->get('tipoBusqueda') then translation IS working for palabrasClaveBusqAvanzada.

My translation is defined like this:

return array(
    'service_manager' => array(
        'factories' => array (
                   '...',
                   'translator' => 'Zend\Mvc\Service\TranslatorServiceFactory',
        ),
    ),
    'translator' => array(
        'locale' => 'es_ES',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
                'text_domain' => 'salesianos_td'
            ),
        ),
    ),

Originally posted by @didgewind at zendframework/zend-form#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant