Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (Revision 8574) +++ t3lib/class.t3lib_div.php (Arbeitskopie) @@ -4631,21 +4631,21 @@ * @return array Value of $LOCAL_LANG found in the included file. If that array is found it will returned. * Otherwise an empty array and it is FALSE in error case. */ - public static function readLLfile($fileRef, $langKey, $charset = '', $errorMode = 0) { + public static function readLLfile($fileRef, $langKey, $charset = '', $errorMode = 0) { $result = FALSE; $file = self::getFileAbsFileName($fileRef); - if ($file) { + if ($file) { $baseFile = preg_replace('/\.(php|xml)$/', '', $file); if (@is_file($baseFile.'.xml')) { $LOCAL_LANG = self::readLLXMLfile($baseFile.'.xml', $langKey, $charset); - } elseif (@is_file($baseFile.'.php')) { + } elseif (@is_file($baseFile.'.php')) { if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] || $charset) { $LOCAL_LANG = self::readLLPHPfile($baseFile.'.php', $langKey, $charset); } else { include($baseFile.'.php'); - if (is_array($LOCAL_LANG)) { + if (is_array($LOCAL_LANG)) { $LOCAL_LANG = array('default'=>$LOCAL_LANG['default'], $langKey=>$LOCAL_LANG[$langKey]); } } } else { @@ -4667,7 +4667,18 @@ } } } - if ($fileNotFound !== TRUE) { + if ($fileNotFound !== TRUE) { + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { + foreach ($LOCAL_LANG as $languageKey => $languageArray) { + // find all values in array keys, which contains a dot '.' + $languageLabelsWithDots = array_filter(array_keys($languageArray), create_function('$key', 'return strpos($key, \'.\') !== FALSE;')); + if (count($languageLabelsWithDots)) { + self::deprecationLog('Local language labels with dots (\'.\') inside found in file ' . $file . '. They are deprecated since TYPO3 4.5.'); + break; + } + } + } + $result = is_array($LOCAL_LANG) ? $LOCAL_LANG : array(); } return $result; Index: typo3/sysext/cms/tslib/class.tslib_pibase.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_pibase.php (Revision 8574) +++ typo3/sysext/cms/tslib/class.tslib_pibase.php (Arbeitskopie) @@ -975,13 +975,13 @@ * * @return void */ - function pi_loadLL() { + function pi_loadLL() { if (!$this->LOCAL_LANG_loaded && $this->scriptRelPath) { $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); - if ($this->altLLkey) { + if ($this->altLLkey) { $tempLOCAL_LANG = t3lib_div::readLLfile($basePath,$this->altLLkey); $this->LOCAL_LANG = array_merge(is_array($this->LOCAL_LANG) ? $this->LOCAL_LANG : array(),$tempLOCAL_LANG); } @@ -990,13 +990,17 @@ $confLL = $this->conf['_LOCAL_LANG.']; if (is_array($confLL)) { foreach ($confLL as $k => $lA) { - if (is_array($lA)) { + if (is_array($lA)) { $k = substr($k,0,-1); - foreach($lA as $llK => $llV) { - if (!is_array($llV)) { + // For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset" and if that is not set, assumed to be that of the individual system languages + $locallangCharset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : $GLOBALS['TSFE']->csConvObj->charSetArray[$k]; + foreach($lA as $llK => $llV) { + if (!is_array($llV)) { $this->LOCAL_LANG[$k][$llK] = $llV; - // For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset" and if that is not set, assumed to be that of the individual system languages - $this->LOCAL_LANG_charset[$k][$llK] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : $GLOBALS['TSFE']->csConvObj->charSetArray[$k]; + $this->LOCAL_LANG_charset[$k][$llK] = $locallangCharset; + } else { + // call recursive helper function to support dots in locallang labels + $this->getSupportForDotsInLocallangLabels($k, $llK, $llV, $locallangCharset); } } } @@ -1006,8 +1010,33 @@ $this->LOCAL_LANG_loaded = 1; } + /** + * Gets a key and an array and merges the given key with all keys from the array. + * Calls itself recursive, if array value is an array. + * Sets $this->LOCAL_LANG[$language][$labelKeyMerged] if value is not an array + * + * @param string The language key + * @param string The actual key from the _LOCAL_LANG.[$language] array + * @param array The value array from given key + * @param string The charset for the given language + * @return void + * @deprecated since TYPO3 4.5, this function will be removed in TYPO3 4.7 + */ + function getSupportForDotsInLocallangLabels($language, $labelKeyPrefix, array $labelArray, $locallangCharset) { + t3lib_div::logDeprecatedFunction(); + foreach ($labelArray as $labelKey => $labelValue) { + $labelKeyMerged = $labelKeyPrefix . $labelKey; + if (is_array($labelValue)) { + // call this function recursive + $this->getSupportForDotsInLocallangLabels($language, $labelKeyMerged, $labelValue, $locallangCharset); + } else { + $this->LOCAL_LANG[$language][$labelKeyMerged] = $labelValue; + $this->LOCAL_LANG_charset[$language][$labelKeyMerged] = $locallangCharset; + } + } + }