I have translate.tr, translate.en, translate.fr files under application/config directory. I used to
$translate = new Zend_Translate('csv', '../application/configs/translate.tr', 'tr');
$writer = new Zend_Log_Writer_Stream('../docs/translate.txt');
$logger = new Zend_Log($writer);
$translate->setOptions(array( 'log' => $logger, 'logUntranslated' => true ));
$translate->addTranslation('../application/configs/translate.en', 'en');
$translate->addTranslation('../application/configs/translate.fr', 'fr');
Now I want application.ini file to deal with initialization. So
resources.translate.registry_key = "Zend_Translate"
resources.translate.adapter = "csv"
resources.translate.options.logUntranslated = true
resources.translate.options.scan = "directory"
resources.translate.options.disableNotices = 1
;resources.translate.options.logfile = APPLICATION_PATH "../docs/translate.txt"
resources.translate.data = APPLICATION_PATH "/../data/languages"
resources.translate.locale = "tr" ; default language
Now I think I need to show zend to know where these csv files resides. How can I show it?
Zend_Translate setup is well documented in the manual.
The application.ini
settings are just the same which you should pass as an options to the object in array format.
Take a look at the Translate
resource source code in Zend
directory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.