Added feature #11825: Override FE labels with XML files
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 31 Aug 2009 22:24:28 +0000 (22:24 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 31 Aug 2009 22:24:28 +0000 (22:24 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5860 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php
t3lib/config_default.php
typo3/sysext/cms/tslib/class.tslib_pibase.php

index 6334f82..0d935ff 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-01  Christian Kuhn <lolli@schwarzbu.ch>
+
+       * Added feature #11825: Override FE labels with XML files
+
 2009-08-31  Jochen Rau <jochen.rau@typoplanet.de>
 
        * Added feature #7984: Besides stdWrap.crop there is now a function stdWrap.cropHTML that is aware of HTML tags (same options)
index 2f5864b..8c46565 100644 (file)
@@ -4315,6 +4315,13 @@ final class t3lib_div {
                        } else {
                                die('File "' . $fileRef. '" not found!');
                        }
+                       if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['locallangXMLOverride'][$fileRef])) {
+                               $languageOverrideFileName = t3lib_div::getFileAbsFileName($GLOBALS['TYPO3_CONF_VARS']['EXT']['locallangXMLOverride'][$fileRef]);
+                               if (@is_file($languageOverrideFileName)) {
+                                       $languageOverrideArray = t3lib_div::readLLXMLfile($languageOverrideFileName, $langKey, $charset);
+                                       $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $languageOverrideArray);
+                               }
+                       }
                }
 
                return is_array($LOCAL_LANG) ? $LOCAL_LANG : array();
index ec7974c..192e1ce 100644 (file)
@@ -168,6 +168,7 @@ $TYPO3_CONF_VARS = Array(
                'extConf' => array(                                             // Config-options for extensions, stored as serialized arrays by extension-keys. Handled automatically by the EM.
 //                     '--key--' => array()
                ),
+               'locallangXMLOverride' => array(),                                      // For extension/overriding of the arrays in 'locallang' files in frontend and backend. See 'Inside TYPO3' for more information.
        ),
        'BE' => Array(          // Backend Configuration.
                'unzip_path' => '',                                             // Path to "unzip".
index b161ad8..b62b786 100644 (file)
@@ -970,7 +970,7 @@ class tslib_pibase {
         */
        function pi_loadLL()    {
                if (!$this->LOCAL_LANG_loaded && $this->scriptRelPath)  {
-                       $basePath = t3lib_extMgm::extPath($this->extKey).dirname($this->scriptRelPath).'/locallang.php';
+                       $basePath = 'EXT:' . $this->extKey . '/' . dirname($this->scriptRelPath) . '/locallang.xml';
 
                                // Read the strings in the required charset (since TYPO3 4.2)
                        $this->LOCAL_LANG = t3lib_div::readLLfile($basePath,$this->LLkey,$GLOBALS['TSFE']->renderCharset);