Moodle  2.2.1
http://www.collinsharper.com
tool_customlang_utils Class Reference

Static Public Member Functions

static list_components ()
static checkout ($lang, progress_bar $progressbar=null)
static checkin ($lang)
static get_count_of_modified ($lang)
static save_filter (stdclass $data, stdclass $persistant)
static load_filter (stdclass $persistant)

Data Fields

const ROUGH_NUMBER_OF_STRINGS = 16500

Static Protected Member Functions

static get_localpack_location ($lang)
static dump_strings ($lang, $component, $strings)
static get_component_filename ($component)

Static Protected Attributes

static $components = null

Detailed Description

Provides various utilities to be used by the plugin

All the public methods here are static ones, this class can not be instantiated

Definition at line 33 of file locallib.php.


Member Function Documentation

static checkin ( lang) [static]

Exports the translator database into disk files

Parameters:
mixed$langlanguage code

Definition at line 205 of file locallib.php.

Here is the call graph for this function:

static 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$langlanguage code to checkout
progress_bar$progressbaroptionally, the given progress bar can be updated

Definition at line 93 of file locallib.php.

Here is the call graph for this function:

static dump_strings ( lang,
component,
strings 
) [static, protected]

Writes strings into a local language pack file

Parameters:
string$componentthe name of the component
array$strings

Local language pack from $CFG->wwwroot

$packageinfo http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Definition at line 257 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static get_component_filename ( component) [static, protected]

Returns the name of the file where the component's local strings should be exported into

Parameters:
string$componentnormalized name of the component, eg 'core' or 'mod_workshop'
Returns:
string|boolean filename eg 'moodle.php' or 'workshop.php', false if not found

Definition at line 338 of file locallib.php.

static get_count_of_modified ( lang) [static]

Returns the number of modified strings checked out in the translator

Parameters:
string$langlanguage code
Returns:
int

Definition at line 358 of file locallib.php.

static get_localpack_location ( lang) [static, protected]

Returns full path to the directory where local packs are dumped into

Parameters:
string$langlanguage code
Returns:
string full path

Definition at line 245 of file locallib.php.

Here is the caller graph for this function:

static list_components ( ) [static]

Returns a list of all components installed on the server

Returns:
array (string)legacyname => (string)frankenstylename

Definition at line 55 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static load_filter ( stdclass $  persistant) [static]

Loads the previously saved filter settings from a persistent storage

See also:
self::save_filter()
Parameters:
stdclass$persistantstorage object
Returns:
stdclass filter data

Definition at line 389 of file locallib.php.

static 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$datafilter values
stdclass$persistantstorage object

Definition at line 371 of file locallib.php.


Field Documentation

$components = null [static, protected]

Definition at line 42 of file locallib.php.

const 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.

Definition at line 39 of file locallib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations