I would like to collect strings, that has not been translated because translation is missing.
Am I able to do this?
Thanks for any help!
(This is Zend Framework 2.2 and Zend\I18n.)
ZF2 actually has this event built-in in the Translator. By default the translator component is not triggering any events, you have to explicitly enable it.
In you module.config.php
return array(
'translator'
'event_manager_enabled' => true
)
);
Now you can attach a listener to the event.
$translator = $serviceManager->get('MvcTranslator');
$translator->getEventManager()->attach('missingTranslation', function($event) {
//Do some stuff when translation is missing
var_dump($event->getParams());
});