donators

n@work Internet Informationssysteme GmbH
Your ad here

Advertising

Localizing of TS-Objects

By: Martin

01.03.08 16:15 Age: 266 days

You Sometimes want to localize a little more than just a text. So this methods allow you change complete TS-ContentObjects.

A simple way to change Objects based ob the active language is this:

  1.  
  2. page.30 = CASE
  3. page.30{
  4.   key.data =  TSFE:config|config|sys_language_uid
  5.  
  6.   default = TEXT
  7.   default.value = This is the default TEXT
  8.   default.typolink.parameter = 123
  9.  
  10.   1 = TEXT
  11.   1.value = Text in einer alternativen Sprache
  12.   1.typolink.parameter = 456
  13. }
  14.  

 

I personally prefer this second solution wich is based on the config.language property. It's more readable and will work in different typo3 setups wich might have different language id's:

 

  1.  
  2. page.40 = CASE
  3. page.40{
  4.   key.data = TSFE:config|config|language
  5.  
  6.   en = TEXT
  7.   en.value = This is the default TEXT
  8.   en.typolink.parameter = 123
  9.  
  10.   de = TEXT
  11.   de.value = Text in einer alternativen Sprache
  12.   de.typolink.parameter = 456
  13. }
  14.  

Found a mistake?

If you found a mistake or if you have a good tip or suggestion, please contact me at thomas(at)typo3-unleashed.net. I will check it and correct the entry or insert the new one.

Thanks in advance for your help.