I tracked the problem down to Zend_Translate:
in my Controller, I call Zend_Translate::setLocale('auto') :
file index.php (bootstrap):
$l10n = new Zend_Translate('gettext', 'application/languages',
'auto', array('scan' => Zend_Translate::LOCALE_DIRECTORY));
Zend_Registry::set('Zend_Translate', $l10n);
file NewsController.php:
$this->view->l10n = Zend_Registry::get('Zend_Translate');
$this->view->l10n->setLocale('auto');
Results in:
Fatal error: Uncaught exception 'Zend_Translate_Exception' with message
'Language (en) has to be added before it can be used.' in
/<pah_to_project>/libs/Zend/Translate/Adapter.php:279
removing the Zend_Translate::setLocale fixes the problem, but I can't get
the right locale on my scripts:
<?= $this->l10n->getLocale() ?>
Prints 'it_IT' regardless of the browser's settings (tested with Firefox
extension 'quick locale switcher')
I'm pretty sure I'm getting something wrong, probably I should get the
locale in my view scripts.
Keith Pope-3 wrote:
>
> It should still work from curl and flash as long as you are using http as
> the dispatcher is for the http protocol and not the browser.
>
> Have you turned on exception throwing in the front controller, the FC is
> looking for the error controller by the looks of it. You will get more
> info with exceptions on.
>
>
> ----- Original Message -----
> From: Flavio Curella <[EMAIL PROTECTED]>
> Sent: Wed, 9/10/2008 11:52am
> To: [email protected]
> Subject: [fw-general] Dispatcher works only with browsers?
>
>
> I built a website, and everything works fine with browsers (FF, Safari),
> but
> when trying accessing the same URLs with other user-agent (Flash, curl),
> Zend throws an InvalidControllerSpedified error:
>
> Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message
> 'Invalid controller specified (error)' in
> /Users/flavio/Sites/slowear/libs/Zend/Controller/Dispatcher/Standard.php:249
> Stack trace:
> #0 /Users/flavio/Sites/slowear/libs/Zend/Controller/Front.php(946):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http))
>
> why can it works differently with conventional browsers and with other
> user-agent?
>
> Thanks,
> Flavio Curella.
> --
> View this message in context:
> http://www.nabble.com/Dispatcher-works-only-with-browsers--tp19410291p19410291.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone,
> Hereford, HR1 3SE.
> Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88.
>
> Telephone: 0870 243 3434, Fax: 0870 243 6041.
> Website: www.allpay.net
> Email: [EMAIL PROTECTED]
>
> This email, and any files transmitted with it, is confidential and
> intended solely for the use of the individual or entity to whom it is
> addressed. If you have received this email in error please notify the
> allpay.net Information Security Manager at the number above.
>
>
--
View this message in context:
http://www.nabble.com/Dispatcher-works-only-with-browsers--tp19410291p19413267.html
Sent from the Zend Framework mailing list archive at Nabble.com.