[BUGFIX] Try to translate given help text of select items 89/56689/4
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 16 Apr 2018 14:38:16 +0000 (16:38 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 2 Jun 2018 09:34:50 +0000 (11:34 +0200)
Use the LanguageService for help texts of select items.
This can be tested with the element 'select_checkbox_3' of the
styleguide extension.

Resolves: #78984
Releases: master, 8.7
Change-Id: Idb6e63547ac480b18fcb1ca997d5d07e4bcb4e81
Reviewed-on: https://review.typo3.org/56689
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php

index db847ea..329efaf 100644 (file)
@@ -1297,7 +1297,14 @@ abstract class AbstractItemProvider
             }
             $value = strlen((string)$item[1]) > 0 ? $item[1] : '';
             $icon = !empty($item[2]) ? $item[2] : null;
-            $helpText = !empty($item[3]) ? $item[3] : null;
+            $helpText = null;
+            if (!empty($item[3])) {
+                if (\is_string($item[3])) {
+                    $helpText = $languageService->sL($item[3]);
+                } else {
+                    $helpText = $item[3];
+                }
+            }
             $itemArray[$key] = [
                 $label,
                 $value,