Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

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: 84 lines (3 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.

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

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

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.
return: string|false Returns the new current locale, or FALSE on error.