Language switching problem

Language switching problem

by Ray Taylor -
Number of replies: 8
This is a problem with Moodle 1.8. I'm not sure if it is a server, Moodle or useragent problem...any insight or advice would be appreciated. I've also been through the issue tracker and could not find this specific problem either.

Our bilingual site at www.videochallenge.ca does not require login to access courses, all users are "guests". When a guest user selects their language on the front page, (e.g. French) and then click on a course link, the resulting landing page remains in the default language (English). The only way I can fix this is by going back to the front page or splash page and reselecting the language.

(note we use a splash page to select the preferred language, which is standard practice in Canada)

This looks like a caching, session or cookie issue, but no amount of fiddling with Moodle settings, or user agent cache and cookie settings seems to fix it.

I've even tried to use a purge directive in the link code (e.g. http://www.videochallenge.ca/index.php?lang=fr_utf8&action=purge) but this doesn't seem to do the trick either.


Average of ratings: -
In reply to Ray Taylor

Re: Language switching problem

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Moodle does browser language detecting (which will be possible to switch of in 1.9).
Does that give a hint to solving your problem?
In reply to koen roggemans

Re: Language switching problem

by Ray Taylor -
Hi Koen, and thanks for the reply. I'm not sure browser detect is the problem (but it might be smile

This issue also occurs with browsers running in French...in fact it was our French users that pointed out the problem. (In fact we had to set up with a language select splash page because language auto-detect was not reliable).

The other thing is that once the language setting is reset, it sticks. If I could get the language directive issued twice, it might work, but I'm not sure I can do it embedded in a link.
In reply to Ray Taylor

Re: Language switching problem

by Alejandro Gomez -
I am having a similar problem. My site (www.reflectandlearn.net) runs in English, Spanish and French, and I'm facing the same language difficulties.
Any other ideas out there to overcome this, without having to run 3 separate sites??? Ideas and suggestions are much appreciated!
In reply to Alejandro Gomez

Re: Language switching problem

by Mathuri Sathiyanarayanan -

Hi,

I am also facing the same problem.When I try to switch to any other language on the login page when I login it gets changed to English.Somebody please help.Thanks

Madhu

In reply to koen roggemans

Re: Language switching problem

by Ilias Vassilopoulos -
Guys I want to disable browser language autodetecting.
I have moodle 1.8 and I don't want to update it to 1.9. Is there any module ready or is there another solution to this?
I don't bother if it is switched off permanently as long as it switches off.
Maybe you can tell me the line of the code where it is located or something like that..
In reply to Ray Taylor

Re: Language switching problem

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
IMHO the Moodle behaviour is quite clear. If I understand login machinery correctly, then:
  • when a user comes to your site, she is considered as not logged in user and the Moodle uses default site language (or detected browser preferred language). She may switch to another language and this choice is saved in her session.
  • then, when she click on a course name, Moodle (according to your site setting) silently logs her as a Guest user. Therefore, the current session is replaced by a new one and she gets default language (English) again. That is why she has to go back to the site homepage and choose the language again.
Maybe I am wrong thoughtful but can you check your User Policy server settings in Admin > Users? What roles have you set in notloggedinroleid, guestroleid and defaultuserroleid fields?
In reply to David Mudrák

Re: Language switching problem

by Robert Brenstein -
Hmm, but that logic sounds faulty to me. If I am not logged in, I am de facto a guest user (isn't that what a non-authenticated user is?), so entering a course should not change it.
In reply to Robert Brenstein

Re: Language switching problem

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
isn't that what a non-authenticated user is?

Not necessarily. It depends on what role is set in notloggedinroleid. That is why I asked for it.