|
Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Provides various utilities to be used by the plugin. More...
Static Public Member Functions | |
| static | checkin ($lang) |
| Exports the translator database into disk files. More... | |
| static | checkout ($lang, progress_bar $progressbar=null) |
| Updates the translator database with the strings from files. More... | |
| static | get_count_of_modified ($lang) |
| Returns the number of modified strings checked out in the translator. More... | |
| static | list_components () |
| Returns a list of all components installed on the server. More... | |
| static | load_filter (stdclass $persistant) |
| Loads the previously saved filter settings from a persistent storage. More... | |
| static | save_filter (stdclass $data, stdclass $persistant) |
| Saves filter data into a persistant storage such as user session. More... | |
Public Attributes | |
| const | ROUGH_NUMBER_OF_STRINGS = 16500 |
| Rough number of strings that are being processed during a full checkout. More... | |
Static Protected Member Functions | |
| static | dump_strings ($lang, $component, $strings) |
| Writes strings into a local language pack file. More... | |
| static | get_component_filename ($component) |
| Returns the name of the file where the component's local strings should be exported into. More... | |
| static | get_localpack_location ($lang) |
| Returns full path to the directory where local packs are dumped into. More... | |
Provides various utilities to be used by the plugin.
All the public methods here are static ones, this class can not be instantiated
|
static |
Exports the translator database into disk files.
| mixed | $lang | language code |
|
static |
Updates the translator database with the strings from files.
This should be executed each time before going to the translation page
| string | $lang | language code to checkout |
| progress_bar | $progressbar | optionally, the given progress bar can be updated |
|
staticprotected |
Writes strings into a local language pack file.
| string | $component | the name of the component |
| array | $strings |
| void |
|
staticprotected |
Returns the name of the file where the component's local strings should be exported into.
| string | $component | normalized name of the component, eg 'core' or 'mod_workshop' |
| string|boolean | filename eg 'moodle.php' or 'workshop.php', false if not found |
|
static |
Returns the number of modified strings checked out in the translator.
| string | $lang | language code |
| int |
|
staticprotected |
Returns full path to the directory where local packs are dumped into.
| string | $lang | language code |
| string | full path |
|
static |
Returns a list of all components installed on the server.
| array | (string)legacyname => (string)frankenstylename |
|
static |
Loads the previously saved filter settings from a persistent storage.
| stdclass | $persistant | storage object |
| stdclass | filter data |
|
static |
Saves filter data into a persistant storage such as user session.
| stdclass | $data | filter values |
| stdclass | $persistant | storage object |
| const tool_customlang_utils::ROUGH_NUMBER_OF_STRINGS = 16500 |
Rough number of strings that are being processed during a full checkout.
This is used to estimate the progress of the checkout.