List Info

Thread: RE: PHP 5.2.6 and Zend_Translate




RE: PHP 5.2.6 and Zend_Translate
country flaguser name
United Kingdom
2008-05-06 14:13:38
Hi,

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

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

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

print_r(&quot;List languages (getList) : ");
print_r($translate-&gt;getList());

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

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

print_r(&quot;List languages (getList) : ");
print_r($translate-&gt;getList());

HTTP_ACCEPT_LANGUAGE: en-gb
List languages (getList) : Array
(
 &nbsp;  [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 [ thomas.weidnergmx.at">mailto:thomas.weidnergmx.at]
Sent: 06 May 2008 19:39
To: Robert Castley; fw-generallists.zend.com
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&quot; <Robert.Castleymacro4.com>
To: <fw-generallists.zend.com>
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.&nbsp; 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:&nbsp;  <http://framework.zend.com/wiki/x/p6o>
> http://framework.zend.com/wiki/x/p6o
>
> Shall I log an issue?&nbsp; 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.
________________________________________________________________________
Re: PHP 5.2.6 and Zend_Translate
user name
2008-05-06 14:25:44
Looks like you have not installed SPL.

Directory scanning works with RecursiveDirectoryIterator and

RecursiveIteratorIterator.
When eigther of these two is not available the result would
be like 
described from you.

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

----- Original Message ----- 
From: "Robert Castley" <Robert.Castleymacro4.com>
To: <fw-generallists.zend.com>
Sent: Tuesday, May 06, 2008 9:13 PM
Subject: RE: [fw-general] PHP 5.2.6 and Zend_Translate


> 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:thomas.weidnergmx.at]
> Sent: 06 May 2008 19:39
> To: Robert Castley; fw-generallists.zend.com
> 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" <Robert.Castleymacro4.com>
> To: <fw-generallists.zend.com>
> 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://frame
work.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.
>
____________________________________________________________
____________ 


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )