I'm facing problem while using translator in ZF2. i.e it accepting only inline string not Php variables.
It is working perfect and showing translator word in .PO file after "Update", when i give inline string to translate
$translator = $this->getServiceLocator()->get('translator');
$translator->translate("message to translate") ;
But i want to translate the string which is saved in PHP variable. It is not showing translator word in .PO file after "Update". See the code bellow.
$translator = $this->getServiceLocator()->get('translator');
$msg1="message to translate";
$translator->translate($msg1) ;
This code is from one of my controller action.
Please advice