How to manage multiple languages?

How to manage multiple languages?

by Margot Soreli -
Number of replies: 20

Hi there,

I am using Moodle 2.7 and currently only have the platform and my course in 1 language (English). 

This course has been translated in different languages.
I am planning to create a course per language and I would like to allow users to see the course which is in the language that matches their country only (e.g. an English user would only see the Moodle menu and the course in English, a French user the Moodle menu and course in French etc.).

I am trying to understand:

  • how to display the moodle menu in the right language based on the user's country
  • how to display the course in the right language only (not the courses in other languages) based on the user's country
Would you know how I could do that? All I could find is how to restrict access for an activity within a course, not for an entire course.

Thank you.

Average of ratings: -
In reply to Margot Soreli

Re: How to manage multiple languages?

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Margot,

I don't know how you intend to define langage based on the country, because some countries uses several languages. I think you'd better base your choice on language.

And, talking about different courses, you should certainly search in Enrolment plugins, perhaps "Enrol by user profile fields" to enrol users to the corresponding course(s).

Hope this helps,
Séverin

Average of ratings: Useful (4)
In reply to Margot Soreli

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Margo and Juan,

I have built many multilingual Moodle sites over the years. Unfortunately you cannot make a course appear or not appear based on the user's country however you can display a Moodle course in the user's current language.

First you will need to install the Moodle language packs for each of the languages you want to support. Depending on the theme used, this should display a language selection menu in the Moodle navigation. When a user switches language, Moodle will then display it's menus in that language.

Next, you will need to install and enable the Multi-Language Content (v2) filter. Be sure to enable it for both Content and Headings. What this will do is enable a plain text {mlang xx} tag which will give you the ability to display content in the current language. For example:

{mlang XX}content in language XX{mlang}{mlang YY}content in language YY{mlang}{mlang ZZ}content in language ZZ{mlang}

Note that if you use a particular localization of a language such as French Canadian, you will need to install both the French language pack AND the French Canadian language pack. To avoid having them both appear in the menus, you will need to specify the list of languages you want to have appear in the menu. Your {mlang} tags will also need to specify the localized language code. So where French would normally be {mlang fr}Your text in French{mlang}, for French Canadian it would be {mlang fr_ca}Your text in French Canadian{mlang}.

Don't forget to apply these tags to your site name (frontpage settings).

You can download that plugin from https://moodle.org/plugins/filter_multilang2

Now, you can't really hide courses in Moodle. However you can create multi-language courses by wrapping each piece of content (don't forget the course names) in an {mlang} set of tags. Then, not only will the user see the course in their current language, but they will be able to switch language at any time as they make their way through the course.

Another option with Moodle native courses is to make use of the activity restriction option. You can display or hide activities within a course by telling Moodle to only display if the user interface is in a specific language. To make this work, you will need to install and activate the Moodle Restriction by Language availability plugin. This is available for download from https://moodle.org/plugins/availability_language . Note the challenge you may have with this approach is in assessing course completion status since not all learners will end up completing the same activities.

Applying these strategies, you end up with a single course that works in any of the languages it supports.

Now, if you are dealing with SCORM packages, it gets much more complex and will be a little different. You can still do it however you will need to build the language selection menu into the SCORM package as well as all of the languages. You may be able to have the default language controlled by Moodle but this may require some additional customization.

On a side note, you can find information on getting started with WordPress multi-language sites by taking a look at https://www.wpbeginner.com/showcase/9-best-translation-plugins-for-wordpress-websites/ and https://github.com/qtranslate/qtranslate-xt

Hope you find this information useful.

Best regards,

Michael
Average of ratings: Useful (9)
In reply to Michael Milette

Re: How to manage multiple languages?

by Kai Niethammer -
Hi Michael,

appreciate this approach. This is how I used to setup my courses too for multiple language content.

However I still have one challenge left for the course setup.

How do you manage the course completion then? I have multiple SCORM activities implemented in two languages each. However I need to be able to take either one language of the packages into account for the course completion OR the other language packages.
Do you have any approach to this situation?

Best regards,
Kai
In reply to Kai Niethammer

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Kai,

Great question! It is one that I struggle with regularly as you bring up a challenging issue. It is not specific to SCORM activities. It happens with several completion tracking enabled activities which are not multi-language enabled such as Files, Folders and URL. I suspect that H5P will be problematic as well when it comes to multi-language course completion. The problem is, how do you track completion of one activity or another at a course level?

