[Typo3] Using [language] condition

Jason A. Lefkowitz jlefkowitz at oceana.org
Fri May 27 17:19:01 CEST 2005


JoH wrote:

> Usually language switches are done with [globalVar = GP:L = x] conditions.
> So a real maintainer should be able to find out what it is used for.

[snip]

So [language] is not the preferred condition?  OK -- the documentation 
around it makes it sound a little flaky anyway.  Just seems weird to 
have a conditional called [language] if you're supposed to use something 
else to test for language...

-- Jason


JoH wrote:
>>[language = es]
>>imageFile = fileadmin/images/espanol.jpg
>>[else]
>>imageFile = fileadmin/images/english.jpg
>>[end]
>>
>>... and then refer to {$imageFile} in the SETUP, rather than
>>hard-code the path to the image in there.
>>
>>The only way I've found so far to make it work is to test against
>>[globalVar] rather than [language].    In other words, since I
>>defined Spanish in my Typoscript like this...
>>
>>[globalVar = GP:L =2]
>>page.config.sys_language_uid = 2
>>page.config.language = es
>>page.config.locale_all = es
>>[GLOBAL]
>>
>>[globalVar = GP:L =2]
>>imageFile = fileadmin/images/espanol.jpg
>>[else]
>>imageFile = fileadmin/images/english.jpg
>>[end]
>>
>>This works, but it's not as easy to follow as [language = es] -- I'd
>>prefer that route so that future people maintaining this code have as
>>easy a job as possible figuring out my TypoScript.
>>
>>Any ideas where I might be going off the rails?
> 
> 
> TSref says:
> The values must the a straigt match with the value of
> getenv("HTTP_ACCEPT_LANGUAGE") from PHP.
> So maybe "es" doesn't match this value?
> Usually language switches are done with [globalVar = GP:L = x] conditions.
> So a real maintainer should be able to find out what it is used for.
> 
> Joey
> 



More information about the TYPO3-english mailing list