Forums | Mahara Community

Mahara/Moodle integration /
Language switching


Gjorgi M.'s profile picture
Posts: 16

30 November 2011, 5:39

Hi all,

We have already established integration between Mahara 1.4 and Moodle 1.9 and everything is working as it should.

I have installed few language packs on Mahara and I have the same languages in the Moodle installation.

My default  language is set to English.

Now when the user logs in in Moodle  and  switch the language to French for example and after that follow the link to Mahara, Mahara recognize the French language and activates the Franche language on its side too. But if the user go back to Moodle and swith to another language and try to go back to Mahara then the language is not recognized and stays on French like before.

My question is:  Is it possible to synchronize the language swithching between Moodle and Mahara and somehow disable the option whe user can decide which language will use in Mahara? Instead of that, switching the language to be allowed only from the Moodle site.

Thanks to  all in advance.

anonymous profile picture
Account deleted
Posts: 808

30 November 2011, 14:54

Hi Gjorgi, it looks to me like Mahara tries to update your language preference every time you log in from Moodle (as long as you have the "Update user info on login" setting turned on in your xmlrpc configuration).  If that's not happening, feel free to file a bug report at https://bugs.launchpad.net/mahara/+filebug and hopefully someone will get a chance to look into it.

Profile fields can be locked by the institution so that the user can't change them, but user preferences such as language are not lockable.  I'm not sure they need to be lockable though - they don't affect others on the site, so they should remain under the user's control.  If we can get the language preference to update correctly from the Moodle side, there should be no need to change it in Mahara.

Gjorgi M.'s profile picture
Posts: 16

14 February 2012, 8:00

Hi Richard,

I would like to confirm this issue again.  For the purpose of this, I have created a completely fresh installation of Moodle 2.2.1 and Mahara 1.4.1. I have established the connection succesfully but the language.  I can confirm that Moodle's is configured to send the "lang" variable to Mahara over Mnet and the "Update user info on login" is checked but Mahara do not react on changes at all, instead of that it always shows the defoult language.

How it looks to you, is it a bug?  Can you point me to some documentation that describes this functionality in order to try to solve this issue by ourselves?

14 February 2012, 9:59

Hello,

As Richard said in another forum, the lang parameter in the URL is only recognized when the user is not logged on. With your MNET call, I guess the user is then logged in and then the lang parameter has no action.

-dajan

anonymous profile picture
Account deleted
Posts: 808

14 February 2012, 14:53

Hi Gjorgi,

You're right, I've just tried it and can confirm this bug too.  I think what's happened is that Moodle (at least 1.9) used to pass something like 'fr_utf8' during SSO, and that's changed to just 'fr' in more recent versions of Moodle, but Mahara hasn't caught up with that.  We'll make sure we change it to deal with both forms.

R.

anonymous profile picture
Account deleted
Posts: 808
Gjorgi M.'s profile picture
Posts: 16

15 February 2012, 4:36

Hi Richard, 

Many thanks for solving the issue and pointing me to the right place of the code to inspect the problem.

I have applied the patch  on both integrations with moodle 1.9 and moodle 2.2.1 and it is working.  But I would like to pay you attention on some leading issue that you must take in consideration.  I have noticed that when I tried to switch to Spanish language.  As you know on the side of Moodle more Spanish language packs exists (Espanol-Espana[es_es ], Espanol-Argenitina [es_ar],  Espanol-Mexico[es_mx] and Espanol-International [es] ).  We have just one Spanish language pack from Mahara side that is marked as es.utf8.

The solution on Mahara site will work only with the Espanol-International.  On Moodle 2.2.1 I have Espanol-International and everything is ok, but on Moddle 1.9 we have Espanol-Espana and it is not working.

I printed out the $newlanguage variable and I can see that its value is es_es.utf8.  Mahara expects just es.utf8.

It will be the same with other language that have more than one variants on Moodle side.

What do you think is it good to solve this with string manipulation directly in Mahara like you did before?  I supose it depends on general Mahara language pack policy.

 

 

 

anonymous profile picture
Account deleted
Posts: 808

15 February 2012, 15:15

Hi Gjorgi, I think it'd be fine to use string manipulation, and to search all the variants available in Mahara for the closest match. It just needs to be a case-insensitive comparison, because in Mahara the variants will come from launchpad, so they have names like pt_BR rather than pt_br.

Gjorgi M.'s profile picture
Posts: 16

16 February 2012, 1:27

Thanks for your answer Richard. 

I have applied some temporary solution to solve our problem.  It is not perfect because it is only for the Spanish  language. I supose that Mahara development team will find a permanent solution for all languages in one of the next releases.

BR//Gjorgi

9 results