From fc1b6699df72bc04f714c15307f9fb84e6302f2f Mon Sep 17 00:00:00 2001 From: Leon Stringer Date: Thu, 12 Apr 2018 17:59:41 +0100 Subject: [PATCH] MDL-61786 auth: Changed strings for Test Settings to lang strings The output strings for the Test Settings function were hard-coded English strings. They've been changed to standard language strings which can be translated and maintained via AMOS. --- auth/db/auth.php | 12 ++++++------ auth/db/lang/en/auth_db.php | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index 2dcd4aea4f6..03a98f37190 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -769,12 +769,12 @@ class auth_plugin_db extends auth_plugin_base { raise_memory_limit(MEMORY_HUGE); if (empty($this->config->table)) { - echo $OUTPUT->notification('External table not specified.', 'notifyproblem'); + echo $OUTPUT->notification(get_string('auth_dbnoexttable', 'auth_db'), 'notifyproblem'); return; } if (empty($this->config->fielduser)) { - echo $OUTPUT->notification('External user field not specified.', 'notifyproblem'); + echo $OUTPUT->notification(get_string('auth_dbnouserfield', 'auth_db'), 'notifyproblem'); return; } @@ -795,7 +795,7 @@ class auth_plugin_db extends auth_plugin_base { error_reporting($CFG->debug); ob_end_flush(); - echo $OUTPUT->notification('Cannot connect the database.', 'notifyproblem'); + echo $OUTPUT->notification(get_string('auth_dbcannotconnect', 'auth_db'), 'notifyproblem'); return; } @@ -804,17 +804,17 @@ class auth_plugin_db extends auth_plugin_base { WHERE {$this->config->fielduser} <> 'random_unlikely_username'"); // Any unlikely name is ok here. if (!$rs) { - echo $OUTPUT->notification('Can not read external table.', 'notifyproblem'); + echo $OUTPUT->notification(get_string('auth_dbcannotreadtable', 'auth_db'), 'notifyproblem'); } else if ($rs->EOF) { - echo $OUTPUT->notification('External table is empty.', 'notifyproblem'); + echo $OUTPUT->notification(get_string('auth_dbtableempty', 'auth_db'), 'notifyproblem'); $rs->close(); } else { $fields_obj = $rs->FetchObj(); $columns = array_keys((array)$fields_obj); - echo $OUTPUT->notification('External table contains following columns:
'.implode(', ', $columns), 'notifysuccess'); + echo $OUTPUT->notification(get_string('auth_dbcolumnlist', 'auth_db', implode(', ', $columns)), 'notifysuccess'); $rs->close(); } diff --git a/auth/db/lang/en/auth_db.php b/auth/db/lang/en/auth_db.php index 1b8ece1f5ce..9f02a299c49 100644 --- a/auth/db/lang/en/auth_db.php +++ b/auth/db/lang/en/auth_db.php @@ -69,6 +69,12 @@ $string['auth_dbuser_key'] = 'DB user'; $string['auth_dbusernotexist'] = 'Cannot update non-existent user: {$a}'; $string['auth_dbuserstoadd'] = 'User entries to add: {$a}'; $string['auth_dbuserstoremove'] = 'User entries to remove: {$a}'; +$string['auth_dbnoexttable'] = 'External table not specified.'; +$string['auth_dbnouserfield'] = 'External user field not specified.'; +$string['auth_dbcannotconnect'] = 'Cannot connect to external database.'; +$string['auth_dbcannotreadtable'] = 'Cannot read external table.'; +$string['auth_dbtableempty'] = 'External table is empty.'; +$string['auth_dbcolumnlist'] = 'External table contains the following columns:
{$a}'; $string['pluginname'] = 'External database'; $string['privacy:metadata'] = 'The External database authentication plugin does not store any personal data.';