ZF-4114: shift private methods to protected ones in Zend_Translate_Adapter_Xliff so that it can be easily extended

Issue Type: Improvement Created: 2008-08-29T05:03:56.000+0000 Last Updated: 2008-08-29T06:13:45.000+0000 Status: Resolved Fix version(s): Reporter: Remy Damour (remy215) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:



I was wondering if it could be possible to change all private methods defined in Zend_Translate_Adapter_Xliff into protected ones?

I wanted to create a subclass with small changes to fit my purposes (basically use own defined ids as array keys for $this->_translate instead of source strings), which could have been easily done overloading ->_startElement() method which unfortunately is defined as private.

For now I've copy-pasted the code into a new class and made my changes there, but by doing this it won't benefit further improvements from Zend_Framework updates. It would be really great.

Thanks for the job anyway!

Regards, Remy


Posted by Thomas Weidner (thomas) on 2008-08-29T06:13:25.000+0000

Changing the ID brakes translation.

The adapter classes are not allowed to be extended because of the risk of information loss. This would lead to severe problems with the base class.

The only way is to create a own adapter and use this as base for translations.

If there are problems with the actual implementation please add a issue. If you see enhancements please also add a issue as probably also other adapters may benefit from it.

Have you found an issue?

See the Overview section for more details.


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

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