[TYPO3-english] Bug in locallangXMLOverride mechanism since TYPO3 4.6?

Lars Patrick Heß larshess at gmail.com
Thu Dec 15 11:48:28 CET 2011


Hi Xavier,

i had tested your code in a customer project and it does not work correctly, i had changed it to this:

	protected function doParsingFromRootForElement(SimpleXMLElement $root, $element) {
		$bodyOfFileTag = $root->data->languageKey;

			// Check if the source llxml file contains localized records
		$localizedBodyOfFileTag = $root->data->xpath("languageKey[@index='" . $this->languageKey . "']");
		if ($element === 'target' && count($localizedBodyOfFileTag) == 0) {
			return array();
		}

		$parsedData = $this->getParsedDataForElement($bodyOfFileTag, $element);
		if ($element === 'target' && isset($localizedBodyOfFileTag[0]) && $localizedBodyOfFileTag[0] instanceof SimpleXMLElement) {
			$parsedDataTarget = $this->getParsedDataForElement($localizedBodyOfFileTag[0], $element);
			$mergedData = array_merge($parsedData, $parsedDataTarget);

			if ($this->languageKey === 'default') {
				$parsedData = array_intersect_key($mergedData, $parsedData);
				$parsedData = array_intersect_key($mergedData, $parsedDataTarget);
			} else {
				$parsedData = array_intersect_key($mergedData, $parsedDataTarget);
			}
		}

		return $parsedData;
	}

in my dev-environment it works very well, but not in the preview-system :(… later i will test it further...


Am 15.12.2011 um 11:31 schrieb Xavier Perseguers:

> Hi Lars,
> 
>> I can imagine, that there is a better way then unset all unneeded keys…
> 
> Thanks for digging into this, I just reworked your patch to prevent a
> manual loop over all keys and pushed it to Gerrit on behalf of yourself:
> 
> https://review.typo3.org/#change,7269
> 
> We have a short Skype meeting with Dominique in a few seconds for this
> and other related L10n questions... :)
> 
> -- 
> Xavier Perseguers
> Release Manager TYPO3 4.6
> 
> TYPO3 .... inspiring people to share!
> Get involved: http://typo3.org
> 
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list