Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401]

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.

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.