Issues

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

Issue Type: Bug Created: 2009-04-21T01:36:28.000+0000 Last Updated: 2009-04-21T10:33:45.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Florian Hartmann (florian) Assignee: Thomas Weidner (thomas) Tags: - Zend_Dojo

  • Zend_Form
  • Zend_Translate
  • Zend_Validate

Related issues: Attachments:

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

Posted by Thomas Weidner (thomas) on 2009-04-21T02:42:08.000+0000

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)

Posted by Thomas Weidner (thomas) on 2009-04-21T02:48:53.000+0000

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:

<pre class="highlight">
$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

Posted by Thomas Weidner (thomas) on 2009-04-21T10:33:34.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts