Provides various utilities to be used by the plugin.
More...
|
static | checkin ($lang) |
| Exports the translator database into disk files.
|
|
static | checkout ($lang, progress_bar $progressbar=null) |
| Updates the translator database with the strings from files.
|
|
static | get_count_of_modified ($lang) |
| Returns the number of modified strings checked out in the translator.
|
|
static | get_localpack_location ($lang) |
| Returns full path to the directory where local packs are dumped into.
|
|
static | list_components () |
| Returns a list of all components installed on the server.
|
|
static | load_filter (stdclass $persistant) |
| Loads the previously saved filter settings from a persistent storage.
|
|
static | save_filter (stdclass $data, stdclass $persistant) |
| Saves filter data into a persistant storage such as user session.
|
|
|
static | dump_strings ($lang, $component, $strings) |
| Writes strings into a local language pack file.
|
|
static | get_component_filename ($component) |
| Returns the name of the file where the component's local strings should be exported into.
|
|
Provides various utilities to be used by the plugin.
All the public methods here are static ones, this class can not be instantiated
◆ checkin()
static tool_customlang_utils::checkin |
( |
| $lang | ) |
|
|
static |
Exports the translator database into disk files.
- Parameters
-
◆ checkout()
static tool_customlang_utils::checkout |
( |
| $lang, |
|
|
progress_bar | $progressbar = null ) |
|
static |
Updates the translator database with the strings from files.
This should be executed each time before going to the translation page
- Parameters
-
string | $lang | language code to checkout |
progress_bar | $progressbar | optionally, the given progress bar can be updated |
◆ dump_strings()
static tool_customlang_utils::dump_strings |
( |
| $lang, |
|
|
| $component, |
|
|
| $strings ) |
|
staticprotected |
Writes strings into a local language pack file.
- Parameters
-
string | $component | the name of the component |
array | $strings | |
- Return values
-
◆ get_component_filename()
static tool_customlang_utils::get_component_filename |
( |
| $component | ) |
|
|
staticprotected |
Returns the name of the file where the component's local strings should be exported into.
- Parameters
-
string | $component | normalized name of the component, eg 'core' or 'mod_workshop' |
- Return values
-
string|boolean | filename eg 'moodle.php' or 'workshop.php', false if not found |
◆ get_count_of_modified()
static tool_customlang_utils::get_count_of_modified |
( |
| $lang | ) |
|
|
static |
Returns the number of modified strings checked out in the translator.
- Parameters
-
- Return values
-
◆ get_localpack_location()
static tool_customlang_utils::get_localpack_location |
( |
| $lang | ) |
|
|
static |
Returns full path to the directory where local packs are dumped into.
- Parameters
-
- Return values
-
◆ list_components()
static tool_customlang_utils::list_components |
( |
| ) |
|
|
static |
Returns a list of all components installed on the server.
- Return values
-
array | (string)legacyname => (string)frankenstylename |
◆ load_filter()
static tool_customlang_utils::load_filter |
( |
stdclass | $persistant | ) |
|
|
static |
Loads the previously saved filter settings from a persistent storage.
- See also
- self\save_filter()
- Parameters
-
stdclass | $persistant | storage object |
- Return values
-
◆ save_filter()
static tool_customlang_utils::save_filter |
( |
stdclass | $data, |
|
|
stdclass | $persistant ) |
|
static |
Saves filter data into a persistant storage such as user session.
- See also
- self\load_filter()
- Parameters
-
stdclass | $data | filter values |
stdclass | $persistant | storage object |
◆ ROUGH_NUMBER_OF_STRINGS
const tool_customlang_utils::ROUGH_NUMBER_OF_STRINGS = 32000 |
Rough number of strings that are being processed during a full checkout.
This is used to estimate the progress of the checkout.
The documentation for this class was generated from the following file:
- admin/tool/customlang/locallib.php