LanguageManager
class LanguageManager (View source)
Language selection manager
Properties
static LanguageManager|null | $instance | ||
static TextDirection | $textDirection |
Methods
Returns LanguageManager singleton
Returns list of available locales
Returns (cached) list of all available locales
Checks whether there are some languages available
Returns (cached) list of all available languages
Returns (cached) list of all available languages sorted by name
Return Language object for given code
Return currently active Language object
Activates language based on configuration, user preferences or browser
Displays warnings about invalid languages. This needs to be postponed to show messages at time when language is initialized.
Details
__construct(Config $config)
No description
static LanguageManager
getInstance()
Returns LanguageManager singleton
array
listLocaleDir()
Returns list of available locales
array
availableLocales()
Returns (cached) list of all available locales
bool
hasChoice()
Checks whether there are some languages available
array
availableLanguages()
Returns (cached) list of all available languages
array
sortedLanguages()
Returns (cached) list of all available languages sorted by name
Language|false
getLanguage(string $code)
Return Language object for given code
Language
getCurrentLanguage()
Return currently active Language object
Language
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.
void
activate(Language $language)
Activates given translation