[BUGFIX] Make TCEMAIN.translateToMessage work with lang files 67/35967/2
authorBenjamin Mack <benni@typo3.org>
Sat, 10 Jan 2015 20:04:51 +0000 (21:04 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 12 Jan 2015 13:09:00 +0000 (14:09 +0100)
The option TCEMAIN.translateToMessage that prepends
a certain text to a message was apparantly available
with the functionality of "LLL:" in the past.

TCEMAIN.translateToMessage = LLL:EXT:foobar/locallang_be.xml:translateTo

The patch re-introduces the functionality
again which was missing since at least 4.7.

See forge for further details.

Resolves: #41906
Releases: master, 6.2
Change-Id: I7f30ba7fc1d6577073e8a75840762c0912ca5d2c
Reviewed-on: http://review.typo3.org/35967
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index ab6b947..fed6dee 100644 (file)
@@ -4048,8 +4048,9 @@ class DataHandler {
                                                                                                if (($fCfg['config']['type'] == 'text' || $fCfg['config']['type'] == 'input') && strlen($row[$fN])) {
                                                                                                        list($tscPID) = BackendUtility::getTSCpid($table, $uid, '');
                                                                                                        $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
-                                                                                                       if (isset($TSConfig['translateToMessage']) && strlen($TSConfig['translateToMessage'])) {
-                                                                                                               $translateToMsg = @sprintf($TSConfig['translateToMessage'], $langRec['title']);
+                                                                                                       if (isset($TSConfig['translateToMessage']) && !empty($TSConfig['translateToMessage'])) {
+                                                                                                               $translateToMsg = $GLOBALS['LANG'] ? $GLOBALS['LANG']->sL($TSConfig['translateToMessage']) : $TSConfig['translateToMessage'];
+                                                                                                               $translateToMsg = @sprintf($translateToMsg, $langRec['title']);
                                                                                                        }
                                                                                                        if (!strlen($translateToMsg)) {
                                                                                                                $translateToMsg = 'Translate to ' . $langRec['title'] . ':';