MDL-22061 workaround for special handling of parentlanguage string
This commit is contained in:
@@ -253,12 +253,9 @@ die('Work in progress, to be replaced by the new language update interface...');
|
||||
foreach($installedlangs as $l=>$unused) {
|
||||
$SESSION->lang = $l;
|
||||
$parent = get_string('parentlanguage', 'langconfig');
|
||||
if ($parent == 'en') {
|
||||
if ($parent === 'en') {
|
||||
continue;
|
||||
}
|
||||
if (strpos($parent, '[[') !== false) {
|
||||
continue; // no parent
|
||||
}
|
||||
if (!isset($installedlangs[$parent])) {
|
||||
$missingparents[$l] = $parent;
|
||||
}
|
||||
|
||||
+5
-3
@@ -5647,7 +5647,7 @@ function get_parent_language($lang=null) {
|
||||
}
|
||||
|
||||
$parentlang = get_string('parentlanguage', 'langconfig');
|
||||
if ($parentlang === 'en' or $parentlang === '[[parentlanguage]]' or strpos($parentlang, '<') !== false) {
|
||||
if ($parentlang === 'en') {
|
||||
$parentlang = '';
|
||||
}
|
||||
|
||||
@@ -5910,9 +5910,11 @@ class amos_string_manager implements string_manager {
|
||||
// not all of them are supposed to be defined
|
||||
return '';
|
||||
}
|
||||
if ($identifier !== 'parentlanguage') {
|
||||
debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER);
|
||||
if ($identifier === 'parentlanguage' and ($component === 'langconfig' or $component === 'core_langconfig')) {
|
||||
// parentlanguage is a special string, undefined means use english if not defined
|
||||
return 'en';
|
||||
}
|
||||
debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER);
|
||||
return "[[$identifier]]";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user