Skip to content

Commit 8ba1f68

Browse files
committed
use translate
1 parent 93c484d commit 8ba1f68

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/api-authentication/basic/src/Extension/Basic.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function onUserAuthenticate($credentials, $options, &$response)
7272
if ($password === '')
7373
{
7474
$response->status = Authentication::STATUS_FAILURE;
75-
$response->error_message = $this->getApplication()->getLanguage()->_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED');
75+
$response->error_message = $this->translate('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED');
7676

7777
return;
7878
}
@@ -116,7 +116,7 @@ public function onUserAuthenticate($credentials, $options, &$response)
116116
{
117117
// Invalid password
118118
$response->status = Authentication::STATUS_FAILURE;
119-
$response->error_message = $this->getApplication()->getLanguage()->_('JGLOBAL_AUTH_INVALID_PASS');
119+
$response->error_message = $this->translate('JGLOBAL_AUTH_INVALID_PASS');
120120
}
121121
}
122122
else
@@ -127,7 +127,7 @@ public function onUserAuthenticate($credentials, $options, &$response)
127127

128128
// Invalid user
129129
$response->status = Authentication::STATUS_FAILURE;
130-
$response->error_message = $this->getApplication()->getLanguage()->_('JGLOBAL_AUTH_NO_USER');
130+
$response->error_message = $this->translate('JGLOBAL_AUTH_NO_USER');
131131
}
132132
}
133133
}

plugins/api-authentication/token/src/Extension/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function onUserAuthenticate($credentials, $options, &$response): void
9696
// Default response is authentication failure.
9797
$response->type = 'Token';
9898
$response->status = Authentication::STATUS_FAILURE;
99-
$response->error_message = $this->getApplication()->getLanguage()->_('JGLOBAL_AUTH_FAIL');
99+
$response->error_message = $this->translate('JGLOBAL_AUTH_FAIL');
100100

101101
/**
102102
* First look for an HTTP Authorization header with the following format:

0 commit comments

Comments
 (0)