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.

(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.