I am using ZendTranslate(csv adapter) with Smarty in my project. I use ZendTranslate as standalone not all Zend because it seems very nice and easy to use. But I have a problem. I cant find out best way to grab all content and send to Smarty. My simple code:
require_once 'Smarty/libs/Smarty.class.php';
require_once 'Zend/Translate.php';
$lang = $_GET["lang"];
$translate = new Zend_Translate(
array(
'adapter' => 'csv',
'content' => 'csv/lang_eng.csv',
'locale' => 'en'
)
);
$translate->addTranslation(
array(
'content' => 'csv/lang_' . $lang . '.csv',
'locale' => $lang
)
);
$smarty->assign("m2", "" . $translate->translate('m2', $lang));
$smarty->display("views/page.tpl");
and this is ok for one translation but I have more then 30 on one page. How to grab all of that on best way and send to Smarty?
{'Text on another language'|translate}
in every other call for a func translate will be every time instanced a class TemplateTranslate or just one time? – consigliere Sep 14 '12 at 22:10