[TYPO3-english] Language dependent typoscript CONSTANTS

J. Peter M. Schuler j.peter.m.schuler at icb.uni-due.de
Thu Feb 14 11:02:47 CET 2013

Dear all, 

in short: Is there any simple way to have ts.constants with translation possible?

I know that with ts.SETUP I have the opportunity for following code, which does the l10n 'automatically' (instead of relying on L-var conditions directly):
======== snip ==========
xyz.text = <my default text goes here, e.g. mylabel-default>
xyz.text.lang.en =  <my special English version here, e.g. mylabel-en>
xyz.text.lang.nl =  <my special Dutch version here, e.g. mylabe-nl>
======== snip ==========

However I work with many different subsites relying on the same template, who all use different labels in different languages (e.g. for pagetitles). However not all labels are filled. My current approach is to define three constants per label (mylabel-default, mylabel-en, mylabe-nl) and refer to them in the setup code. This leads to a problem in case e.g. the Dutch version isn't filled: instead of falling back to default language it just shows the empty constant.
The only way I see to fix this fallback-issue is to have a LIT-condition on every non-default language that overwrites the content with the default language. This would lead to 3 lines of code per label per non-default-language, which adds up quite fast.

So it seems it would be best to skip constants for this part and use ts.SETUP? 
Or is there some way to use constants in an l10n way I didn't stumble upon yet?

Best regards and thanks for at least reading this,

More information about the TYPO3-english mailing list