Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Installation time string manager.

Copyright: 2010 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 261 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_string_manager_install  - X-Ref

Fetches minimum strings for installation

Minimalistic string fetching implementation
that is used in installer before we fetch the wanted
language pack from moodle.org lang download site.

__construct()   X-Ref
Crate new instance of install string manager


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

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: boot true if exists

string_deprecated($identifier, $component)   X-Ref
Has string been deprecated?

No deprecated string in installation, unused strings are simply removed.

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_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 !

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

reset_caches($phpunitreset = false)   X-Ref
This implementation does not use any caches.

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