Zend_Locale - firefox doesn't show region, only language

295 Views Asked by At

I have an issue with Firefox. I am trying to create multi language page using Zend_Translate with gettex adapter.

Here's part of my Bootstrap:

    protected function _initTranslate()
    {
        $locale = new Zend_Locale(Zend_Locale::BROWSER);
        Zend_Registry::set('Zend_Locale', $locale);
        
        
        $translate = new Zend_Translate('gettext', 
                    APPLICATION_PATH . "/langs/", 
                    null, 
                    array('scan' => Zend_Translate::LOCALE_DIRECTORY));
        $registry = Zend_Registry::getInstance();
        $registry->set('Zend_Translate', $translate);
        
        $translate->setLocale($locale);
        
    }

The thing is: Chrome and Safari give me locale with both language and region (i.e en_US, pl_PL) which is fine, but Fierox only gives me the language and not region ('en', 'pl'). When I add my two languages to my 'lang' folders ('pl_PL', 'en_US') Firefox crushes telling me:

Notice: The language 'pl' has to be added before it can be used. in /home/users/witkowicz/www/bwitkowicz/moyo/library/Zend/Translate/Adapter.php on line 435

Notice: No translation for the language 'pl' available. in /home/users/witkowicz/www/bwitkowicz/moyo/library/Zend/Translate/Adapter.php on line 448

Notice: The language 'pl' has to be added before it can be used. in /home/users/witkowicz/www/bwitkowicz/moyo/library/Zend/Translate/Adapter.php on line 435

Notice: No translation for the language 'pl' available. in /home/users/witkowicz/www/bwitkowicz/moyo/library/Zend/Translate/Adapter.php on line 448

Fatal error: Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in /home/users/witkowicz/www/bwitkowicz/moyo/library/Zend/Translate/Adapter.php, line 435'

Even if I force locale to be:

$translate->setLocale('pl_PL');

... it still throws an error

0

There are 0 best solutions below