[BUGFIX] CSH labels are always in English
authorXavier Perseguers <typo3@perseguers.ch>
Mon, 25 Jul 2011 06:20:27 +0000 (08:20 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Mon, 25 Jul 2011 08:03:35 +0000 (10:03 +0200)
The CSH labels are always rendered in English because the source
language (English) is used instead of its translation (target).
Only fall back to source if the corresponding label was not
translated.

Change-Id: Icaaa17734b46b49ba48c2949cd7e48ee1c251750
Fixes: #28439
Reviewed-on: http://review.typo3.org/3711
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/lang/lang.php

index 214f1e6..8f5f8c6 100755 (executable)
@@ -449,11 +449,12 @@ class language {
                                                }
 
                                                        // Append label
+                                               $label = $lVal[0]['target'] ?: $lVal[0]['source'];
                                                if ($specialInstruction) {
-                                                       $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] .= LF . $lVal[0]['source'];
+                                                       $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] .= LF . $label;
                                                } else {
                                                                // Substitute label
-                                                       $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] = $lVal[0]['source'];
+                                                       $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] = $label;
                                                }
                                        }
                                }