You are located in service: RWTHmoodle

Multi-language content filter

Multi-language content filter

Anleitung

Content can be provided in two languages in RWTHmoodle. As a manager, you store the content in German and English, and a language filter automatically ensures that participants in the course room only see the text in the language they have currently selected as the system language in their profile menu.

The multi-language content filter can be used wherever HTML is used - for example, in text and media areas, in activity names and descriptions, or generally whenever the text editor is available.



Contents


Option 1: Mark content as bilingual directly via HTML

With the multi-language content filter, you can manually store content in two languages (German/English) using HTML. However, this option is more complicated than the second option below. Step-by-step instructions:

  1. Open the activity or resource in which you want to insert bilingual content (e.g., text and media field or page).
  2. Switch to HTML mode in the desired text input field by selecting View → Source Code in the menu bar.
    Screenshot from a menu bar in the text editor. The menu items “Edit,” “View” (selected), “Insert,” “Format,” “Tools,” “Table,” and ‘Help’ are visible. Under “View,” the “Source Code” option is selected and therefore highlighted in blue.
     
  3. Insert the text in German and English. Enclose each language version in the following HTML elements:

    Screenshot of a source code window. Two lines of HTML code are visible in the window. The first line contains a span element with lang="DE" and class="multilang" as well as the text: “Hier kommt der Inhalt in Deutsch”. The second line contains a span element with lang="EN" and class="multilang" as well as the text: “And here is the same content in English.”

    <span lang="DE" class="multilang">Hier kommt der Inhalt in Deutsch</span>
    <span lang="EN" class="multilang">And here is the same content in English</span>
     
  4. Then click Save.
  5. To verify that both language versions are displayed correctly, save the activity (“Save and return to course” or “Save and display”) and then change the system language in the profile menu. If both language blocks are visible at the same time, there is an error in the HTML code that you need to correct.
 

Option 2: Mark content as bilingual using the language filter button

The language filter can be used not only via HTML, but also conveniently via a globe button  in the toolbar of the text editor. This allows bilingual content (German/English) to be stored without having to enter the HTML code manually.

Step-by-step instructions:

  1. Open the activity or work material in which you want to insert bilingual content (e.g., text and media field or page).
  2. First, create the desired text in German and English.
    Screenshot of a text editor with a menu bar and a toolbar. The text field reads: “Hier kommt der Inhalt in Deutsch” and below that “And here is the same content in English.”
     
  3. Select the text in a language (e.g., German).
  4. Click on the language filter button (globe icon) in the editor toolbar   and select the appropriate language.
    Screenshot of a text editor with a menu bar and a toolbar. The text field reads: “Hier kommt der Inhalt in Deutsch” and below that “And here is the same content in English.” In the toolbar a globe icon is clicked, which opens a drop-down menu. The drop-down menu shows various language options: “Remove all lang tags,” ‘German’ (this option is selected), “English,” and “Fallback.”

    The text is automatically inserted into a language container that correctly identifies it:

    Screenshot of a text editor with a menu bar and a toolbar. The text field contains: “{mlang de} Hier kommt der Inhalt in Deutsch {mlang}” (the language tags “{mlang de}” were automatically added and are highlighted in yellow). Below that it says: “And here is the same content in English”. No language tags have been added here yet.
     
  5. Repeat the process for the other language (e.g., English) by selecting the corresponding text passage.
  6. Click on the language filter button again and select the appropriate language (e.g., English). This text will also be automatically inserted into a language container.
    Screenshot of a text editor with a menu bar and a toolbar. The text field contains: “{mlang de} Hier kommt der Inhalt in Deutsch {mlang}” (the language tags “{mlang de}” and “{mlang}” were added automatically and are highlighted in yellow). Below that it says: “{mlang en} And here is the same content in English {mlang}”. (The language tags “{mlang en}” and {mlang} were added automatically and are highlighted in yellow).
     
  7. To verify that both language versions are displayed correctly, save the activity (“Save and return to course” or “Save and display”) and then change the system language in the profile menu. If both language blocks are visible at the same time, there is an error in the HTML code that you need to correct.

  

 

Notes and recommendations

  • HTML mode and language filter button not available everywhere: In some input lines (e.g., when entering the name of a section, an activity, or in other places without a text editor), the editor toolbar is not available, meaning that neither HTML mode nor the language filter button can be used. However, you can still insert and save prepared HTML code directly in these fields - the language filter also works reliably in these fields.
    Screenshot of an input line without a text editor labeled “Title in course index.” The input line contains the text: <span class="multilang" lang="DE">Titel in Deutsch </span> <span class="multilang" lang="EN">Title in English </span> The input field therefore shows HTML code for the language filter, which was inserted manually.
     
  • Files and external materials: The multil-lang content filter only works on texts that are stored in the course room in HTML format. Uploaded documents (e.g., PDFs) must therefore be provided separately in German and English.
     
  • Bilingual content for more complex activities: For extensive activities (e.g., Quiz), all content - including questions, answer options, and feedback - would have to be maintained in two languages. This can be very time-consuming and confusing. In such cases, it may make more sense to create separate activities (i.e., one in German and one in English) instead of mapping everything in one activity using the language filter.
 
 

Zusatzinformation

Further Information:

last changed on 08/27/2025

How did this content help you?

GNU General Public License 3
This work is licensed under a GNU General Public License