After doing some R&D I found that Zend\I18n will be best option available to use with-in my application for translation purposes. But I am having a major issue i.e it seems that I have to instantiate a new instance of translation whenever I need translation. A quick dirty way is to use global object and I am not going to use that. I am using Zend components e.g Zend Loader + Zend I18N only.
The question is how to manage global objects given zend framework. I don't want to change class constructors for dependency injection.Please provide me some suggestion.
Edit
As someone suggested using Zend_Registry but that is deprecated in Zf2.However, closely related thing in Zf2 is ServiceManager. But I am not getting a good example of how to initialize a ServiceManager at application level and use it to get global translation service ( if I am right ).
$this->translate()for that, I don't understand the need of having a "global object". If ever you need the i18n component in your controller, just write yourself a controllerplugin that gets the i18n stuff. If you need it elsewhere, you're doing wrong. - Sam