Search code examples
zend-frameworkzend-translate

Disable translation for special controllers


is there any possibility to disable the language translator for a controller? This example controller only delivers images.

$this->_helper->layout->disableLayout();
$this->_helper->translator ???

TIA Matt


Solution

  • If you initialize the translator in bootstrap by including it in the Zend Registry, maybe you could just unset the Zend_Translate entry in it from the init() method of the controller, which is called after the bootstrap.

    Unsetting a single value in the Zend_Registry is not so trivial. In short, you need to do something like this:

    $registry = Zend_Registry::getInstance();
    unset($registry['Zend_Translate']); 
    

    Hope that helps,