Squiz Matrix
4.12.2
|
Public Member Functions | |
__construct () | |
__destruct () | |
getCurrentLocale () | |
getLocaleName ($locale_code=NULL) | |
setCurrentLocale ($locale) | |
restoreCurrentLocale () | |
getLocaleParts ($locale) | |
getCumulativeLocaleParts ($locale, $lang_sep='_', $var_sep='@') | |
getString ($string_code) | |
includeAssetStrings ($type_code, $locale=NULL) | |
includePackageStrings ($package_name, $locale=NULL) | |
includeCoreStrings ($locale=NULL) | |
raiseError ($code, $error_level) | |
getErrorMessage ($code) | |
getInternalMessageSubject ($type, $keywords, $locale=NULL) | |
getInternalMessageBody ($type, $keywords, $locale=NULL) | |
getJavascriptIncludes () | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Data Fields | |
$locale_stack = Array() | |
$_strings = Array() | |
$_errors = Array() | |
$_internal_messages = Array() | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Definition at line 32 of file locale_manager.inc.
__construct | ( | ) |
__destruct | ( | ) |
Destructor
Attempts to save state in Deja Vu to improve performance.
Definition at line 122 of file locale_manager.inc.
getCumulativeLocaleParts | ( | $locale, | |
$lang_sep = '_' , |
|||
$var_sep = '@' |
|||
) |
Splits up the locale passed into language, country, and variant and return an array consisting of all possible partial locales
This will return an array of between one and three elements, depending on what parts of the locale are in there. For example, if locale = 'fr_FR', this will return ['fr', 'fr_FR', 'fr_FR']
string | $locale | the locale that we are going to split |
string | $lang_sep | language seperator character |
string | $var_sep | variant seperator character |
Definition at line 267 of file locale_manager.inc.
getCurrentLocale | ( | ) |
Gets the code of the current locale
Returns the code of the current language, or boolean FALSE if locale stack underflowed
Definition at line 144 of file locale_manager.inc.
getErrorMessage | ( | $code | ) |
fetches an error translation for the current locale
string | $code | the error code |
Definition at line 560 of file locale_manager.inc.
getInternalMessageBody | ( | $type, | |
$keywords, | |||
$locale = NULL |
|||
) |
fetches an internal message subject translation for the current locale
string | $type | the internal message type |
array | $keywords | array of keywords |
string | $locale | name of the locale |
Definition at line 644 of file locale_manager.inc.
getInternalMessageSubject | ( | $type, | |
$keywords, | |||
$locale = NULL |
|||
) |
fetches an internal message subject translation for the current locale
string | $type | the internal message type |
array | $keywords | array of keywords |
string | $locale | name of the locale |
Definition at line 607 of file locale_manager.inc.
getJavascriptIncludes | ( | ) |
returns an array of js includes needed for the current locale
Definition at line 677 of file locale_manager.inc.
getLocaleName | ( | $locale_code = NULL | ) |
Gets the full name of a locale
string | $locale_code | the locale code to check (if omitted, uses the current locale) |
Definition at line 161 of file locale_manager.inc.
getLocaleParts | ( | $locale | ) |
Split a full locale into its parts
Can be called using, eg: list($country, $language, $variant) = $GLOBALS['SQ_SYSTEM']->lm->getLocaleParts('en_AU');
string | $locale | the full locale |
Definition at line 217 of file locale_manager.inc.
getString | ( | $string_code | ) |
gets a string translation
string | $string_code | the string code |
Definition at line 295 of file locale_manager.inc.
includeAssetStrings | ( | $type_code, | |
$locale = NULL |
|||
) |
Includes the compiled strings for a specified asset, if they haven't already
string | $type_code | the type code to include strings for |
string | $locale | the locale to use (default to current) |
Definition at line 327 of file locale_manager.inc.
includeCoreStrings | ( | $locale = NULL | ) |
Include the system-wide core strings, if they haven't already
string | $locale | the locale to include (default to current locale) |
Definition at line 457 of file locale_manager.inc.
includePackageStrings | ( | $package_name, | |
$locale = NULL |
|||
) |
Includes the strings from a package, if they haven't already
string | $package_name | the name of the package |
string | $locale | the locale to use (default = current) |
Definition at line 390 of file locale_manager.inc.
raiseError | ( | $code, | |
$error_level | |||
) |
fetches an error translation for the current locale and triggers the error
This differs from the getErrorMessage() method in that this actually calls trigger_error() as well. Use the raw getErrorMessage() where error handling needs to differ () Shortcut defined in general.inc: trigger_localised_error()
string | $code | the error code |
int | $error_level | the PHP error level (must be one of: E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE) |
Definition at line 527 of file locale_manager.inc.
restoreCurrentLocale | ( | ) |
Restore the previously set locale from the top of the stack
Definition at line 196 of file locale_manager.inc.
setCurrentLocale | ( | $locale | ) |
Sets the current locale, loading the language files if that is required
string | $locale | the locale to set |
Definition at line 180 of file locale_manager.inc.