fab2008 wrote:
> 
> 
> This is a very interesting question. I have the same problem and any
> suggestion will be useful.
> 
> At current time my idea is to make a separate single file with a copy of
> all labels and error messages and parse it with xgettext -a, but this is a
> bad practice because i have to duplicate all the strings and duplication
> is always bad :-(
> 
> 

This is what I ended up doing.  I have a dummy class with a single function
that just performs a whole host of translations.  The class will never be
used and it doesn't feel good, but it does allow the error codes to appear
in the .pot file.  I know Zend_Validate isn't supposed to actually provide
real error messages, just error codes, but it's a shame that such a method
was chosen that forces such hacks if you want to use probably the most
popular method of localisation...  Not that I can think of a better method
at the moment, and not that I'm sure there isn't a better way of using what
we have.  Ah well.  For reference, here's what I'm doing:

<?php

abstract class My_Translate {
        public static function dummy() {
                $translator = Zend_Registry::get('Zend_Translate');
                $translator->translate('isEmpty');
                // More translations here...
        }       
}

?>

Any better ways than this out there?

Cheers,

Jamie.
-- 
View this message in context: 
http://www.nabble.com/Using-a-gettext-Zend_Translate-object-with-Zend_Form-tp16092578s16154p16194510.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to