Having Moodle in two (or more) languages

Having Moodle in two (or more) languages

by Eric Guedegbe -
Number of replies: 14

I'd like to learn how to make a moodle course fully bilingual.
The thing is that in my test installation (http://elearning.unidep.org), I have a course available in both languages French and English and I would like that whenever a user switches to French, he can see the French version of the course; and vice versa. I would not like for instance any French course content when the chosen language is English.
In Moodle last course (Teaching with Moodle: An introduction), sometimes moodle interface appears in French but the course content is English, so this is not really bilingual ;)
So how to make a moodle site or course fully bilingual when you have all content in two different languages?
Cheers.

Average of ratings: -
In reply to Eric Guedegbe

Re: Having Moodle in two (or more) languages

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

LOL - I have just put in a paper to detail how we did exactly this on a bilingual English/Welsh project recently and will be presenting at the OER15 conference in Cardiff in April (also going to tweak that presentation and submit it for the UK/Ireland MoodleMoot!). Feel free to book on and come along smile

Essentially, it boils down to using the multi-lang filter, although I had to tweak it slightly so that it could encompass whole chunks of content (in a div), including youtube embedded videos etc, and also work for section headings, rather than applying to only <span>


Richard

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Having Moodle in two (or more) languages

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Great to meet you at the OER15 conference Eric. Hope it was useful!

In reply to Eric Guedegbe

Re: Having Moodle in two (or more) languages

by ryan sanders -

i still have not found the "short hand" for text boxes, i remember coming across it a couple times when initially getting back into the swing with moodle. 

it was reference to "title" boxes and like  were you could type in lang:en english lang:fr french lang:du dutch but for life of me i can not find the information.  the short hand was to deal with the 255 character limit imposed on text boxes. 

for general textareas (what is used for atto editor or tinymce editor)  the explanation is within above links.  and use of <span> and <div> and allowing chunks of information to be broken up throughout in different languages. 

Average of ratings: Useful (1)
In reply to Eric Guedegbe

Re: Having Moodle in two (or more) 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 Eric,

I've been doing exactly that for almost 2 years in Moodle.

The Filter: Multi-lingual Second plugin is your friend here. It becomes especially easy to use for both in-line and block filtering when you enable the non-HTML mark-up system. We've used this to create 100% fully English/French bilingual sites.

Note that there are several places in Moodle that do yet not support the Moodle filter system and there isn't much you can do about that unless you start fixing core Moodle files. I've customized over 50 core Moodle files so far in order to support multiple languages properly and fix accessibility issue and am fixing even more all the time. I  recall fixing check boxes in the Feedback and Quiz modules but it really depends on which plugin you are having trouble with. I've shared some of the fixes (Feedback module for example) which have since been integrated into the core code. One day, I hope to find the time to submit the rest of the fixes in Moodle Tracker so that I don't have to maintain them any more. 

At the moment, I don't have time to write up a list of issues relating to each file I changed, scenarios on how to reproduce the issues and how to test the fixes then justify the changes to the community, rebase the patches and manage conflicts for 3-6 months across multiple versions of Moodle until the changes are finally integrated into Moodle. Don't get me wrong, it is a great process that ensures high quality coding practices. However it is time consuming, slow going and I am busy with client priorities to spend time on this lengthy process. My current Git base system enables me to quickly and easily maintain the fixes as new releases of Moodle become available.

You might want to contact Instrux Media to find out how you can license their fork of Moodle which includes the unpublished language and accessibility related fixes. It will save you a lot of time and effort.

Best regards,

Michael Milette

Average of ratings: Useful (1)
In reply to Eric Guedegbe

Re: Having Moodle in two (or more) languages

by Eric Guedegbe -

I retain Multi-language and Restriction by language availability condition plugins and I thank you all for your answers and sharing.

For the latter, I will upgrade my installation to 2.8 and test. Anyway, it appears there is a necessity to tweak all modules in use individually and this is exactly what I wanted to avoid... I've just ended a two years work on a library open source software with div and span et al for it to work the way I wanted and I'm fed up of tweaks lol.

@Richard,

Tks for your invite. I'll be there for your paper so prepare a package for me. I bet it won't be difficult for you to recognize me ;)

Cheers.

In reply to Eric Guedegbe

Re: Having Moodle in two (or more) languages

by Eric Guedegbe -

Update:

Installed both plugins but they are no go from the beginning as it seem they are working only with modules / sections...


