[Typo3] Using [language] condition

JoH info at cybercraft.de
Fri May 27 16:22:42 CEST 2005


> [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

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list