Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
core_string_manager_install Class Reference

Fetches minimum strings for installation. More...

Inheritance diagram for core_string_manager_install:
core_string_manager

Public Member Functions

 __construct ()
 Crate new instance of install string manager.
 
 get_list_of_countries ($returnall=false, $lang=null)
 Returns a localised list of all country names, sorted by country keys. More...
 
 get_list_of_currencies ($lang=null)
 Returns localised list of currencies. More...
 
 get_list_of_languages ($lang=null, $standard='iso6392')
 Returns a localised list of languages, sorted by code keys. More...
 
 get_list_of_translations ($returnall=false)
 Returns localised list of installed translations. More...
 
 get_revision ()
 Returns string revision counter, this is incremented after any string cache reset. More...
 
 get_string ($identifier, $component='', $a=null, $lang=null)
 Get String returns a requested string. More...
 
 load_component_strings ($component, $lang, $disablecache=false, $disablelocal=false)
 Load all strings for one component. More...
 
 reset_caches ($phpunitreset=false)
 This implementation does not use any caches. More...
 
 string_deprecated ($identifier, $component)
 Has string been deprecated? More...
 
 string_exists ($identifier, $component)
 Does the string actually exist? More...
 
 translation_exists ($lang, $includeall=true)
 Checks if the translation exists for the language. More...
 

Protected Attributes

string $installroot
 location of pre-install packs for all langs
 

Detailed Description

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.

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

Member Function Documentation

◆ get_list_of_countries()

core_string_manager_install::get_list_of_countries (   $returnall = false,
  $lang = null 
)

Returns a localised list of all country names, sorted by country keys.

Parameters
bool$returnallreturn all or just enabled
string$langmoodle translation language, null means use current
Return values
arraytwo-letter country code => translated name.

Implements core_string_manager.

◆ get_list_of_currencies()

core_string_manager_install::get_list_of_currencies (   $lang = null)

Returns localised list of currencies.

Parameters
string$langmoodle translation language, null means use current
Return values
arraycurrency code => localised currency name

Implements core_string_manager.

◆ get_list_of_languages()

core_string_manager_install::get_list_of_languages (   $lang = null,
  $standard = 'iso6392' 
)

Returns a localised list of languages, sorted by code keys.

Parameters
string$langmoodle translation language, null means use current
string$standardlanguage list standard iso6392: three-letter language code (ISO 639-2/T) => translated name.
Return values
arraylanguage code => translated name

Implements core_string_manager.

◆ get_list_of_translations()

core_string_manager_install::get_list_of_translations (   $returnall = false)

Returns localised list of installed translations.

Parameters
bool$returnallreturn all or just enabled
Return values
arraymoodle translation code => localised translation name

Implements core_string_manager.

◆ get_revision()

core_string_manager_install::get_revision ( )

Returns string revision counter, this is incremented after any string cache reset.

Return values
intlang string revision counter, -1 if unknown

Implements core_string_manager.

◆ get_string()

core_string_manager_install::get_string (   $identifier,
  $component = '',
  $a = null,
  $lang = null 
)

Get String returns a requested string.

Parameters
string$identifierThe identifier of the string to search for
string$componentThe module the string is associated with
string | object | array$aAn object, string or number that can be used within translation strings
string$langmoodle translation language, null means use current
Return values
stringThe String !

Implements core_string_manager.

◆ load_component_strings()

core_string_manager_install::load_component_strings (   $component,
  $lang,
  $disablecache = false,
  $disablelocal = false 
)

Load all strings for one component.

Parameters
string$componentThe module the string is associated with
string$lang
bool$disablecacheDo not use caches, force fetching the strings from sources
bool$disablelocalDo not use customized strings in xx_local language packs
Return values
arrayof all string for given component and lang

Implements core_string_manager.

◆ reset_caches()

core_string_manager_install::reset_caches (   $phpunitreset = false)

This implementation does not use any caches.

Parameters
bool$phpunitresettrue means called from our PHPUnit integration test reset

Implements core_string_manager.

◆ string_deprecated()

core_string_manager_install::string_deprecated (   $identifier,
  $component 
)

Has string been deprecated?

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

Parameters
string$identifierThe identifier of the string to search for
string$componentThe module the string is associated with
Return values
booltrue if deprecated

Implements core_string_manager.

◆ string_exists()

core_string_manager_install::string_exists (   $identifier,
  $component 
)

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!

Parameters
string$identifierThe identifier of the string to search for
string$componentThe module the string is associated with
Return values
boottrue if exists

Implements core_string_manager.

◆ translation_exists()

core_string_manager_install::translation_exists (   $lang,
  $includeall = true 
)

Checks if the translation exists for the language.

Parameters
string$langmoodle translation language code
bool$includeallinclude also disabled translations
Return values
booltrue if exists

Implements core_string_manager.


The documentation for this class was generated from the following file: