Forums / Developer / Current Locale/Siteaccess informations

Current Locale/Siteaccess informations

Author Message

Antoine W.

Wednesday 17 August 2005 7:56:12 am

Hi everybody !
I'm trying to get the following informations :
- Locale name (in example eng-GB)
- Currency
- Current siteaccess

How can I find these informations ?
Thanks!

Antoine W.

Monday 29 August 2005 7:21:25 am

No idea ? How to get the current language ("locale") ? o_O

Bertrand Dunogier

Monday 29 August 2005 10:21:15 am

You can use ezini for at the locale (I assume it's inside a template ? It's almost the same in PHP code anyway):

ezini('RegionalSettings', 'ContentLocale', 'site.ini')

You also have ContentObjectLocale if that's what you want.

For siteaccess err... I'm not sure the siteaccess name is stored in the siteaccess settings, actually, but you have to give it a try :)

For the currency, it is part of the locale file (share/locale/eng-GB.ini), the currency is in there, but I don't really know how you can get it. Check how the l10n operator is implemented, it fetches that info somehow.

Antoine W.

Tuesday 30 August 2005 1:03:45 am

Thanks Bertrand ! Getting locale from settings works fine, and I'll try to find how to get the currency.