class LanguageManager

Language selection manager

Methods

static LanguageManager
getInstance()

Returns LanguageManager singleton

array
listLocaleDir()

Returns list of available locales

array
availableLocales()

Returns (cached) list of all available locales

boolean
hasChoice()

Checks whether there are some languages available

availableLanguages()

Returns (cached) list of all available languages

sortedLanguages()

Returns (cached) list of all available languages sorted by name

Language|false
getLanguage(string $code)

Return Language object for given code

getCurrentLanguage()

Return currently active Language object

selectLanguage()

Activates language based on configuration, user preferences or browser

void
showWarnings()

Displays warnings about invalid languages. This needs to be postponed to show messages at time when language is initialized.

string
getSelectorDisplay(Template $template, boolean $use_fieldset = false, boolean $show_doc = true)

Returns HTML code for the language selector

Details

at line 678
static LanguageManager getInstance()

Returns LanguageManager singleton

Return Value

LanguageManager

at line 691
array listLocaleDir()

Returns list of available locales

Return Value

array

at line 730
array availableLocales()

Returns (cached) list of all available locales

Return Value

array of strings

at line 750
boolean hasChoice()

Checks whether there are some languages available

Return Value

boolean

at line 760
Language[] availableLanguages()

Returns (cached) list of all available languages

Return Value

Language[] array of Language objects

at line 796
Language[] sortedLanguages()

Returns (cached) list of all available languages sorted by name

Return Value

Language[] array of Language objects

at line 812
Language|false getLanguage(string $code)

Return Language object for given code

Parameters

string $code Language code

Return Value

Language|false Language object or false on failure

at line 827
Language getCurrentLanguage()

Return currently active Language object

Return Value

Language Language object

at line 838
Language selectLanguage()

Activates language based on configuration, user preferences or browser

Return Value

Language

at line 916
void showWarnings()

Displays warnings about invalid languages. This needs to be postponed to show messages at time when language is initialized.

Return Value

void

at line 942
string getSelectorDisplay(Template $template, boolean $use_fieldset = false, boolean $show_doc = true)

Returns HTML code for the language selector

Parameters

Template $template Template instance
boolean $use_fieldset whether to use fieldset for selection
boolean $show_doc whether to show documentation links

Return Value

string