Multilingual moodle

Multilingual moodle

by solmaz naderi -
Number of replies: 8

Hi  Everyone,

I've got a multilingual moodle setup  (perisan/english) and want to appear courses based on selected language or do following:

when a user selects the persian Language, only show persian courses in the available courses. When a user selects the english language, only show english courses in the available courses list.
Would you help me how can I do this please?

Moodle version: 3.5

Theme: Edguru

I'm looking forward to your reply.

Best regards,

Solmaz


Average of ratings: -
In reply to solmaz naderi

Re: Multilingual moodle

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 Solmaz,

I work a lot with multi-language Moodle sites in English and French here in Canada. Unfortunately there isn't a transparent way, that I have found yet, to only list courses of a certain language in Moodle. You might want to suggest it in the Moodle Tracker. If there is enough demand for such a feature, maybe it will get implemented.

For now, I do have some suggestions to help you out.

You could have a category for English courses and another one for Persian. Then use the mlang tag described below to create a link to the category of courses available for the current language. The link would change depending on the current language.

And just in case a user gets a direct link to a course, you should set the course to force the language of the Moodle user interface to match the language of the course. This is a standard Moodle setting available available when configuring courses.

The down side of this approach is that users will not be able to switch language just any time. So if they start a course in one language, they must stick with it or start over completely in a different language.

Alternatively, you could create multi-language courses which is what we try to do most of the time. This only works if you offer the same courses in English and Persian.

There are a couple of 3rd party plugins I highly recommend to help you achieve this goal. Take a look at:

Multi-Language Content v2 https://moodle.org/plugins/filter_multilang2

Restriction by Languagehttps://moodle.org/plugins/availability_language

These will enable you to create single courses that can be displayed in more than one language. In fact, students will be able to switch language at almost any point during the course. You will also be able to use the plain text {mlang} tags to customize other things like the name of your Moodle site.

Reminder: Filters are not automatically enabled when you first install them. I suggest you enable this one for both headings and content.

There are a few limitations though. First, your theme has to support filtering. There are still a lot of less experienced developers who don't pass content through the filtering API's. If you type in mlang tag using the correct syntax and you see the mlang tag in the results, contact the theme developer. It is not hard to fix but needs to be done. The same goes for plugins.

Even Moodle itself does not implement the filter plugin everywhere yet. You may also discover that there isn't enough room in a field to specify content in multiple languages. I am working on getting these issues fixed as I come across them. If you notice a core Moodle field or activity that should but does not support filtering properly, please open a ticket in the Moodle Tracker.

There are some activities and resources, such as Files, that don't have a place to specify a different file depending on the language. That is where the Restriction by Language plugin becomes useful. You can use it to display a different file depending on the user's current language by conditionally displaying several file activities. If you are tracking course completion, I would try to use this as little as possible as it gets complicated to configure course completions when you have many different possible combinations of completed activities.

If you come across other ideas, please share. I am always looking for new ways to make multi-language Moodle sites work smoothly.

Hope you find something useful in all of this.

Best regards,

Michael Milette

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

Re: Multilingual moodle

by solmaz naderi -
Thanks so much for your perfect guidance Mr. Milette .Most appreciated.

I have done what you suggested and installed these plugin but unfortunately didn’t meet our need.
What’s surprising to me is that few body seems to have voted on related ticket (MDL-42991) Maybe It’s not a big deal for others.
I will post here when I found solution.

Thanks again
In reply to solmaz naderi

Re: Multilingual moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

I am trying to your use case. So you create two Moodle courses per your course (subject, module or whatever), one is the English one, the other the Persian one. If so, Moodle does not understand this, that they are the same course and as such mutually exclusive.

Moodle's approach is mutli-linugual courses in the literal sense. The same course can present itself in two or more languages, as Michael explained. This has the big advantage, the user can switch the language any time, Moodle reacts immediately. There must be plenty of demos around.
In reply to Visvanath Ratnaweera

Re: Multilingual moodle

by solmaz naderi -
Hi Mr. Ratnaweera

I totally agree with the Moodle approach and the plugins that are out there. But I think this approach is best when there are both languages ​​for all courses.

Our problem is that for most courses there is no English version.. In addition, there are slides on the front page of the site that are in Persian and do not want to be shown to English users .According to my research, it is not possible to separate the slide based on the language.
To solve this problem, I'm thinking about a way, but before implementation I want to consult with you:

Assume, There are two separate sites with two separate databases. One site for English courses, slides and data and another one with persian slides and content.  Each of these sites has the option of switching to second language.

To illustrate my point exactly, I have designed the front page like image below:


I would be happy to hear your opinion on this decision?

Thanks in advance


In reply to solmaz naderi

Re: Multilingual moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Solmaz


I understand your proposal. That is the "big" approach, it is possible, but there will be lot of duplicate work. Carefully study all other approaches before taking that path. For example, the plug-in Restriction by language suggested by Michael is a strong candidate.

BTW, we are on first names in the community. And I have only cursory user-level experience in the multi-language features of Moodle, since my mother tongue happen to be an Indic language. Still we write left-to-right, unlike the Arabic languages.
Average of ratings: Useful (1)
In reply to solmaz naderi

Re: Multilingual moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

I am not sure whether your theme complicates things. For testing can you switch to the standard theme and tell us why the problem with this simple setup is?

- Persian-only subjects have a Persian-only (Moodle) course per subject. See https://docs.moodle.org/35/en/Language_settings#Course_administration_settings.

- The fully or partly translated subjects also have a (Moodle) course per subject. But in these courses the language is not set.

Install only the English and Persian language packs on the site. In the https://docs.moodle.org/35/en/Language_settings#Site_administration_settings you allow Display language menu. You can choose English or Persian as the default language.

Then on dual-language courses Moodle will offer its own language selection drop-down menu on the top title bar.

Those courses may be translated using either or both plug-ins Michael mentioned earlier.
Average of ratings: Useful (2)
In reply to solmaz naderi

Re: Multilingual moodle

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 Solmaz,

With regards to your slider, if this is built into your theme, it may not be possible without either modifying the theme or not using that feature at all. Instead, again depending on your theme, it may be possible to create a couple of sliders in HTML using bootstrap and use the mlang tags to display one slider or the other depending on the current language.

As for your language selection page, have you considered having the buttons point to one of two categories, each being one of the two languages containing courses in that language? As part of the link, you could even have the current site language switch at time by adding &lang=en for English button. It is not ideal because the category page is not exactly the nicest looking Moodle page. But it is an option for you.

You would need to use CSS to hide the language switching option of your theme. Then  the only way they could switch language would be by going through the Home page's language selection buttons. Either that or customize the source code for the theme to have the language switcher only point to one of the two category pages.

May I ask which theme you are using?

Inspired by this discussion, I recently developped code and a setting in a theme I am creating which filters course lists and searches results based on the current language and the language set in the course's Force Language setting. If the language setting is not set, the course will appear regardless of the current language. Unfortunately this requires customization of either Moodle core or the theme's source code to make it work.

Eventually I hope to port these modifiations and submit them for integration into the Moodle core but it is not there yet.

Hope you find something useful in all of this.

Best regards,

Michael Milette

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

Re: Multilingual moodle

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 was thinking...

Once you hide the theme's default language switcher, you could probably use the custom menu to create your own language switcher.

Let me know if you need me to elaborate on this.

Best regards,

Michael
Average of ratings: Useful (1)