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.

(no description)

Copyright: Gaetan Frenoy <gaetan@frenoy.net>
Copyright: 2004 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 134 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

filter_multilang:: (3 methods):
  filter()
  process_match()
  get_parent_lang()


Class: filter_multilang  - X-Ref

Implementation of the Moodle filter API for the Multi-lang filter.

filter($text, array $options = array()   X-Ref
No description

process_match(array $langblock)   X-Ref
This is the callback used by the preg_replace_callback call above.

param: array $langblock one of the matches from the regex match.
return: string the replacement string (one of the possible translations).

get_parent_lang(string $lang)   X-Ref
Puts some caching around get_parent_language().

Also handle parent == 'en' in a way that works better for us.

param: string $lang a Moodle language code, e.g. 'fr'.
return: string the parent language.