Login page language based on selected course language

Login page language based on selected course language

by Andreas Panagiotopoulos -
Number of replies: 2

Hello to all!

I have a moodle site with two languages installed (English, Greek).

I have also created two courses, each one having been forced to have a language. So, there is a course with greek language forced and another course with the english one.

I don't allow guest access.

I would like to click on each course at frontpage and, instead of redirecting to the login page with the preferred language, to redirect to login page of the course language.

For example, I click on the greek course and I take a redirection to this login/index.php while I would prefer to have a redirection to that login/index.php?lang=el.

Is this possible with a code hacking?

Thank you!

Regards,

Andreas

Average of ratings: -
In reply to Andreas Panagiotopoulos

Re: Login page language based on selected course language

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Hello Andreas.

What you might be able to do is to stop using the default front page with the automatically generated list of courses and instead, have some kind of custom front page where these two courses would be manually listed and linked, using the manually written link like "/course/view.php?id=3&lang=el"

By the way, I assume you have language auto-detection enabled. It should cover most of common cases and users who prefer Greece (via setting in their browser), should get the log in page in Greece.

In reply to David Mudrák

Re: Login page language based on selected course language

by Andreas Panagiotopoulos -

Hello David and thank you for your reply!

Excellent idea, I haven't understood that I can pass the parameter of language in the url. This solution will work for sure!

I haven't enabled auto-detection of the language because I think that users, especially these ones that visit education centers so they don't use their own devices, don't have in mind the language of the browser. I mean that they don't care at all - they just want to visit site (platform) and do what they are asked.

So, steps should be clearly defined without any dependence of the software language. This is currently my thought..

Thank you for your support!