Commit 29fbcca3 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Allow Moodle language preferences without '_utf8' suffix (bug #932332)"

parents 6d0ad109 abae9b6b
......@@ -472,7 +472,7 @@ class AuthXmlrpc extends Auth {
// Language
if (!empty($remoteuser->lang)) {
$validlanguages = array_keys(get_languages());
$newlanguage = str_replace('_', '.', strtolower($remoteuser->lang));
$newlanguage = str_replace('_utf8', '', strtolower($remoteuser->lang)) . '.utf8';
if (in_array($newlanguage, $validlanguages)) {
set_account_preference($user->id, 'lang', $newlanguage);
$user->set_account_preference('lang', $newlanguage);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment