On Tue, Dec 11, 2012 at 9:14 AM, Andreas Möller <[email protected]> wrote:
>> Would it be possible to use the constants in the translation files
>> rather than the text messages? Instead of
>>
>> "Invalid type given. String, integer or float expected" => "..."
>>
>> use
>>
>> Zend\I18n\Validator\Alnum::INVALID => "..."
>>
>> So, when a text in the validator class is changed, then the translation
>> will not automatically be broken again.
>
> While this is probably a great idea in terms of maintainability, I'm not so 
> sure about the mechanism that loads the translations. Will the translation 
> files only be loaded when I use the specific validator? If not, using the 
> constants will load all the validator classes, when the translation files are 
> loaded, no?

IIRC, the constants are supposed to be used as translation keys;
however, please check with DASPRiD, cgmartin, and Bakura to be sure
(or look int the source of the form element errors view helper). If
this is the case, it makes the old files doubly broken.

--
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

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


Reply via email to