[TYPO3] Language condition

Bernd Wilke xoonsji02 at sneakemail.com
Fri Jun 29 21:38:14 CEST 2007


On Fri, 29 Jun 2007 11:29:10 +0200, Francois Suter wrote
with subject "Re: [TYPO3] Language condition":

> Hi,
> 
> > $------------Code begin-----------------------------------$
> > #Site Slogan
> > lib.slogan = TEXT
> > lib.slogan.value = Making known to our community the God that brings
> > true freedom.
> > [language = es]
> > lib.slogan.value = Dando a conocer a nuestra comunidad al Dios que  
> > trae
> > verdadera libertad.
> > [language]
> > lib.slogan.wrap = <h1 id="slogan">|</h1>
> > $-------------------------Code end-----------------------------$
> 
> I wonder where you found that syntax... that's not the way languages  
> are tested. You should have something like:
> 
> #Site Slogan
> lib.slogan = TEXT
> lib.slogan.value = Making known to our community the God that brings  
> true freedom.
> [globalVar = GP:L = xx]
> lib.slogan.value = Dando a conocer a nuestra comunidad al Dios que  
> trae verdadera libertad.
> [global]
> lib.slogan.wrap = <h1 id="slogan">|</h1>
> 
> where "xx" is the uid of the Website language record you defined for  
> Spanish. Please also mind the closing of the condition ([global] not  
> [language]).

Why does everyone think that GP:L decides the language?

It is mostly used, but especially if used in extensions it may confuse
everything.
core functions don't know anything about $_GET['L'], they decide the actual
language on $GLOBALS['TSFE']->sys_language_uid and therefore the actual
language should be asked in typoscript with:

[globalVar = TSFE:sys_language_uid = xx]


#the condition
	[globalVar = GP:L = 5]
# is one way to DECIDE the active language:
# which can have another value than the L-parameter:
	config.sys_language_uid = 3
	config.language = es
	config.locale_all = es_Es
	config.htmlTag_langKey = es
	[global]

#another may be analyzing the domain:
	[globalString = HTTP_HOST=*mydomain.es]
	config.sys_language_uid = 3
	config.language = es
	config.locale_all = es_Es
	config.htmlTag_langKey = es
	[global]


just my 0.02€

Bernd

-- 
http://www.pi-phi.de/t3v4/cheatsheet.html


More information about the TYPO3-english mailing list