Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
|
Public Member Functions | |
get_language_dependencies ($lang) | |
Returns list of all explicit parent languages for the given language. | |
get_list_of_countries ($returnall=false, $lang=null) | |
Returns a localised list of all country names, sorted by localised name. | |
get_list_of_currencies ($lang=null) | |
Returns localised list of currencies. | |
get_list_of_languages ($lang=null, $standard='iso6391') | |
Returns a localised list of languages, sorted by code keys. | |
get_list_of_translations ($returnall=false) | |
Returns localised list of installed translations. | |
get_performance_summary () | |
Returns information about the core_string_manager performance. | |
get_revision () | |
Returns string revision counter, this is incremented after any string cache reset. | |
get_string ($identifier, $component='', $a=null, $lang=null) | |
Get String returns a requested string. | |
load_component_strings ($component, $lang, $disablecache=false, $disablelocal=false) | |
Load all strings for one component. | |
mock_string (string $identifier, string $component, string $value,) | |
Mock a string. | |
reset_caches ($phpunitreset=false) | |
Clears both in-memory and on-disk caches. | |
string_deprecated ($identifier, $component) | |
Has string been deprecated? | |
string_exists ($identifier, $component) | |
Does the string actually exist? | |
translation_exists ($lang, $includeall=true) | |
Checks if the translation exists for the language. | |
Protected Member Functions | |
get_key_suffix () | |
Returns cache key suffix, this enables us to store string + lang menu caches in local caches on cluster nodes. | |
load_deprecated_strings () | |
Parses all deprecated.txt in all plugins lang locations and returns the list of deprecated strings. | |
populate_parent_languages ($lang, array $stack=array()) | |
Helper method that recursively loads all parents of the given language. | |
|
protectedinherited |
Returns cache key suffix, this enables us to store string + lang menu caches in local caches on cluster nodes.
We can not use prefix because it would cause problems when creating subdirs in cache file store.
string |
|
inherited |
Returns list of all explicit parent languages for the given language.
English (en) is considered as the top implicit parent of all language packs and is not included in the returned list. The language itself is appended to the end of the list. The method is aware of circular dependency risk.
string | $lang | the code of the language |
array | all explicit parent languages with the lang itself appended |
|
inherited |
Returns a localised list of all country names, sorted by localised name.
bool | $returnall | return all or just enabled |
string | $lang | moodle translation language, null means use current |
array | two-letter country code => translated name. |
Implements core_string_manager.
|
inherited |
Returns localised list of currencies.
string | $lang | moodle translation language, null means use current |
array | currency code => localised currency name |
Implements core_string_manager.
|
inherited |
Returns a localised list of languages, sorted by code keys.
string | $lang | moodle translation language, null means use current |
string | $standard | language list standard
|
array | language code => translated name |
Implements core_string_manager.
|
inherited |
Returns localised list of installed translations.
bool | $returnall | return all or just enabled |
array | moodle translation code => localised translation name |
Implements core_string_manager.
|
inherited |
Returns information about the core_string_manager performance.
array |
|
inherited |
Returns string revision counter, this is incremented after any string cache reset.
int | lang string revision counter, -1 if unknown |
Implements core_string_manager.
|
inherited |
Get String returns a requested string.
string | $identifier | The identifier of the string to search for |
string | $component | The module the string is associated with |
string | object | array | $a | An object, string or number that can be used within translation strings |
string | $lang | moodle translation language, null means use current |
string | The String ! |
Implements core_string_manager.
|
inherited |
Load all strings for one component.
string | $component | The module the string is associated with |
string | $lang | |
bool | $disablecache | Do not use caches, force fetching the strings from sources |
bool | $disablelocal | Do not use customized strings in xx_local language packs |
array | of all string for given component and lang |
Implements core_string_manager.
|
protectedinherited |
Parses all deprecated.txt in all plugins lang locations and returns the list of deprecated strings.
Static variable is used for caching, this function is only called in dev environment.
array | of deprecated strings in the same format they appear in deprecated.txt files: "identifier,component" where component is a normalised component (i.e. "core_moodle", "mod_assign", etc.) |
core\tests\mocking_string_manager::mock_string | ( | string | $identifier, |
string | $component, | ||
string | $value ) |
Mock a string.
string | $identifier | |
string | $component | |
string | $value |
void |
|
protectedinherited |
Helper method that recursively loads all parents of the given language.
string | $lang | language code |
array | $stack | list of parent languages already populated in previous recursive calls |
array | list of all parents of the given language with the $lang itself added as the last element |
|
inherited |
Clears both in-memory and on-disk caches.
bool | $phpunitreset | true means called from our PHPUnit integration test reset |
Implements core_string_manager.
|
inherited |
Has string been deprecated?
Usually checked only inside get_string() to display debug warnings.
string | $identifier | The identifier of the string to search for |
string | $component | The module the string is associated with |
bool | true if deprecated |
Implements core_string_manager.
|
inherited |
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. Note: Use with care!
string | $identifier | The identifier of the string to search for |
string | $component | The module the string is associated with |
boot | true if exists |
Implements core_string_manager.
|
inherited |
Checks if the translation exists for the language.
string | $lang | moodle translation language code |
bool | $includeall | include also disabled translations |
bool | true if exists |
Implements core_string_manager.