Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

locale

Summary

Fetches the current or a specified locale.

Usage

fetch( 'content', 'locale' [, hash( 'locale_code', locale_code ) ] )

Parameters

NameTypeDescriptionRequired
locale_code string The code of the locale to be fetched. No.

Returns

An ezlocale object.

Description

This function fetches either the default/current locale (specified using the "Locale" directive within the "[RegionalSettings]" block of "site.ini") or the locale specified by the optional "locale_code" parameter. The "locale_code" must be a valid locale code, for example "eng-GB", "nor-NO" and so on. Locales are listed and specified in the "share/locale" directory.

Examples

Example 1

 

{fetch( 'content', 'locale' )}


Fetches and returns the current locale.

Example 2

 

{fetch( 'content', 'locale', hash( 'locale_code', 'rus-RU' ) )}


Fetches and returns the Russian locale.

Balazs Halasy (18/03/2007 2:54 pm)

Svitlana Shatokhina (22/03/2007 9:51 am)

Balazs Halasy, Svitlana Shatokhina


Comments

There are no comments.