title: How to use translate helper in controllers in zend framework 2
body: <p>Is there any possible way to translate strings in controllers instead of view?</p>
  
  <p>Right now, in my controllers, if I pass strings like :</p>
  
  <pre><code>public function indexAction() {
      return array('message' =&gt; 'example message');
  }
  </code></pre>
  
  <p>It will be translated in index.phtml</p>
  
  <pre><code>&lt;?php print $this-&gt;translate($message);?&gt;
  </code></pre>
  
  <p>It works well, but poeditor unable to find strings from controller files</p>
  
  <p>Guess it would be cool if I can use something like :</p>
  
  <pre><code>public function indexAction() {
      return array('message' =&gt; $view-&gt;translate('example message'));
  }
  </code></pre>
  
  <p>in controllers</p>
  
  <p>Thanks in advance for help</p>