Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400]

Helper class for the language import tool.

Copyright: 2018 Université Rennes 2 {@link https://www.univ-rennes2.fr}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 97 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

locale:: (2 methods):
  check_locale_availability()
  set_locale()


Class: locale  - X-Ref

Helper class for the language import tool.

check_locale_availability(string $langpackcode)   X-Ref
Checks availability of locale on current operating system.

return: bool TRUE if the locale is available on OS.
param: string $langpackcode E.g.: en, es, fr, de.

set_locale(int $category = LC_ALL, string $locale = '0')   X-Ref
Wrap for the native PHP function setlocale().

return: string|false Returns the new current locale, or FALSE on error.
param: int $category Specifying the category of the functions affected by the locale setting.
param: string $locale E.g.: en_AU.utf8, en_GB.utf8, es_ES.utf8, fr_FR.utf8, de_DE.utf8.