Class: I2CE Locales: Difference between revisions

From IHRIS Wiki
No edit summary
(Redirected page to Class: I2CE Locales (4.1.7))
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article desrcibes the class ''I2CE_Locales''.
#REDIRECT [[Class: I2CE_Locales (4.1.7)]]
*Location: Part of the module [[iHRIS Module List#I2CE|I2CE]] in the package [https://launchpad.net/i2ce I2CE]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.0-release/annotate/head:/lib/I2CE_Locales.php lib/I2CE_Locales.php]
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===
*Type: static protected $request_locale
 
===$preferred_locale===
*Type: static protected $preferred_locale
 
==Methods==
===ensureSelectableLocale()===
*Signature: static public function ensureSelectableLocale($locale,$fallback_site_preferred)
*Parameters:
**$locale
**$fallback_site_preferred
***Default Value: true
===ensureValidResolution()===
*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
*Signature: static public function getAvailableLocales()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the locales
===getBrowserPreferredLocale()===
*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
*Signature: static public function getBrowserPrefferedLocales()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
===getLocaleResolution()===
Gets the resolution of search paths for a locale
*Signature: static public function getLocaleResolution($locale,$ensure_selectable)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $locale
**$ensure_selectable
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string;
===getPreferredLocale()===
Get the preferred locale.  Checks against the selectable locales
*Signature: static public function getPreferredLocale()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>$locale
===getPreferredLocales()===
Get the preffered  locales in order of decreasing preference
*Signature: static public function getPreferredLocales()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>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.
*Signature: static public function getSelectableLocales()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
===getSitePreferredLocale()===
*Signature: static public function getSitePreferredLocale()
===isSetPreferredLocale()===
*Signature: static public function isSetPreferredLocale($locale)
*Parameters:
**$locale
***Default Value: null
===isSetPreferredLocales()===
*Signature: static protected function isSetPreferredLocales()
===mapLanguageToLocale()===
attempt to map a language to a locale based on the selectable locales
*Signature: static public function mapLanguageToLocale($locale)
*Parameters:
**$locale
*Returns: mixed.<br/>false on failure. string on success
===setPreferredLocale()===
Set the preferred locale.  Checks against the selectable locales
*Signature: static public function setPreferredLocale($locale)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php 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.
*Signature: static protected function setPreferredLocales($locales)
*Parameters:
**$locales
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the locales that were set.
===setSitePreferredLocale()===
*Signature: static public function setSitePreferredLocale($locale)
*Parameters:
**$locale
===validateLocales()===
*Signature: static public function validateLocales($locales)
*Parameters:
**$locales
 
 
[[Category:Class Documentation]]

Latest revision as of 08:40, 23 August 2013