I realize that none of these are ideal however your current options are:
  1. Make your SCORM activities multi-language so that users can switch language from within the activity. That way you still only have one activity to track instead of two.
  2. Combine more of your course into a single the SCORM package. If you end up with one SCORM package per language, this could still work for you as there is an option to consider the course completed if any one of the activities are completed.
  3. Use native Moodle courses instead of SCORM packages.
  4. Split your SCORM packages off into their own course and use the SubCourse plugin available in moodle.org/plugins. Let's say you have SCORM package in English and French. Create a new additional course and you put them alone together that course. Set course completion to "ANY selected activity to be completed". That way, when either the English or the French version of the SCORM package is completed, the course will be considered completed and the SubCourse activity in the parent course will also be completed. You will need to repeat this for each pair of SCORM package. Your master course can also be configured to automatically enrol any enrolled students in the other courses to make it a little more transparent. In your subcourses, you can also include a button to take your students back to the parent course. The limitation here will be the requirement for an extra click since you can't turn the subcourse into a single activity course. However, using the language availability plugin, you can make only one of the two SCORM packages appear in the course. Perhaps you could give it a little preamble containing instructions on how to use the SCORM packages or something like that so that it adds some value instead of being just a burden to the end-user.

By the way, #4 is also how I implement learning paths in Moodle in case that is of interest to you. Very useful if you want to have a particular courses be a part of other courses.

Like I said, none of these options are ideal but hopefully you will find at least one of them helpful. Please let me know if you come across other solutions.

Best regards,

Michael

Average of ratings: Useful (3)
In reply to Michael Milette

Re: How to manage multiple languages?

by zohir meddane -
Hello Michael,

Thanks for the explanation, that's exactly what I was looking for. I'm located in Montreal, and I have to create a brand new Moodle platform for the Montreal Campus. The previous one ( we are still using presently) was English only and we are moving towards a Bilingual platform English and French Canadian.
I'll be following your process, if you have a shorter one, please share, I'm only looking at having the platform itself in French &/or English and let the student pick his/her preferred language something similar to any Canadian transactionnel website.

Thanks again, I might have some extra questions soon.

Regards,

Zohir
In reply to zohir meddane

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
You are very welcome Zohir. Glad to hear you found the information helpful.

Best regards,

Michael
In reply to Michael Milette

Re: How to manage multiple languages?

by Kai Niethammer -
Hi Miachel,
appreciate your feedback. Thank you for the approaches given. These are options that I prefer to not build.
In my previous company we had a plugin developed for a Totara system that offered an autocomplete activity. it simply completed itself automatically as soon as it became available to the user.
We set restrictions so that either the one or the other language version of an activity (mainly SCORM packages, but you are right ... this applies to any activity type that can be offered in different language) must be completed to make the autocompletion available. The autocomplete itself was usually invisible to the students. However for the course completion or as a criteria for next steps in the course we referred to the autocomplete activity. Worked like charm smile

Unfortunately this plugin does not work properly in Moodle 3.8. sad Seems to make use of some Totara specific features.
In reply to Kai Niethammer

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
You are very welcome Kai. Glad to hear you found the information helpful.

I am curious about the autocomplete activity plugin you are talking about. Can you tell me more about it? I am not clear on what you mean when you say that it "simply completed itself". How does that help? Would it be useful in Moodle if we could get something similar working?

Best regards,

Michael
In reply to Michael Milette

Re: How to manage multiple languages?

by stavroula lalou -
Hello, I would like your help please. I want to add a multlanguga menu in a moodle platform. I use the Alpha Theme. But the problem is that I cannot add a multilanguage menu either from Theme seetings e.g. Home||English only item|en neither with 

<span lang="pl" class="multilang”>
   <a class="dropdown-item" href="#pl”>your_content_here with different URL</a>
</span>

<span lang="en" class="multilang”>
   <a class="dropdown-item" href="#en">your_content_here en with different URL</a>
</span>


<a class="dropdown-item" href=“URL”>

  <span lang="pl" class="multilang"> your_content_here PL with different URL</span>

  <span lang="en" class="multilang"> your_content_here en with different URL</span>

</a>

