An error friendlycaptcha throws an Exception: Return value of StudioMitte\FriendlyCaptcha\FieldValidator\PowermailValidator::getLanguageService() must be an instance of TYPO3\CMS\Core\Localization\LanguageService, null returned
PowermailValidator.php uses $GLOBALS['LANG'] for error translation.
It is not available in FE and it is discouraged to use this variable directly (in FE).
Using translateErrorMessage of TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator like it is used in studiomitte/friendlycaptcha/Classes/FieldValidator/FormValidator.php does work.
An error friendlycaptcha throws an Exception:
Return value of StudioMitte\FriendlyCaptcha\FieldValidator\PowermailValidator::getLanguageService() must be an instance of TYPO3\CMS\Core\Localization\LanguageService, null returned
PowermailValidator.php uses
$GLOBALS['LANG']
for error translation. It is not available in FE and it is discouraged to use this variable directly (in FE).https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/Configuration/GlobalVariables.html#confval-LANG
Using
translateErrorMessage
ofTYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
like it is used instudiomitte/friendlycaptcha/Classes/FieldValidator/FormValidator.php
does work.