There is no  "defautlTranslator" like in ZF 1.11.11 ?

        $this->setDefaultTranslator($translate);

class abc_Form extends Zend_Form
{

    public function __construct($options = null) {
        :
        :
        
        $this->setDefaultTranslator($translate);
    }

Each of my form is a abc_Form instance

-----Message d'origine-----
De : Frédéric Ferri [mailto:[email protected]] 
Envoyé : jeudi 19 juillet 2012 10:19
À : [email protected]
Cc : Cédric Duchatelle
Objet : [fw-general] problem in translation in zend2 beta5

Dear Sir,

I'm working with Zend2 beta5 and experience trouble with translations.

I first tested the translate() method at the view level and it works perfectly 
with PoEdit.

I just set this in my module.config.php and everything goes fines :

     'translator' => array(
        'locale' => 'fr_FR',
        'translation_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),


Now i want to translate std error messages from validators but couldn't find a 
way to activate the use of translation files for them. As far as i can 
understand, translate helper method is only for views.

Same problem if i want to translate error messages generated by home made check 
in the controller....

Same problem to translate the form fields labels. I would like to translate 
them in the form file using something like the translate() method but i 
couldn't find any acceptable way to do it.
I can only get rid of

echo $this->formLabel($form->get('xxxx'))

in the view and replace them by

$this->translate('xxx')

but in that case i somehow lose the definition done in the form...

Could you be kind enough to tell me where i could find some 
information/examples on this topic? I'm a bit disappointed because the 
beginning of the translation process was pretty easy to implement (the view 
part)... maybe i missed something...

--
Frédéric FERRI

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to