mirror of
https://github.com/moodle/moodle.git
synced 2025-03-24 09:30:17 +01:00
MDL-66197 core: correct get parent language
This commit is contained in:
parent
6735197cc2
commit
54f2d0c49e
@ -7070,21 +7070,12 @@ function current_language() {
|
||||
*/
|
||||
function get_parent_language($lang=null) {
|
||||
|
||||
// Let's hack around the current language.
|
||||
if (!empty($lang)) {
|
||||
$oldforcelang = force_current_language($lang);
|
||||
}
|
||||
$parentlang = get_string_manager()->get_string('parentlanguage', 'langconfig', null, $lang);
|
||||
|
||||
$parentlang = get_string('parentlanguage', 'langconfig');
|
||||
if ($parentlang === 'en') {
|
||||
$parentlang = '';
|
||||
}
|
||||
|
||||
// Let's hack around the current language.
|
||||
if (!empty($lang)) {
|
||||
force_current_language($oldforcelang);
|
||||
}
|
||||
|
||||
return $parentlang;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user