Class: I2CE Locales (Development)
This article describes the class I2CE_Locales .
- Location: Part of the module I2CE in the package I2CE 4.0-dev
- Source: Defined in the file lib/I2CE_Locales.php on line 37
I2CE_Locales @todo Better Documentation
Constants
I2CE_Locales::DEFAULT_LOCALE
The 'defualt' locale for I2CE. You should not need to change this unless you are doing something crazy.
@var string DEFAULT_LOCALE
Defined as: 'en_US'
Variables
$request_locale
- Defined in i2ce/lib/I2CE_Locales.php on line 110
- Type: static protected $request_locale
$preferred_locale
- Defined in i2ce/lib/I2CE_Locales.php on line 201
- Type: static protected $preferred_locale
Methods
ensureSelectableLocale()
- Defined in i2ce/lib/I2CE_Locales.php on line 84
- Signature: static public function ensureSelectableLocale($locale,$fallback_site_preferred)
- Parameters:
- $locale
- $fallback_site_preferred
- Default Value: true
ensureValidResolution()
- Defined in i2ce/lib/I2CE_Locales.php on line 334
- Signature: static public function ensureValidResolution($locale,$resolution)
- Parameters:
- $locale
- $resolution
getAvailableLocales()
Get all locales that are either selectable or referenced in the reosltuion of a selectable locale
- Defined in i2ce/lib/I2CE_Locales.php on line 51
- Signature: static public function getAvailableLocales()
- Returns: array
of string, the locales
getBrowserPreferredLocale()
- Defined in i2ce/lib/I2CE_Locales.php on line 220
- Signature: static public function getBrowserPreferredLocale()
getBrowserPrefferedLocales()
Get the locales that were requested by the browser in order of decreasing preferrence. @param boolean $validate. Defaults to true
- Defined in i2ce/lib/I2CE_Locales.php on line 261
- Signature: static public function getBrowserPrefferedLocales()
- Returns: array
of string
getLocaleResolution()
Gets the resolution of search paths for a locale
- Defined in i2ce/lib/I2CE_Locales.php on line 318
- Signature: static public function getLocaleResolution($locale,$ensure_selectable)
- Parameters:
- string $locale
- $ensure_selectable
- Default Value: false
- Returns: array
of string;
getPreferredLocale()
Get the preferred locale. Checks against the selectable locales
- Defined in i2ce/lib/I2CE_Locales.php on line 131
- Signature: static public function getPreferredLocale()
- Returns: string
$locale
getPreferredLocales()
Get the preffered locales in order of decreasing preference
- Defined in i2ce/lib/I2CE_Locales.php on line 66
- Signature: static public function getPreferredLocales()
- Returns: array
of string. The prefferend locales e.g. array('fr_FR','en_GB','en_US')
getSelectableLocales()
Get a list of the selectable locales for the site.. i.e. the locales that we know something about. This should not be a big list.
- Defined in i2ce/lib/I2CE_Locales.php on line 80
- Signature: static public function getSelectableLocales()
- Returns: array
of string
getSitePreferredLocale()
- Defined in i2ce/lib/I2CE_Locales.php on line 203
- Signature: static public function getSitePreferredLocale()
isSetPreferredLocale()
- Defined in i2ce/lib/I2CE_Locales.php on line 101
- Signature: static public function isSetPreferredLocale($locale)
- Parameters:
- $locale
- Default Value: null
- $locale
isSetPreferredLocales()
- Defined in i2ce/lib/I2CE_Locales.php on line 179
- Signature: static protected function isSetPreferredLocales()
mapLanguageToLocale()
attempt to map a language to a locale based on the selectable locales
- Defined in i2ce/lib/I2CE_Locales.php on line 294
- Signature: static public function mapLanguageToLocale($locale)
- Parameters:
- $locale
- Returns: mixed.
false on failure. string on success
setPreferredLocale()
Set the preferred locale. Checks against the selectable locales
- Defined in i2ce/lib/I2CE_Locales.php on line 116
- Signature: static public function setPreferredLocale($locale)
- Parameters:
- string $locale
setPreferredLocales()
Validates and sets the preferred locales for the session in order of decreasing preference. It makes sure that self::DEFAULT_LOCALE is in the list of preferred locales. @param mixed @locales. string or array of string. The preferred locale or an array of prefered locales.
- Defined in i2ce/lib/I2CE_Locales.php on line 152
- Signature: static protected function setPreferredLocales($locales)
- Parameters:
- $locales
- Returns: array
of string, the locales that were set.
setSitePreferredLocale()
- Defined in i2ce/lib/I2CE_Locales.php on line 211
- Signature: static public function setSitePreferredLocale($locale)
- Parameters:
- $locale
validateLocales()
- Defined in i2ce/lib/I2CE_Locales.php on line 187
- Signature: static public function validateLocales($locales)
- Parameters:
- $locales