[BUGFIX] Make labeledToggleCheckbox localizable 45/56745/4
authorMathias Schreiber <mathias.schreiber@typo3.org>
Thu, 19 Apr 2018 18:54:06 +0000 (20:54 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 20 Apr 2018 15:37:57 +0000 (17:37 +0200)
The labels of a labeledToggleCheckbox are now localizable using
the well known LLL syntax.

Resolves: #84803
Releases: master
Change-Id: Iaaa3c84393ce1b998752b5db18dafc2aa7d385d3
Reviewed-on: https://review.typo3.org/56745
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Riny van Tiggelen <info@online-gamer.nl>
Reviewed-by: Jan Delius <me@jandelius.eu>
Tested-by: Jan Delius <me@jandelius.eu>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Tested-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCheckboxItems.php

index 2d86fe0..76519bb 100644 (file)
@@ -144,10 +144,10 @@ class TcaCheckboxItems extends AbstractItemProvider implements FormDataProviderI
     private function sanitizeLabeledToggleCheckbox(array $item, int $itemKey, array $newItems)
     {
         if (array_key_exists('labelChecked', $item)) {
-            $newItems[$itemKey]['labelChecked'] = $item['labelChecked'];
+            $newItems[$itemKey]['labelChecked'] = $this->getLanguageService()->sL($item['labelChecked']);
         }
         if (array_key_exists('labelUnchecked', $item)) {
-            $newItems[$itemKey]['labelUnchecked'] = $item['labelUnchecked'];
+            $newItems[$itemKey]['labelUnchecked'] = $this->getLanguageService()->sL($item['labelUnchecked']);
         }
         if (array_key_exists('invertStateDisplay', $item)) {
             $newItems[$itemKey]['invertStateDisplay'] = $item['invertStateDisplay'];