Not honouring: Multi-Language Content (v2) "Always use parent languages, including 'en'" ?

Not honouring: Multi-Language Content (v2) "Always use parent languages, including 'en'" ?

از John Gourlay در
Number of replies: 5

Course full name:

{mlang en_ca}2026 SKS/Basic Cruising/Basic Powerboat Instructor Development Clinic Materials{mlang}{mlang fr_ca}Candidat instructeur Croisière élémentaire et Initiation à la voile croisière (IVQ) Cahier de travail du candidat (Examens thématiques){mlang}

Course tile displays properly signed in as administrator. When signed in as a student, the course image is displayed but not the course full name if English is selected. It displays correctly in French if French is selected.

 

{mlang en,en_ca}2026 SKS/Basic Cruising/Basic Powerboat Instructor Development Clinic Materials{mlang}{mlang fr_ca}Candidat instructeur Croisière élémentaire et Initiation à la voile croisière (IVQ) Cahier de travail du candidat (Examens thématiques){mlang}

displays correctly in English and in French (without fr,fr_ca), so not apparently honouring the "Always use parent languages, including 'en'." setting.

Students language is set to en_ca.

Theme is Adaptable. I do have some customs CSS to display the full name:

/* Front page course tiles (frontpage-category-combo): wrap course titles, no ellipsis */
#page-site-index #frontpage-category-combo .coursebox .coursebox-content a h3 {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    display: block !important;
    font-size: 18px;
}

Moodle 5.1

Multi-Language Content (v2)

filter_multilang2

2.0.5.2

 

blobid1.pngAdaptable

theme_adaptable

501.1.1

2025092506

 

میانگین امتیازات:  -
In reply to John Gourlay

Not honouring: Multi-Language Content (v2) "Always use parent languages, including 'en'" ?

از John Gourlay در
Also, not working in Name for assignments... No text, no link...
In reply to John Gourlay

Not honouring: Multi-Language Content (v2) "Always use parent languages, including 'en'" ?

از Iñaki Arenaza در
عکس Core developers عکس Documentation writers عکس Peer reviewers عکس Plugin developers

Hi John,

as I replied in the Multi-Language Content (v2) plugin page, nothing has change in the code in the last year or so.

But having read your description of the issue, and going back to the help text that we added in version 2.5.0 (and later tweaked in version 2.5.01), I now see that the help texts examples (and the examples in the README.md file) are wrong. What they say and what the plugin code does are not the same thing, so they are totally misleading (see at the end of this post for more details)

And this is maybe what is happening in your case (I'm not 100% sure). So let me try to explain what the plugin will do in the case of the "language blocks" that you have posted.

Your first example is composed of two language blocks, one after the other (shown below with a bit of formatting, to better show the structure of the language blocks):

{mlang en_ca}
    2026 SKS/Basic Cruising/Basic Powerboat Instructor Development Clinic Materials
{mlang}
{mlang fr_ca}
    Candidat instructeur Croisière élémentaire et Initiation à la voile croisière (IVQ) Cahier de travail du candidat (Examens thématiques)
{mlang}

In the "language block", the specified languages are en_ca and fr_ca. Those are the ones that the filter need to determine if they need to be displayed or not.

Now the filter takes what I call the "user's active language" (the one set in his or her profile, the one he or she selected in the Moodle Language selector, etc. that is, the language that is used to display Moodle UI at the moment). And it computes all the parent languages of that "user's active language".

To use a concrete example, let's assume that a Student's active language is en_ca. And for this example, let's assume that the filter is configured with the "Always use parent languages, including 'en'" (which your case).

In this case the filter starts with the en_ca language and gets the list of all "ancestors" of that language (the parent, the grand parent, the grand-grand parent, etc). And if en is one of such ancestors, it is kept in the list. Because we have configured the filter to "include it".

So for the Student's case, the list of parent languages is just en (the parent language of en_ca is en, and en doesn't have any parent languages).

Now the filter takes the first language block (the {mlang en_ca} 2026 SKS/Basic ... {mlang} one) and checks if any the languages specified in that language block (just en_ca in this case) match either the "user's active language" (en_ca in this case), or any of the languages in the parent list (just en in this case). In this case there is such a match (the en_ca from the language block matches the en_ca from the Student's "user's active language"). Thus, the text of that language block is displayed.

The filter applies the same algorithm to the second language block (the {mlang fr_ca} Candidat instructeur ... {mlang} one). And this time it doesn't find any match: fr_ca is neither the "user's active language (en_ca) nor any of the parent languages (just en in this case).

If the Student's "user's active language" was fr_ca, the first text would not be displayed, but the second would. For any other "user's active language" (including en and fr) none of the texts would be displayed!

This is exactly what happens in a test Moodle site, installed from scratch using Moodle 5.1.3+ (Build: 20260403), with the standard theme, and multilang2 plugin version 2.0.5.2. I selected "English (en)" from the Moodle language selector, and none of the two texts were displayed. Same when I selected "Frech (fr)". Or "Español (es)". Or any other language except for "English (Canada) (en_ca)" or "Français (Canada) (fr_ca)".

Regarding your second example (formatted again, for clarity purposes):

{mlang en,en_ca}
    2026 SKS/Basic Cruising/Basic Powerboat Instructor Development Clinic Materials
{mlang}
{mlang fr_ca}
    Candidat instructeur Croisière élémentaire et Initiation à la voile croisière (IVQ) Cahier de travail du candidat (Examens thématiques)
{mlang}

The only difference is that now the first language block also includes en in the block languages. Now the filter tries to match both en and en_ca to the "user's active language" and the parent languages list. If the Student's active language is en_ca or fr_ca, the same algorithm and results that we discussed in the first example apply. In those cases the filter would display the first text or the second (respectively).

The difference is that now, if the Student's active language is en ("English (en)" in Moodle), the filter will display the first text to the Student (while it won't in the first example, as I already explained).

Again, this is exactly what happens in my development and test Moodle site.

So I don't know what might be going on in your Moodle site, but I am unable to reproduce your issue ناراحت

Saludos.

Iñaki.

P.S. I have updated the help texts and examples in the git repository, to fix the errors and try to make it clearer how the filter works, but I haven't published a new version yet (I still have to update the French and Basque help texts). But, again, the code is the same as it was.

In reply to Iñaki Arenaza

Not honouring: Multi-Language Content (v2) "Always use parent languages, including 'en'" ?

از Séverin TERRIER در
عکس Documentation writers عکس Particularly helpful Moodlers عکس Testers عکس Translators
Hi Iñaki,

Thank you for this detailed answer, and exemples.

Concerning updating the help strings in French and Basque, it needs to be done in AMOS.

Séverin