Hi,
I thought I would take the Preview Release for a spin. But I immediately
hit an issue with Zend_Translate.
My error message is:
Notice: No translation for the language 'en_GB' available. in
/Users/rwc/Sites/ZendFramework-SVN/library/Zend/Translate/Adapter.php on
line 301
I have a language plugin I call in my bootstrap. This works perfectly under
1.6.3, here is the code:
<?php
class Magik_Plugin_Language extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$locale = new Zend_Locale();
$frontendOptions = array(
'automatic_cleaning_factor' => 0,
'cache_id_prefix' => 'Magik_',
'lifetime' => null
);
$backendOptions = array(
'cache_dir' => CACHE
);
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
$backendOptions);
Zend_Translate::setCache($cache);
$options = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('csv', 'languages', 'auto',
$options);
if ($translate->isAvailable($locale->getLanguage()) != 1) {
$locale->setLocale('en');
}
$translate->setLocale($locale->getLanguage());
setcookie('lang', $locale->getLanguage(), null, '/');
Zend_Registry::set('locale', $locale->getLanguage());
Zend_Registry::set('Zend_Translate', $translate);
}
}
The other interesting thing to note is that in my cache directory with 1.6.3
I get two files, but with the PR I get loads! One for each lang file and
one for each file under my CVS directory (repository, entries, root etc).
I had a look at the docs online and there was some mention of Zend Locale
compatibility mode which I have set to false, but still no luck.
Any pointers?
Cheers,
- Robert
________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________