Hi,

On 11/21/06, Shekar C Reddy <[EMAIL PROTECTED]> wrote:
>
> Thomas,
>
> Please correct me if I'm wrong as I haven't gone through the Zend_Locale
> source as yet:
>
> foreach($list as $language => $content) {
>    $lang = new Zend_Locale($language);
>    print "\n<br>[".$language."] ".$lang->getLanguageDisplay($language);
> }
>
> In the above chunk, the $language argument is passed to both - the
> construct as well as the getLanguageDisplay methods. Can't the first locale
> object already created outside the loop ( for the list) return the
> language display for any language from inside the loop? Is it necessary to
> create the locale object for each language (inside the loop)?
>
> Regards,
>
>
The example was demonstrating the idea only and you can get the same result
using one object if you want.
inside the loop, instead of creating new object for each language; just use
:

$locale->setLocale($language);

this will change the used locale.

Best Regards,
--
Ahmed Shreef
Web Developer
Egypt

Reply via email to