TASK: Add translated flash message after record was edited
This commit is contained in:
parent
8c13a05cb4
commit
fd69c91652
3 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ namespace Workshop\ExampleExtension\Controller;
|
|||
*/
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
use Workshop\ExampleExtension\Domain\Model\Address;
|
||||
use Workshop\ExampleExtension\Domain\Repository\AddressRepository;
|
||||
|
||||
|
@ -55,7 +56,10 @@ class AddressController extends ActionController
|
|||
$this->addressRepository->update($address);
|
||||
|
||||
$this->addFlashMessage(
|
||||
$address->getCompanyName() . ' was updated.',
|
||||
LocalizationUtility::translate('flashSuccess', 'ExampleExtension', [
|
||||
'companyName' => $address->getCompanyName(),
|
||||
'street' => $address->getStreet(),
|
||||
]),
|
||||
'Update successfully'
|
||||
);
|
||||
$this->redirect('index');
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
<trans-unit id="error.address.zip.1221565130" xml:space="preserve">
|
||||
<source>Please provide a valid ZIP consisting of 5 digits.</source>
|
||||
</trans-unit>
|
||||
|
||||
<trans-unit id="flashSuccess" xml:space="preserve">
|
||||
<source>Update des Datensatzes %1$s war Erfolgreich.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<f:flashMessages />
|
||||
<f:for each="{addresses}" as="address">
|
||||
<h3>{address.companyName}</h3>
|
||||
<address>
|
||||
|
|
Loading…
Reference in a new issue