17. Multilingual content
Section outline
-
Moodle can basically handle multiple languages. So-called “language packs” are used for this purpose.
However, these language packs only apply to texts that are an integral part of the learning platform, such as menu labels or automatic texts. And their display depends on several settings. I will try to break all of this down in this course so that all users are able to create multilingual posts, content, or even entire courses: -
To offer your own course content in multiple languages, a few things are needed in addition to the translation itself:
- A special course filter must be enabled (usually enabled by default), and
- the different language versions of the text need to be stored accordingly.
-
Excursus: HTML vs. WYSIWYG
At the end of the day, Moodle is just a website written in HTML (HyperText Markup Language, info). HTML is a markup language, meaning a way of structuring documents in which both the actual content and properties, relationships, and formatting are described within the same document.
An example:
<h3>Überschrift</h3>
<p>Dies ist der Text, mache Worte sind <strong>speziell formatiert</strong>.</p>In the HTML snippet above, an element of type headline with hierarchy level 3 (= h3) is created. Its beginning is marked by an opening tag (<h3>) and its end by the matching closing tag (</h3>). The content of the element is “Überschrift”, where German umlauts may - depending on the character encoding of the document - be written using the (outdated) entity notation (Ü = Ü).
This is followed by a paragraph (<p>...</p>), in which another string is formatted in bold (<strong>).All websites you see in your browser work exactly like this. Your browser is just kind enough to render the HTML code, meaning it does not show the raw HTML but instead displays the headings, paragraphs, and bold text as such.
Moodle editors, however, work in WYSIWYG mode, i.e. they try to generate standards-compliant HTML in the background from the text you enter. So if you format a text as a list using the editor buttons, for example:
- List item 1
- List item 2
- List item 3
it will appear like that in the editor input area. In the background, however, it is saved as an unordered list (<ul>...</ul>) with several list items (<li>...</li>)
<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>
-
Besides the text fields edited with the editor, there are of course many other text elements. For example, course titles, section names, and activity names are entered in input fields without an editor. Both methods for storing multiple languages also work there.
For example, this course is called
17. {m lang de}Mehrsprachige Inhalte{m lang}{m lang en}Multilingual content{m lang}{m lang fr}Contenus multilingues{m lang}
Alternatively, the “older” technique would also work, and the title could be written as
17. <span class="multilang" lang="de">Mehrsprachige Inhalte</span><span class="multilang" lang="en">Multilingual content</span><span class="multilang" lang="fr">Contenus multilingues</span>
However, that version is a bit less handy, and there is a greater risk of hitting the character limit of the input fields because it is simply longer. The numbering (here: "17." + [space]) can be left outside, by the way, since it applies to all languages.
The same works for sections and for naming materials or activities:
Multilingual tagging also works for course names ...
... as well as for section names ...
... and for activity or material names.
If images contain text (for example labels), the graphic itself must be stored multiple times if it is supposed to appear differently in different languages. Here too, tagging via {m lang} or <span class="multilang"> works:

To control the display of, for example, documents available in several languages, so-called restrictions can be used. For most course elements, these can be configured in the respective settings:
In the course (when edit mode is turned on), it then looks like this:
The setting “otherwise hidden” (crossed-out eye icon) makes activities and materials whose restrictions are not met completely invisible. You can test that here:
Videos are of course supported by Moodle, and when embedding videos, you can also provide multiple subtitle tracks in different languages. Visitors can then use the button to select a subtitle language:
Here you can try switching between different subtitle tracks.
For this, the subtitles must be available in "Web Video Text Tracks Format" (WebVTT, file extension *.vtt). These can, for example, be created automatically using transcription tools and translated if needed. The format looks like this:
WEBVTT
00:00:21.000 --> 00:00:24.000
Hallo und herzlich willkommen zur Video-Anleitung
00:00:24.000 --> 00:00:26.000
Erste Schritte auf der Lernplattform,
00:00:26.000 --> 00:00:28.000
in der ich gerne ein Überblick über die Lernplattform
00:00:28.000 --> 00:00:31.000
der Technischen Hochschule Georg Agricola geben möchte.
As long as the timecodes—that is, the timestamps that determine when each subtitle snippet is shown—are not changed, creating another language version is fairly easy. The English counterpart of the German excerpt above would look like this:
WEBVTT
00:00:21.000 --> 00:00:24.000
Hello and welcome to the video tutorial
00:00:24.000 --> 00:00:26.000
"First Steps on the Learning Platform,"
00:00:26.000 --> 00:00:28.000
where I'd like to provide an overview of the
00:00:28.000 --> 00:00:31.000
learning platform of the Technical University Georg Agricola.
*.vtt files can easily be created in a text editor. If you already have a *.txt file, you can simply change the file extension from *.txt to *.vtt.
- Enter language tags directly:
When using the WYSIWYG variant directly in the text editor, the{m lang}tags do not necessarily have to be inserted via the button; you can also just type them directly into the text field. - Remove unnecessary spaces:
When the{m lang}tags are inserted using the corresponding button, they may include spaces before and after them, which can affect the display. These spaces can be removed without affecting the multilingual functionality.
