Commit d16214a4 authored by Jakob Perry's avatar Jakob Perry
Browse files

Issue #3144396: Add StringTranslationTrait to CaptchaService.

parent c4bfbde3
......@@ -2,11 +2,15 @@
namespace Drupal\captcha\Service;
use Drupal\Core\StringTranslation\StringTranslationTrait;
/**
* Helper service for CAPTCHA module.
*/
class CaptchaService {
use StringTranslationTrait;
/**
* Return an array with the available CAPTCHA types.
*
......@@ -24,7 +28,7 @@ class CaptchaService {
$challenges = [];
if ($add_special_options) {
$challenges['default'] = t('Default challenge type');
$challenges['default'] = $this->t('Default challenge type');
}
// We do our own version of Drupal's module_invoke_all() here because
......@@ -33,7 +37,7 @@ class CaptchaService {
$result = call_user_func_array($module . '_captcha', ['list']);
if (is_array($result)) {
foreach ($result as $type) {
$challenges["$module/$type"] = t('@type (from module @module)', [
$challenges["$module/$type"] = $this->t('@type (from module @module)', [
'@type' => $type,
'@module' => $module,
]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment