Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Zend Fieldset translation breaks when using formRow helper before #112

Open
didgewind opened this issue Aug 4, 2016 · 1 comment
Open

Comments

@didgewind
Copy link

didgewind commented Aug 4, 2016

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'
            ),
        ),
    ),
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at laminas/laminas-form#26.

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

No branches or pull requests

2 participants