MDL-22061 workaround for special handling of parentlanguage string

This commit is contained in:
Petr Skoda
2010-04-11 20:30:58 +00:00
parent ef44fbedb6
commit c2ed166e6d
2 changed files with 6 additions and 7 deletions
+1 -4
View File
@@ -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
View File
@@ -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]]";
}