View categories depending on the language of the user

View categories depending on the language of the user

by Laia Subirats -
Number of replies: 1

Dear all,

I am using Moodle version 3.4.3 and I want to build a multi-language platform. Everything works fine except multi-language in course categories and courses titles. I would like that when selecting English in the platform, only English categories and courses can be seen as an option to the students, and that when selecting Spanish language, only Spanish courses and categories can be seen in the platform.

I have tried to put in the category name <span lang="es" class="multilang">Miscelánea</span> so it only appears when the user selects the Spanish language but it does not work.

I have also explored the categories and course management section and I can see that you can enroll cohorts of users. However, I cannot find how cohorts can help me to implement the functionality I explained in the first paragraph.

I wonder if anybody can help me solving this issue.

Best wishes,

L.


Average of ratings: -
In reply to Laia Subirats

Re: View categories depending on the language of the user

by Colin Fraser -
Picture of Documentation writers Picture of Testers

AS I understand it, the browser has a set preferred language. When Moodle loads, it is supposed to select the language that is the preferred language of the browser and loads that language from the available language packs. Obviously, the correct language pack has to be available to be selected. AFAIK, though, there is no way to discriminate courses in the manner you are describing. 

Simplest bet, (right off the top of my head), rethink your Moodle structure. Add two Moodles, and I think they could be set up using the same database but using different languages, one Spanish, one English. As long as their cookies have different prefixes, say eng_* and spa_, it should work. Obviously, the courses go into the required language Moodle, - or swap them around if you like to confuse people, but you might want to leave that until next April 1..smile The other part is one has a url of www.path/to/moodle/moodleeng the other is www/path/to/moodle/moodlespa.  

Average of ratings: Useful (1)