Multi-Language Content (v2)

Filters ::: filter_multilang2
Maintained by Iñaki Arenaza, Iñigo Zendegi Urzelai, Kepa Urzelai
This filter is a greatly simplified multi-language filter. It uses very simple non-HTML tags to mark multi-language blocks. Namely {mlang XX} {mlang} pairs, where XX is the Moodle short name for the language pack (i.e., en, fr, eu, es, es_mx, etc.) It uses the same tags as the filter_multilangsecond plugin (to be compatible with it), but there is one difference between the two. This filter allows standalone {mlang} tags that don't require adjoining alternative language tags. This makes the filter more flexible at the cost of potentially producing empty sets of tags.
Latest release:
2514 sites
51 fans
Current versions available: 3

To Install it manually

  • Unzip the plugin in the moodle .../filter/ directory.

To Enable it

  • Go to "Site Administration >> Plugins >> Filters >> Manage filters" and enable the plugin there.

To Use it

  • Create your contents in multiple languages.
  • Enclose every language content between {mlang NN} and {mlang} tags:
    {mlang XX}content in language XX{mlang}
    {mlang YY}content in language YY{mlang}
    {mlang other}content for other languages{mlang}
  • where XX and YY are the Moodle short names for the language packs (i.e., en, fr, de, etc.) or the special language name 'other'.
  • Version 1.1.1 and later: a new enhanced syntax to be able to specify multiple languages for a single tag is now available. Just specify the list of the languages separated by commas:
  {mlang XX,YY,ZZ}Text displayed if current lang is XX, YY or ZZ, or one of their parent laguages.{mlang}
  • Test it (by changing your browsing language in Moodle).

How it works

  • Look for "lang blocks" in the text to be filtered.
  • For each "lang block":
    • If there are texts in the currently active language, print them.
    • Else, if there exist texts in the current parent language, print them.
    • Else, as fallback, print the text with language 'other' if such one is set.
  • Text outside of "lang blocks" will always be shown.

Definition of "lang block"

Is any text (including spaces, tabs, linefeeds or return characters) placed between '{mlang XX}' and '{mlang}' markers. You can not only put text inside "lang block", but also images, videos or external embedded content. For example, this is a valid "lang block":

{mlang es,es_mx,es_co}
First paragraph of text. First paragraph of text. First paragraph of text.

Second paragraph of text. Second paragraph of text. Second paragraph of text.

                   An image could go here

Third paragraph of text. Third paragraph of text. Third paragraph of text.

                   An embedded Youtube video could go here

Fourth paragraph of text. Fourth paragraph of text. Fourth paragraph of text.

A couple of examples in action

Using text only

This text:

  {mlang other}Hello!{mlang}{mlang es,es_mx}¡Hola!{mlang}
  This text is common for all languages because it's outside of all lang blocks.
  {mlang other}Bye!{mlang}{mlang it}Ciao!{mlang}
  • If the current language is any language except "Spanish International", "Spanish - Mexico" or Italian, it will print:
  This text is common for all languages because it's outside of all lang blocks.
  • If the current language is "Spanish International" or "Spanish - Mexico", it will print:
  This text is common for all languages because it's outside of all lang blocks.
  • Notice the final 'Bye!' / 'Ciao!' is not printed.
  • If the current language is Italian, it will print:
  This text is common for all languages because it's outside of all lang blocks.
  • Notice the leading 'Hello!' / '¡Hola!' and the final 'Bye!' are not printed.

Using text, images and external embedded content

We create a label with the content shown in the following image:

Multi-Language content in Spanish, English, an language-independent content

The "lang block" tags are highlighted using blue boxes. You can see that we have three pieces of content: the Spanish-only content (light yellow box), the language-independent content (light blue) and the English-only content (light red).

If the user browses the page with English as her configured language, she will see the common content (light blue box) and the English-only content (light red):

Multi-Language content when browsed in English

If the user browses the page with Spanish as her configured language, she will see the Spanish-only content (light yellow) plus the common content (light blue box):

Multi-Language content when browsed in Spanish


Screenshot #0
Screenshot #1
Screenshot #2


