ZF-5547: Allow to build the list of untranslated message IDs

Issue Type: New Feature Created: 2009-01-14T10:22:59.000+0000 Last Updated: 2009-02-20T13:45:20.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Joseph Chereshnovsky (webdevbyjoss) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:


In Zend_Translate_Adapter file we have following method:

<pre class="highlight">
    public function translate($messageId, $locale = null)
         // ..... method code ........

        // no translation found, return original
        return $messageId;

so if no translation found for particular message ID then original message Id returned.

Any way, its good to have the mechanism to collect untranslated message IDs and for example build some untranslated IDs list or add some missed translations reporting mechanism. Also such functionality would be good on application development stage to debug interface internationalization functionality.

From my point of view it need to have some enableTrackingMissedId() / disableTrackingMissedId() And then at the end we can call ->getUntranslatedIds(); receive the list of all untranslated message Ids and use this array for further purposes.



Posted by Thomas Weidner (thomas) on 2009-01-14T11:00:00.000+0000

Use the isTranslated() method and log the requested translation when the method returns false. All other ways are not practicable.

Posted by Joseph Chereshnovsky (webdevbyjoss) on 2009-01-14T11:26:03.000+0000

The purpose of this feature was to use view helper $this->translate('My translatable message!') as usually. So the solution I see will be to add custom translation view helper that will proxify calls to Zend_Translate_Adapter.

Issue can be closed now in such case, hope this issue can be useful for others who have the same goal as me. Thanks Thomas.

Posted by Thomas Weidner (thomas) on 2009-02-02T12:45:59.000+0000

New feature added to trunk.

Under code review since 02.Feb.09

Posted by Joseph Chereshnovsky (webdevbyjoss) on 2009-02-10T09:13:58.000+0000

Tested, and it works OK. Thanks!

just notice, - we can check if provided object implements required interface but not the "instanceof" particular class, here: 233: if (($key == 'log') && !($option instanceof Zend_Log)) { then custom class can be used to process the untranslated MessageIds, with no need to use huge Zend_Log with custom Log Writer, etc...

Posted by Thomas Weidner (thomas) on 2009-02-10T10:48:13.000+0000

And which interface ? Zend_Log does not implement any interface so there is no interface to check for.

When doing your own Log implementation you would just have to extend Zend_Log and do what you need.

Posted by Thomas Weidner (thomas) on 2009-02-10T12:48:10.000+0000

To mention... Code reviews are done by the dev-team and not by the community. I am just waiting for the response to my request.

Posted by Thomas Weidner (thomas) on 2009-02-20T13:45:16.000+0000

New feature added with r14128

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.