ZF-6358: logging not found translations does not work with Zend_Validate, Zend_Form_Element_Multi, Zend_Dojo_Form_Element_DijitMulti

Description

Not found translations are logged in the translators translate() Method if the translations does not exist.

Zend/Validate/Abstract.php, Zend/Form/Element/Multi.php and Zend/Dojo/Form/Element/DijitMulti.php first check if there is an existing translation with isTranslated() and only if theres a translation the translate() Method is called. If the translation does not exist, the translation won't be logged because of the missing call of translate()!

I've two ways to solve this problem:

  • change Zend_Validate_Abstract etc. to just call translate() instead of checking if there is an existing translation

or

  • enable logging of missing translations in method isTranslated() in Zend_Translate

Maybe there are more components affected by this issue.

Comments

Not reproducable...

1.7.8 has no logging at all The next mini release will also not have translation as new features are only allowed with Minor releases.

The next minor release does logging on untranslated messages when you set the proper options (log and logUntranslated)

Just to note: To call "isTranslated()" which behaves exactly the same (and has internally almost the same code) instead of calling translate() when there is no translatable message is a performance neg...

In such cases, the translation should be done anyway, as long as both methods are working the same way (strict or loose).

Example:


$var = 'String';
if ($translate->isTranslated($var)) {
    $var = $translate->translate($var);
}
// looks two times for the translation array... useless

$var = $translate->($var);
// looks only ONCE AND RETURNS 'String' (the Original) when the message can not be translated

Closing as not reproducable with minor release and as there is no response.