Hi,

In my custom plugin ( http://framework.zend.com/wiki/x/p6o ) I do check for
the language

<snippet>
if (!$translate->isAvailable($locale->getLanguage())) {
    $locale->setLocale('en');
}
</snippet>

This works fine under PHP 5.2.5.  By adding some trace I see the following:

print_r("List languages (getList) : ");
print_r($translate->getList());

HTTP_ACCEPT_LANGUAGE: en-gb
List languages (getList) : Array
(
    [de] => de
    [en] => en
    [es] => es
    [fr] => fr
    [it] => it
)

If I switch to PHP 5.2.6 (and nothing else changes) I get:

print_r("List languages (getList) : ");
print_r($translate->getList());

HTTP_ACCEPT_LANGUAGE: en-gb
List languages (getList) : Array
(
    [en_GB] => en_GB
)

Really strange ... It seems as though with PHP 5.2.6 it won't scan and pick
up the other languages in the languages directory.

- Robert


-----Original Message-----
From: Thomas Weidner [mailto:[EMAIL PROTECTED] 
Sent: 06 May 2008 19:39
To: Robert Castley; [email protected]
Subject: Re: [fw-general] PHP 5.2.6 and Zend_Translate

This error is thrown by Zend_Translate when you try to translate a language
which does not exist.

I got no problem with 5.2.6, and you are free to add a issue.
But you could help yourself and look which language exists before throwing
in a new issue.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Robert Castley" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, May 06, 2008 8:31 PM
Subject: [fw-general] PHP 5.2.6 and Zend_Translate


> Scanning for language files with Zend_Translate was working beautifully 
> with
> PHP 5.2.5.
>
> Trying out PHP 5.2.6 and this no longer works.  Anyone else found the 
> same?
>
> I get the error:
> Fatal error: Uncaught exception 'Zend_Translate_Exception' with message
> 'Language (en) has to be added before it can be used.'
>
>
> I am using my custom Plugin:   <http://framework.zend.com/wiki/x/p6o>
> http://framework.zend.com/wiki/x/p6o
>
> Shall I log an issue?  Or is this an issue with PHP itself?
>
>
>
> Robert W. Castley
>
> Macro 4
>
>
>
>
>
>
> ________________________________________________________________________
> This email has been scanned for all known viruses by the MessageLabs Email

> Security Service and the Macro 4 plc internal virus protection system.
> ________________________________________________________________________ 


________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________


________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________

Reply via email to