\core\commonLanguage

This class maintains state of the selected language and can set the language.

Summary

Methods
Properties
Constants
__construct()
setTextDomain()
getLang()
getLocalisedValue()
$locale
No constants found
No protected methods found
No protected properties found
N/A
setLang()
$LANG
N/A

Properties

$locale

$locale : 

language display name for the language set by the constructor

Type

$LANG

$LANG : 

the current language

Type

Methods

__construct()

__construct() 

Constructor sets the language by calling set_lang and stores language settings in object properties additionally it also sets static variables $laing_index and $root

setTextDomain()

setTextDomain(  domain) : 

Sets the gettext domain

Parameters

domain

Returns

previous seting so that you can restore it later

getLang()

getLang() 

gets the language setting in CAT

getLocalisedValue()

getLocalisedValue(mixed|string|int  valueArray) : 

pick a proper value for a given language

Parameters

mixed|string|int valueArray

an array of (locale,content) records

Returns

localised value corresponding to the chosen locale or to the defalut locale C if a better mach was not available

setLang()

setLang(  hardSetLang) 

set_lang does all language setting magic checks if lang has been declared in the http call if not, checks for saved lang in the SESSION or finally checks browser properties.

Only one of the supported langiages can be set if a match is not found, the default langiage is used

Parameters

hardSetLang
  • this is currently not used but will allow to force lang setting if this was ever required