The Theme has a default top nav bar with the html code: 
<ul class="navbar-nav mr-auto">
            <li class="nav-item active">
              <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">Link</a>
            </li>
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="#">Action</a>
                <a class="dropdown-item" href="#">Another action</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="#">Something else here</a>
              </div>
            </li>
</ul>
Could you help me please??? Thank You in advance!!!
In reply to stavroula lalou

Re: How to manage multiple languages?

by Mohammed Alhabib -
I think multilang plugin is not a good enough, suppose that the LMS runs with different language why should he write a weird tags before his text such as {mlang en }{mlang} for each language.!!
In reply to Mohammed Alhabib

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Mohammed,

It is easy to be critical. What would you suggest a better solution would look like?

Michael
Average of ratings: Useful (2)
In reply to Michael Milette

Re: How to manage multiple languages?

by Mohammed Alhabib -
Hello Dear Michael,
The better solution should be provided by Moodle team, they should think more about globality.
In reply to Mohammed Alhabib

Re: How to manage multiple languages?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
"The better solution should be provided by Moodle team"
What would that be?
In reply to Michael Milette

Re: How to manage multiple languages?

by Kai Niethammer -
Hi there,
from my point of view it would be helpful to implement the option to use a combination of AND and OR criteria when it comes to evaluating course completion.
This could look like the feature which is available at activity restriction level. there you can add restriction sets which can include OR definitions. If you would be able to transfer this to something like an "add criteria set" this would not only help in this multilanguage activity context but also allow to be much more flexible when it comes to course completion definition with optional activities.

Does this help or do you need a more detailed description?
In reply to Kai Niethammer

Re: How to manage multiple languages?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
"Does this help or do you need a more detailed description?"
No, I don't understand the link between options activity restriction and multi language presentation. Are you referring to restricting activities according to chosen language?
In reply to Kai Niethammer

Re: How to manage multiple languages?

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
I agree with Marcus. I think we may have just changed issue.

However Kai, I could be mistaken but I think you are talking about the course completion criteria.

When working with multi-language courses which make use of the restriction by language plugin, it can be challenging to configure course completion for the desired outcome.

For example, let's say you have a multi-language English/French course that has several multi-language activities whose content is filteres by mlang tags (from Multi-languageContent v2 plugin). Then you add a URL resource - also part of your completion criteria - which points to an English web page. But because URL resources do not support multi-language in Moodle, you need to create a second one that points to a French web page. Then you add a restriction by language to both so that only the correct one displays depending on the UI language.

Students will end up completing most of the same activities but some of the activities will be different. In the example scenario, students will either complete the English URL OR the French URL but never both.

I have also often seen this scenario when single language SCORM packages are used in a multi-language course.

Activity completion can easily handle this but course completion criteria cannot.

This is not just limited to language. For example, I have seen requests from clients where they wanted to give a different quiz to learners depending on other criteria such as initial level of knowledge and experience, level of sought certification and others. Again, easily handled by activity completion criteria but a mix of some AND and some OR criteria is not currently easily possible in course completion criteria.

Having worked with many organizations who have implemented Moodle as a muti-language solution, this is definitely a weakness of its course completion criteria subsystem. I can often offer ways to work around this but they tend to be complicated and definitely not obvious. In my opinion, this is one of the big UX challenges in Moodle that give it a reputation of being hard to use (the other being the gradebook).

Best regards,

Michael Milette
Average of ratings: Useful (1)
In reply to Michael Milette

Re: How to manage multiple languages?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
"the other being the gradebook"
I agree. The Gradebook is truly powerful and flexible, but that is of little matter if normal people cannot understand it or find and use the features it offers.
In reply to Michael Milette

Re: How to manage multiple languages?

by Kai Niethammer -
Hi Marcus and Michael,
sorry for my delayed reply.

Yes that's right, also for other scenarios it would be great to have the option to define completion criteria with an additional level of complexity.

Sorry for the misunderstanding with the access restrictions for activities. I only mentioned it because the "restriction set" mechanism that is used there might be worth to have look at from my point of view.

One would be able to add "Criteria sets" that could be AND connection, however within the criteria set one might use OR criteria.

If this or a comparable mechanism could be transferred to the completion criteria, this would allow more flexible completion criteria definition and cover also the cases/scenarios you mentioned @Michael.

Does this make sense?

Best regards, Kai
Average of ratings: Useful (1)