[TYPO3-ect] dirty tricks for translating locallang_db.xml items with lib/div

Michael Knoll mimi at kaktusteam.de
Wed Sep 26 01:14:17 CEST 2007


Hallo list!

It seems to me, as if lib/div doesn't translate entries from TCA 
localization labels like

LLL:EXT:mklv_community/locallang_db.xml:tx_mklvcommunity_privacy_setting.privacy_flag.I.0

So I added the following function to the tx_lib_translatorProcessor

function translateTextLl($text) {
	$itemToTranslate = preg_replace('/.+:(.*)/', '%%%$1%%%', $text);
	return $this->translateText($itemToTranslate);
}

As a parameter, it takes a label as described above and returns the 
translated text from the locallang_db.xml file.

It is important to have set the path to locallang_db.xml via 
setPathToLanguageFile() first!

Perhaps, you find a better solution, I did not :-)

Regards

Mimi


More information about the TYPO3-team-extension-coordination mailing list