ZF-9371: Zend_Form_Element duplicate and missing label translation Issues
Description
In version 1.10.x
public function getLabel()
{
$translator = $this->getTranslator();
if (null !== $translator) {
return $translator->translate($this->_label);
}
return $this->_label;
}
It cause problem, because the translation is running twice. 1. When calling getLabel() 2. And the Translate adapter globaly
Before version 1.10.x worked fine.
public function getLabel()
{
return $this->_label;
}
Comments
Posted by Christian Albrecht (alab) on 2010-04-03T05:22:05.000+0000
Updated title to reflect that this issue is a parent of SubTasks now.
Posted by Christian Albrecht (alab) on 2010-05-28T05:44:49.000+0000
After reading through the Sub Tasks, older issues and most important the Zend_Form-2.0 wiki, i will move all translate calls from Zend_Form and Zend_Form_Element_* into Zend_Form_Decorator_* // edit and into Zend_View_Helper_Form* according to where the final rendering occurs, in a way that the original Element attributes won't be translated.
Posted by Christian Albrecht (alab) on 2010-06-17T13:02:00.000+0000
We had a discussion in irc where wwe thought about implementing a Decorator_Translate to do all the translations for configured attribs and/or values. http://zftalk.com/logs/view/zftalk.dev/2010/06/03/
Any Comments?
Posted by Holger Schletz (hschletz) on 2010-06-20T11:42:25.000+0000
This may be a good idea or not, but it looks like a long term solution to me. For the moment, I'd be more than happy to see the fixes (which have been around for months and work flawlessly) finally make it into a release. It's really annoying to apply them after every update.
Is there any good reason why this has not been addressed yet?
Posted by René Kerner (johndoe) on 2010-06-29T04:50:14.000+0000
vice versa linked...
Posted by Christian Albrecht (alab) on 2010-06-30T14:41:47.000+0000
Holger which fixes are you refering to?
Posted by Holger Schletz (hschletz) on 2010-07-04T07:30:41.000+0000
One of the fixes (including tests) is attached to ZF-8764. I can't find the other one ATM (already too many open bug reports about this). I have attached a patch that fixes both issues (without the tests).
Posted by Gabriel Schuster (g.schuster) on 2011-02-16T14:49:12.000+0000
2011 and still no fix for this... Can it really be true that there's no committer that is willing to apply a patch? Why not just fix it to prevent translate-logs filling with garbage and developing cool things like Decorator_Translate later?
Posted by Kai Uwe (kaiuwe) on 2011-02-17T00:10:14.000+0000
??developing cool things like Decorator_Translate??
Zend_Form 2.0 - Recommendations: Translation
{quote} Translation should be moved to the view layer. The View and Decorator chains would receive the Translator object and use it to translate appropriate labels and metadata. As such, the form, its elements, and the individual validator and validator chains would need no such knowledge of this information. {quote}
Posted by Rob Allen (rob) on 2011-11-11T19:10:45.000+0000
Duplicate of ZF-8694