From 823ebe16cc2d64deac1a7937dd80604874934676 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 26 Mar 2009 09:00:15 +0000 Subject: [PATCH] local lang: MDL-13001 perf improvement: only searches extra folders if $module == 'local' Will merge to HEAD later, as part of MDL-18669 --- lib/moodlelib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 210157043cf..a04b1d75676 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5363,7 +5363,6 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { } else { $locations[] = $CFG->dataroot.'/lang/'; $locations[] = $CFG->dirroot.'/lang/'; - $locations[] = $CFG->dirroot.'/local/lang/'; } /// Add extra places to look for strings for particular plugin types. @@ -5380,7 +5379,9 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { $type = substr($module, 0, $dividerpos + 1); $plugin = substr($module, $dividerpos + 1); } - if (!empty($rules[$type])) { + if ($module == 'local') { + $locations[] = $CFG->dirroot . '/local/lang/'; + } if (!empty($rules[$type])) { foreach ($rules[$type] as $location) { $locations[] = $CFG->dirroot . "/$location/$plugin/lang/"; }