Displaying text in multiple languages
The multi-language content filter enables resources to be created in multiple languages. When turned on, it looks for <span lang=”xx” class=”multilang”> tags which indicate that a text contains multiple languages. Then it selects and outputs the text in the user’s language (as set in their browser or in their preferences).
An admin can enable the multi-language content filter as follows:
How to use in a course
To use this feature first create your content in multiple languages (in the same resource). Then enclose each language block (aka multilang block) in the following tags:
<span lang="XX" class="multilang">your_content_here</span> <span lang="YY" class="multilang">your_content_in_other_language_here</span>
It is essential to be in the code editing mode (press [<>] in the HTML editor), when you enter these tags for them to work. Only spaces, tabs and enters can be used between the individual languages in the multilang block.
Note: If your site uses a child language pack (see Language packs for the list), then the first span tag must be the parent language. Otherwise, when a user using the child language views the text, it will not be in the correct language for them (as reported in MDL-55197). For example, if your site uses en_us then the en span tag (as parent language) must be first i.e.
<span lang="en" class="multilang">your_content_in English</span> <span lang="de" class="multilang">your_content_in_German_here</span>
How to use for assignment submission agreements
<span lang="en" class="multilang">This assignment is my own work, except where I have acknowledged the use of the works of other people.</span> <span lang="fr" class="multilang">Ce devoir est le fruit de mon travail personnel, sauf aux endroits où l'utilisation d'oeuvre d'autres auteurs est clairement indiquée.</span>
How it works internally
https://moodle.org/plugins/filter_multilang2
Go to “Site Administration >> Plugins >> Filters >> Manage filters” and enable the plugin there.
{mlang XX}content in language XX{mlang} {mlang YY}content in language YY{mlang} {mlang other}content for other languages{mlang}
{mlang XX,YY,ZZ}Text displayed if current lang is XX, YY or ZZ, or one of their parent laguages.{mlang}