Iñaki Arenaza (Lead maintainer)
Iñigo Zendegi Urzelai
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Wed, Jul 8, 2020, 8:25 PM
    FYI: I tested it and it seems to work well with Moodle 3.9.
  • Thu, Aug 20, 2020, 6:35 PM
    i have a problem with multi lang add on.
    While it is working with books, pages, headings etc. it does not work with course summary.
    Any suggestions?
  • Sat, Aug 22, 2020, 12:50 AM
    Hi @Valadis Kefalis

    As suggested by Michael Milette, are you testing it with the Boost or Classic theme? Many non-core themes have issues with filters in general (not just multilang2, but any filter). So before digging further, can you confirm that it doesn't work in the course summary if you use the Boost or Classic theme?


  • Thu, Nov 19, 2020, 9:23 PM
    Hi! I want to know whether this plugin is available by default in any of the version of Moodle or I need to install it separatelly every time I want to upgrade the Moodle version? I can not find this information (or I don't know where to search ;) ). Thank you for help in advance.
  • Thu, Nov 19, 2020, 9:40 PM
    Hi Oktawia,

    All the plugins of the plugin database (and this one too) are non-standard plugins, so you'll have to install them in addition to the Moodle core on every Moodle instance you want to use it.
  • Tue, Jan 5, 2021, 12:28 AM
    I have a question about this plugin according to course names. I'm using this plugin to create a platform fully displayed in 9 different languages. How can I apply this to course names? I know that it is working - I checked based on 2-3 languages, but the field is too short to type all 9 languages. Is there any way of how I can overcome this issue? Maybe you have some tips for me how can I make it possible to apply all of the 9 languages?
    Thank you for any advices and information in advance!
  • Tue, Jan 5, 2021, 3:54 AM
    Unfortunately it is not easily possible to expand the course name field. It would require you to make and maintain at least two customizations in Moodle, one to increase the size of the field in the database and the other to modify the size of the field for the course name. Note that you may encounter similar limitations in other parts of Moodle.

    For more information on this issue and some workarounds, see
  • Fri, Feb 12, 2021, 11:04 PM
    Hello Iñaki, Iñigo and Kepa,

    Your plugin is absolutely amazing. Thank you so much for this.
    I am using it with the Edwiser RemUI theme and Edwiser's course formats. In some areas such as course description in the list of all courses, the {mlang} tags do not work. Instead you see the entire string unfiltered, i.e. {mlang en}Let's study together{mlang}{mlang ja}一緒に勉強しましょう{mlang}.

    Reading the comments here it seems like it may be an issue with the Edwiser course formats and theme not calling specific functions or missing something in their code that can display your plugin. I would like to ask them about this and if they can fix it.

    Can you please advise what your plugin requires in their code to properly display? I do not know how to describe it to them so they can see if it is something they can fix on their side.

    Thank you in advance.
  • Fri, Feb 12, 2021, 11:12 PM
    Hi Raymond,

    This plugin only require the call of the standard functions to apply the filters in Moodle, usually format_string or format_text.
  • Sun, May 30, 2021, 2:36 AM
    Dear Multilanguage plugin team,
    First of all, thank you for this plugin, it simplified a lot my life, definitively.
    But I'm having a problem, and I can't find a solution for it. When applying the language mark separator in menus with links, it turns out that it doesn't recognize the link, and this is crucial to make proper use of a multilanguage site (proper use of the menus). Can you give some hint of how to overcome this?

    Anyway, thank you for your work. It continuos amazing

  • Sun, May 30, 2021, 3:24 AM
    Hi Tiago,

    I am not the developer of the Multi-Language Content v2 plugin but I am a big fan and the developer of the FilterCodes plugin which works in a very similar way but for different purposes (like creating context aware dynamic menus).

    Unfortunately Moodle does not yet include support for these types of {tags} in the custom menu. You have three options:

    1) Fix your Moodle theme or get the developer who created it to add the fix.

    2) Fix Moodle. The advantage of this approach is that it will not only fix it for your theme but almost any Moodle theme that you might use.

    The instructions on how to do #1 and #2 above can be found at:

    And of course, if you fix it for Multi-language Content v2, the fix will also work for FilterCodes which might be useful for you too. I have been creating multi-language Moodle sites since many years using this plugin and these fixes work great. Just remember to re-apply the patch anytime you upgrade Moodle or your theme.

    3) if you don't to modify Moodle or your theme, there is a way to do multi-language menus without any plugins or tags at all. You will find information on how to do this at:

    Tip: Depending on your version of Moodle, you may need to group your menu items by language in order for it to work. Example: all your English menu items followed by all your French ones.

    Consider asking your questions in the Moodle discussion forums in the future. You will find many more people like me who love to help people with their Moodle questions. You might even discover that you can pay it forward and help others too.

    Hope you found something useful in all of this.

    Best regards,

    Michael Milette
  • Sun, Jun 27, 2021, 7:49 PM
    Is there any plans to enable translating the Tags using this plugin?
  • Mon, Jun 28, 2021, 5:03 PM
    Hi @Naaman

    I'm afraid that's not in our hands sad. The plugin can only translate (filter) content that is run through format_string() or format_text() functions. So it's up to the Tags code to use those functions to renderi the Tags on the page. You will need to open an issue in the Moodle Tracker for the Tags component and ask about it.


  • Thu, Jul 29, 2021, 2:40 PM
    Good morning, and thanks for the plugin!
    Is it possible to have multilang titles as well? I tried to use lang tags, but of course they are ignored!
    Moodle 3.10
    Thanks again
  • Thu, Jul 29, 2021, 6:05 PM
    Hi Davide,

    Yes, indeed. To apply the multilang filter to the course and category titles you have to set it to apply to "Content and headings" in 'Site administration' > 'Plugins' > 'Filters' > 'Manage filters'.
1 2 3 4 5
Please login to post comments