Permalink
Browse files

Mrged new string locations for modules

  • Loading branch information...
1 parent d827e21 commit 6a1596099db349d3595e2ba6b1b027b836aeb355 moodler committed Mar 5, 2007
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/moodlelib.php
View
@@ -4758,13 +4758,24 @@ function get_string($identifier, $module='', $a=NULL) {
if (strpos($module, 'block_') === 0) { // It's a block lang file
$locations[] = $CFG->dirroot .'/blocks/'.substr($module, 6).'/lang/';
} else if (strpos($module, 'report_') === 0) { // It's a report lang file
- $locations[] = $CFG->dirroot .'/admin/report/'.substr($module, 7).'/lang/';
+ $locations[] = $CFG->dirroot .'/'.$CFG->admin.'/report/'.substr($module, 7).'/lang/';
$locations[] = $CFG->dirroot .'/course/report/'.substr($module, 7).'/lang/';
+ } else if (strpos($module, 'resource_') === 0) { // It's a resource module file
+ $locations[] = $CFG->dirroot .'/mod/resource/type/'.substr($module, 9).'/lang/';
+ } else if (strpos($module, 'assignment_') === 0) { // It's an assignment module file
+ $locations[] = $CFG->dirroot .'/mod/assignment/type/'.substr($module, 11).'/lang/';
+ } else if (strpos($module, 'enrol_') === 0) { // It's an enrolment plugin
+ $locations[] = $CFG->dirroot .'/enrol/'.substr($module, 6).'/lang/';
+ } else if (strpos($module, 'auth_') === 0) { // It's an auth plugin
+ $locations[] = $CFG->dirroot .'/auth/'.substr($module, 5).'/lang/';
+ } else if (strpos($module, 'format_') === 0) { // Course format
+ $locations[] = $CFG->dirroot .'/course/format/'.substr($module,7).'/lang/';
} else { // It's a normal activity
$locations[] = $CFG->dirroot .'/mod/'.$module.'/lang/';
}
}
+
/// First check all the normal locations for the string in the current language
foreach ($locations as $location) {
$locallangfile = $location.$lang.'_local'.'/'.$module.'.php'; //first, see if there's a local file

0 comments on commit 6a15960

Please sign in to comment.