List Info

Thread: Zend_Locale Just Staring!




Zend_Locale Just Staring!
user name
2008-04-21 13:18:59
Hi, I've just started using Zend_Locale and I have a couple
of questions
about best practices.

I can see I will need two locale objects, one for the main
website, i.e. a
user visits and I set the locale based on their connection,
or pull the data
from their profile if set.

The second case would be for prices and primarily in an
admin section. For
the shop (not converting currencies) the currency symbol
always needs to be
GBP £, therefore it can't be based on the users locale?
Also I can see in
the admin it would be nice to default to the sites default
locale just
incase you view your UK site from the US while on holiday.
You as an admin
aren't going to have wanted all the dates to have changed
format!

Do I simply create two instances of Zend_Locale, one with an
automatic
locale and one with my set locale?

Also what's the best way to use these site wide? Store them
in the registry?
Or can it be used statically at all?

I think I've cracked it otherwise.

Thanks

Simon

-----
Simon Corless

http://www.ajb007.co.uk/

-- 
View this message in context: http://www.nabble.com/Zend_Locale-Just
-Staring%21-tp16808313p16808313.html
Sent from the Zend I18N/Locale mailing list archive at
Nabble.com.


Re: Zend_Locale Just Starting!
user name
2008-04-21 13:55:11
Just another quick question, say I want to display a number
as a percent
using translation to make sure the % sign is correct.

Is it really this long winded:

echo Zend_Locale_Format::toNumber(13547.3678,
array('number_format' =>
$locale->getTranslation(null, 'PercentNumber'), 'locale'
=> $locale));

Doing:
$locale->getTranslation(13547.3678, 'PercentNumber');

Doesn't seem to do what I would expect it to do. The only
other way I can
see is to get the translation list and just use the array
value.

There must be a shorter way to write this? Or a better way
to utilise locale
symbols?

Thanks
Simon

-----
Simon Corless

http://www.ajb007.co.uk/

-- 
View this message in context: http://www.nabble.com/Zend_Locale-Jus
t-Starting%21-tp16808313p16809070.html
Sent from the Zend I18N/Locale mailing list archive at
Nabble.com.


[1-2]

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