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.

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

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

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.

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