[TYPO3-english] language switcher with typoscript :: prevar gets lost if linked to default language

Roland most.wanted at gmx.at
Fri Mar 30 08:33:14 CEST 2012


hi everybody,

i wrote this simple language switcher:

--- language switcher ---
lib.languageSwitcher = TEXT
lib.languageSwitcher {
	value = English
	typolink {
		parameter.data = field:uid
		additionalParams = &L=2
	}
}

[globalVar = GP:L=2]
lib.languageSwitcher {
	value = Deutsch
	typolink {
		additionalParams = &L=0
	}
}
[global]
--- /language switcher ---

it works fine, but there is one thing that i don't like:

the links to the english version of the websites pages look like this:

www.domain.com/en/myPage/

the links to the german version of the websites pages look like this:

www.domain.com/myPage/

the language prevar in this link seems to get lost.

if i visit www.domain.com/de/myPage/ everything woks fine - also the 
links in my menues and all the links inserted by editors via RTE link to 
pages like www.domain.com/de/anotherPage/. so there the language prevar 
does not get lost.

any clues, why my language switcher doesn't work like i expected it?

i use german as my default language. the id of english is 2.

--- my language configuration: ---
config {
   linkVars = L
   uniqueLinkVars = 1
   language = de
   locale_all = de_DE
   htmlTag_langKey = de
   sys_language_uid = 0
}

### alternative Srachen ###

### Englisch
[globalVar = GP:L=2]
config {
   language = en
   locale_all = en_GB
   htmlTag_langKey = en
   sys_language_uid = 2
}
[global]
--- /my language configuration ---

kind regards.

roland


More information about the TYPO3-english mailing list