[TYPO3-core] RFC: #2731: Improved caching of locallang

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Tue Feb 5 21:07:55 CET 2008


Stanislas Rolland schrieb:
> Hi Masi,
>>
>> Notes: This is a change from the old internal behaviour. Now all the 
>> strings are correct at once (after loading from file) without the need 
>> for further processing.
>>
>> Warning: I have started this patch a long time ago for the BE. This 
>> part worked well. The part for the FE I have written right now (in the 
>> night). This part is not so well tested.
>>
>> As the diff is nearly unreadable please test with various setups. Use 
>> languages with different charset, set and unset forceCharset, fiddle 
>> with renderCharset. In typo3temp/llxml you'll find a cache file for 
>> each  locallang.php, language and charset.
>>
> Please try htmlArea RTE with a utf-8 backend and language other than 
> English. Many localized strings in button tooltips and/or popup windows 
> are broken. These strings are taken from a file generated by 
> class.tx_rtehtmlarea_base.php. I wish I could understand what I need to 
> do to correct this.

I know what went wrong and I have fixed it. The problem was that the 
labels were converted twice. You must not do this yourself if you load 
them via $LANG or $TSFE. If you use the t3lib version, you may request a 
charset, but the other two version use the correct one.

Which brings me to a another subject. In the code I found this:

$this->charset = $LANG->csConvObj->charSetArray[$this->language];
$this->charset = $this->charset ? $this->charset : 'iso-8859-1';
$this->BECharset = trim($TYPO3_CONF_VARS['BE']['forceCharset']) ?
    trim($TYPO3_CONF_VARS['BE']['forceCharset']) : $this->charset;
$this->OutputCharset = $this->BECharset;

This is IMHO wrong. The BE charset is already defined by $LANG->charset 
(as it is done for the FE with $TSFE->renderCharset). Playing around 
with the conf. vars yourself is IMHO an error by defintion.

In 4.1 $this->charset is onyl the label charset. But in 4.2 the labels 
are now also in the render charset. So there is only one charset.

Effectively this means you need only one $this->charset in the BE: a 
copy of $LANG->charset.

Masi


More information about the TYPO3-team-core mailing list