Permalink
Browse files

MDL-29768 debugstringids option did not do anything

  • Loading branch information...
1 parent 6731a04 commit 2e98ae02ec2af3ab2312e2cc524c70c8d5ba6ad6 @sammarshallou sammarshallou committed Oct 13, 2011
Showing with 9 additions and 2 deletions.
  1. +1 −1 lang/en/admin.php
  2. +8 −1 lib/moodlelib.php
View
@@ -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';
@@ -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';
View
@@ -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)) {
@@ -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;
}
/**

0 comments on commit 2e98ae0

Please sign in to comment.