String manager interface.
Copyright: | 2010 Petr Skoda {@link http://skodak.org} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 140 lines (5 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
core_string_manager:: (11 methods):
get_string()
string_exists()
string_deprecated()
get_list_of_countries()
get_list_of_languages()
translation_exists()
get_list_of_translations()
get_list_of_currencies()
load_component_strings()
reset_caches()
get_revision()
Interface: core_string_manager - X-Ref
Interface for string managerget_string($identifier, $component = '', $a = null, $lang = null) X-Ref |
Get String returns a requested string param: string $identifier The identifier of the string to search for param: string $component The module the string is associated with param: string|object|array $a An object, string or number that can be used param: string $lang moodle translation language, null means use current return: string The String ! |
string_exists($identifier, $component) X-Ref |
Does the string actually exist? get_string() is throwing debug warnings, sometimes we do not want them or we want to display better explanation of the problem. Use with care! param: string $identifier The identifier of the string to search for param: string $component The module the string is associated with return: bool true if exists |
string_deprecated($identifier, $component) X-Ref |
Has string been deprecated? Usually checked only inside get_string() to display debug warnings. param: string $identifier The identifier of the string to search for param: string $component The module the string is associated with return: bool true if deprecated |
get_list_of_countries($returnall = false, $lang = null) X-Ref |
Returns a localised list of all country names, sorted by country keys. param: bool $returnall return all or just enabled param: string $lang moodle translation language, null means use current return: array two-letter country code => translated name. |
get_list_of_languages($lang = null, $standard = 'iso6392') X-Ref |
Returns a localised list of languages, sorted by code keys. param: string $lang moodle translation language, null means use current param: string $standard language list standard return: array language code => translated name |
translation_exists($lang, $includeall = true) X-Ref |
Checks if the translation exists for the language param: string $lang moodle translation language code param: bool $includeall include also disabled translations return: bool true if exists |
get_list_of_translations($returnall = false) X-Ref |
Returns localised list of installed translations param: bool $returnall return all or just enabled return: array moodle translation code => localised translation name |
get_list_of_currencies($lang = null) X-Ref |
Returns localised list of currencies. param: string $lang moodle translation language, null means use current return: array currency code => localised currency name |
load_component_strings($component, $lang, $disablecache=false, $disablelocal=false) X-Ref |
Load all strings for one component param: string $component The module the string is associated with param: string $lang param: bool $disablecache Do not use caches, force fetching the strings from sources param: bool $disablelocal Do not use customized strings in xx_local language packs return: array of all string for given component and lang |
reset_caches($phpunitreset = false) X-Ref |
Invalidates all caches, should the implementation use any param: bool $phpunitreset true means called from our PHPUnit integration test reset |
get_revision() X-Ref |
Returns string revision counter, this is incremented after any string cache reset. return: int lang string revision counter, -1 if unknown |