A singleton class to provide simple, generic mechanism for dealing with languages encodings, and locales. This class does not handle translation strings.
get_installed_languages() : array
Array of language names
get_language_info(string $lang) : \CmsNls
object repesenting the named language. or null.
get_current_language() : string
If not explicitly set this method will try to detect the current language. different detection mechanisms are used for admin requests vs. frontend requests. if no match could be found in any way, en_US is returned.
get_default_language() : string
This method will behave differently for admin or frontend requests.
For admin requests first the preference is checked. Secondly, an attempt is made to find a language understood by the browser that is compatible with what is avaialable. If no match can be found, en_US is assumed.
For frontend requests if a language detector has been set into this object it will be called to attempt to find a language. If that fails, then the frontend language preference is used. Thirdly, if no match is found en_US is assumed.
get_frontend_language() : string
the language returned must be available as specified by the available NLS Files.
get_admin_language() : string
The language returned must be an available language as specified by the available NLS Files. If no suitable language can be detected this function will return en_US
The language name
detect_browser_language() : string
First suitable lang string. or nothing.
get_browser_languages() : array
of Strings representing the languages the browser supports.
get_encoding() : \string.
If an encoding has not been explicitly set, the default_encoding value from the config file will be used If that value is empty, the encoding associated with the current language will be used. If no suitable encoding can be found, UTF-8 will be assumed.
The encoding (comma separated encodings is acceptable.
if language has not been set... does nothing. will use the locale from the nls information for the current locale if config entry is set... it will be used, but subsequent calls to this method will do nothing.
The module can provide an object derived from CmsLanguageDetector to this method.
Note, this module must return a language for which there is an available NLS file.
find_nls_match(string $str) : \hash
An approximate language specification (an alias matchis done if possible).
containing NLS information.