Skip to content

Commit

Permalink
Merge branch 'MDL-29768-master' of git://github.com/sammarshallou/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 16, 2011
2 parents 28a0162 + 2e98ae0 commit f3c3414
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lang/en/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
$string['configdebugdisplay'] = 'Set to on, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies and HTTP headers in general. Set to off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to.';
$string['configdebugpageinfo'] = 'Enable if you want page information printed in page footer.';
$string['configdebugsmtp'] = 'Enable verbose debug information during sending of email messages to SMTP server.';
$string['configdebugstringids'] = 'This option is designed to help translators. It shows the language file and string id beside each string that is output. (Changing this setting will only take effect on the next page load.)';
$string['configdebugvalidators'] = 'Enable if you want to have links to external validator servers in page footer. You may need to create new user with username <em>w3cvalidator</em>, and enable guest access. These changes may allow unauthorized access to server, do not enable on production sites!';
$string['configdefaultallowedmodules'] = 'For the courses which fall into the above category, which modules do you want to allow by default <b>when the course is created</b>?';
$string['configdefaulthomepage'] = 'This determines the home page for logged in users';
Expand Down Expand Up @@ -403,6 +402,7 @@
$string['debugpageinfo'] = 'Show page information';
$string['debugsmtp'] = 'Debug email sending';
$string['debugstringids'] = 'Show origin of languages strings';
$string['debugstringids_desc'] = 'This option is designed to help translators. When this option is enabled, if you add the parameter strings=1 to a request URL, it will show the language file and string id beside each string that is output.';
$string['debugvalidators'] = 'Show validator links';
$string['defaultallowedmodules'] = 'Default allowed modules';
$string['defaultcity'] = 'Default city';
Expand Down
9 changes: 8 additions & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6695,6 +6695,7 @@ public function reset_caches() {}
* @return string The localized string.
*/
function get_string($identifier, $component = '', $a = NULL) {
global $CFG;

$identifier = clean_param($identifier, PARAM_STRINGID);
if (empty($identifier)) {
Expand Down Expand Up @@ -6730,7 +6731,13 @@ function get_string($identifier, $component = '', $a = NULL) {
}
}

return get_string_manager()->get_string($identifier, $component, $a);
$result = get_string_manager()->get_string($identifier, $component, $a);

// Debugging feature lets you display string identifier and component
if ($CFG->debugstringids && optional_param('strings', 0, PARAM_INT)) {
$result .= ' {' . $identifier . '/' . $component . '}';
}
return $result;
}

/**
Expand Down

0 comments on commit f3c3414

Please sign in to comment.