mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-72882 tool_langimport: Set default language when deleting lang pack
* When the language pack being deleted is - the same as the site default language, we must set the site default language to 'en'. - fix the user's current language to the default site language.
This commit is contained in:
parent
03f298a71c
commit
f91261c9fa
@ -124,6 +124,12 @@ class controller {
|
||||
}
|
||||
|
||||
if ($rm1 or $rm2) {
|
||||
// Set the default site language to en if the deleted language pack is the default site language.
|
||||
if ($CFG->lang === $lang) {
|
||||
set_config('lang', 'en');
|
||||
// Fix the user's current language to the default site language.
|
||||
fix_current_language($CFG->lang);
|
||||
}
|
||||
$this->info[] = get_string('langpackremoved', 'tool_langimport', $lang);
|
||||
event\langpack_removed::event_with_langcode($lang)->trigger();
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user