From 591d8e996cdf4dc94192d6365f63df8991163457 Mon Sep 17 00:00:00 2001 From: Michael Waack Date: Fri, 26 Apr 2019 14:55:44 +0200 Subject: [PATCH] [BUGFIX] Make AdvancedPassword confirmation error translatable Resolves: #87722 Releases: master, 9.5 Change-Id: Icabb810a67a900ff0632256d36fb05b888912f83 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60581 Tested-by: TYPO3com Tested-by: Ralf Zimmermann Reviewed-by: Ralf Zimmermann --- typo3/sysext/form/Classes/Hooks/FormElementHooks.php | 7 ++++++- typo3/sysext/form/Resources/Private/Language/locallang.xlf | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/form/Classes/Hooks/FormElementHooks.php b/typo3/sysext/form/Classes/Hooks/FormElementHooks.php index 52ec64dedb90..86e5e8773c4c 100644 --- a/typo3/sysext/form/Classes/Hooks/FormElementHooks.php +++ b/typo3/sysext/form/Classes/Hooks/FormElementHooks.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface; use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface; use TYPO3\CMS\Form\Domain\Runtime\FormRuntime; +use TYPO3\CMS\Form\Service\TranslationService; /** * Scope: frontend @@ -48,7 +49,11 @@ public function afterSubmit(FormRuntime $formRuntime, RenderableInterface $rende $processingRule = $renderable->getRootForm()->getProcessingRule($renderable->getIdentifier()); $processingRule->getProcessingMessages()->addError( GeneralUtility::makeInstance(ObjectManager::class) - ->get(Error::class, 'Password doesn\'t match confirmation', 1334768052) + ->get( + Error::class, + TranslationService::getInstance()->translate('validation.error.1521293688', null, 'EXT:form/Resources/Private/Language/locallang.xlf'), + 1556283177 + ) ); } $elementValue = $elementValue['password']; diff --git a/typo3/sysext/form/Resources/Private/Language/locallang.xlf b/typo3/sysext/form/Resources/Private/Language/locallang.xlf index 210993c41c47..7cabb6dff84a 100644 --- a/typo3/sysext/form/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/form/Resources/Private/Language/locallang.xlf @@ -97,6 +97,9 @@ You must select a date after %s. + + Password does not match confirmation + Form