I'd like to be able, from the frontpage of my platform, to show 'Section Française' when the user select french and 'English Section' when the user select english.


'Section Française' and 'English Section' are two different course categories, both appearing on 'Top' but only one should appear depending on the language. 

Maybe I'm wrong, but while all these plugins are enabled on the site, I don't have the expected result when using language tags in the titles, and I don't even have the possibility to use language html tags in other fields...


Same thing when I try to set a simple block depending on the language...'QR code' for english and 'code 2D' for french... No way too.


Any additional clue ? Or these plugins are not what I need ?

In reply to Eric Guedegbe

Re: Having Moodle in two (or more) 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 Eric,

You didn't mention which approach you were taking. If you are using the filter_multilang second, you really don't need to setup a section for each language. Here is a summary of the steps I use:

Logged in as a site administrator...

1) Install the French language pack.

2) Install the filter_multilangsecond plugin.

3) Go to Site Administration > Plugins > Filters

4) Enable the filter_multilangsecond plugin and set it to apply to both headers and content.

5) Go to the filters settings and set it to use the non-HTML method.

6) Now go the section of your course. Everywhere where you enter text, except for the shortname field field, enter {mlang en}Your English Text{mlang}{mlang fr}Votre texte en français{mlang} replacing the text as appropriate.

7) Don't forget to also edit your course settings and add {mlang} tags around the full name of the course.

That's it. No need to create a second section. Now if you are on the English side of your course, you will see it in English. If Moodle is displaying it's user interface in French, the course section will appear in French.

If your section is a page, be sure to use the block approach. It will save you a lot of time. Just make sure that the {mlang en} and final {mlang} are each on a line by themselves and that there is absolutely nothing between the {mlang}{mlang fr} tags and everything should work in most cases (except where Moodle developers failed to process text through Moodle filtering).

Hope this helps.

Best regards,

     Michael Milette

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

Re: Having Moodle in two (or more) languages

by Eric Guedegbe -
Thanks for your answer Michael. 

I'll try to detail what I've found finally, since many have this issue but it is not documented...

1.) One need a text editor. So either activate the text editor by putting it number one (if your html editor can also switch to text, you can still use it... My Atto did not offer text as you will see from my previous post)


2.) Found that the two filters Multi-Language Content filter and Multi-Language Second filter are conflicting and doesn't not always work on headings with defaults settings enabled unless you go directly to the (My)sql tables to edit data. Below, the site name is refused on the editor while it will work (right language displays) when you edit it directly on the mdl_course table...


Other conflicts sample. {mlang} will not work on the header while it will work on the content...


and vice versa...



3.) Best option (at least for me) is 'Go to the Multi-Language Second filter settings and set it to use the non-HTML method' as recommended and then for any single situation, try both filters  {mlang} and <span> until you have an acceptable result.




This has to be done on any single display and one working combination might not work for the following page... 

Long way to home then...

Hope this will help...

In reply to Eric Guedegbe

Re: Having Moodle in two (or more) 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 Eric,

Just wanted to mention that the syntax in your screenshot for the Multi-language second filter has a few typos. 

What you have:

{mlang en}eLearning{mlang fr}{mlang fr}Cours à distance{mlang fr}

It should have been:

{mlang en}eLearning{mlang}{mlang fr}Cours à distance{mlang}

If you configured the settings to apply to both headers and content, this is likely the reason it didn't work for you in the header but did in the sidebar.

Best regards,

     Michael Milette

In reply to Michael Milette

Re: Having Moodle in two (or more) languages

by Eric Guedegbe -
Thank you. Noticed and corrected, but still some issues, particularlly using the mobile app now...


In reply to Eric Guedegbe

Re: Having Moodle in two (or more) 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 haven't used the mobile app. Is that the mobile app or a mobile view with a responsive theme?

In reply to Michael Milette

Re: Having Moodle in two (or more) languages

by Just H -

From the screenshot I'd say it's the official mobile app. It doesn't appear to respect filters, same issue with the Generico filter. Just posted a new thread in the Moodle Mobile forum.

In reply to Eric Guedegbe

Re: Having Moodle in two (or more) languages

by Eric Guedegbe -

Installed html+ on Atto text editor and got it finally on my dev site, confirming what I've said in my last post... We can close the thread I think... Thank you thank you thank you everyone for your sharing...





Just thinking now about cancelling my registration to OER lol smile

I will now try to configure the moodle mobile apps connectivity and update my production site soon...