lgfa29 / basiclti4moodle

Automatically exported from code.google.com/p/basiclti4moodle
0 stars 0 forks source link

Need to send the locale for the user to the remote tool #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is needed to pass the certification test.

Original issue reported on code.google.com by drchuck on 6 Mar 2010 at 9:51

GoogleCodeExporter commented 9 years ago
I am not an expert on Moodleness - but this is the code I came up with for 
Locale:

    $locale = $COURSE->lang;
    if ( strlen($locale) < 1 ) $locale = $CFG->lang;

Comments?

Original comment by drchuck on 6 Mar 2010 at 10:25

GoogleCodeExporter commented 9 years ago
Shouldn't the the order of locale precedence be:

1. Course (forced)
2. User
3. System

?

I modded our local code to this:

$locale = $course->lang;
if ( strlen($locale) < 1 ) {
        // The course language is not enforced. Use the user's profile setting.
         $locale = $USER->lang;
         if ( strlen($locale) < 1 ) {
            // No language specced for user. Use the default.
            $locale = $CFG->lang;
         }
}

Which seems to do the job.

Adrian.

Original comment by adrian.r...@gmail.com on 22 Feb 2012 at 10:08

GoogleCodeExporter commented 9 years ago
Has there been any assessment of this? It doesn't seem right to skip the user's 
language prefs and just go straight to the default. Do I need to open a new 
ticket?

Original comment by adrian.r...@gmail.com on 25 May 2012 at 10:56