Override LL-File Labels for a whole Installation
Tuesday, June 03rd, 2008 | Author: Benni
Today I found out something very nice.
I had the problem that I needed to redefine some labels for alanguage file in an extension. This was client-specific, so it wasn’t suitable for a patch to send to the corresponding extension developer. But I didn’t want to modify the extension files by myself, because in case of an upgrade, the changes would have been erased. So I stumbled upon this nice feature, which worked just fine for my TYPO3 4.0 installation.
The idea is that you can specify an “override language label file” that TYPO3 loads directly after loading the labels of a specific file. It then overwrites the labels that were added in the file, but keeping the ones you didn’t touch. You only have to add this one line to the typo3conf/localconf.php.
$TYPO3_CONF_VARS['BE']['XLLfile']['EXT:sr_feuser_register/locallang_db.xml'] = \
‘typo3conf/my_custom_labels.xml’;
The XML file itself looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Custom Labels especially for this installation</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="fe_users.gender">Gender:</label>
<label index="fe_users.gender.I.0">Mr</label>
<label index="fe_users.gender.I.1">Ms</label>
</languageKey>
<languageKey index="de" type="array">
<label index="fe_users.gender">Anrede:</label>
<label index="fe_users.gender.I.0">Herr</label>
<label index="fe_users.gender.I.1">Frau</label>
</languageKey>
</data>
</T3locallang>
After that, clear your cache and the labels will be changed… I know, somebody would now tell me that you can do this with pagesTSconfig (for the Backend) or TypoScript (for the Frontend), but she/he is wrong here. Why? The pagesTSconfig only works with TYPO3 4.2 and later. Also, with this awesome method it is possible to also change labels for e.g. the “Clear cache” menu in the backend.
Very nice, huh?


Saturday, 28. June 2008
absolut genial und absolut verwunderlich warum das nicht schon längst viel weiter vebreitet ist. ich denke mit diesem problem haben viele zu kämpfen und man ist schon sehr schnelle versucht das problem für den moment zu lösen und einen flickenteppich zu hinterlassen. vielen dank auf jeden Fall !