donators

n@work Internet Informationssysteme GmbH
Your ad here

supported by

 TYPO3 Hamburg
 TYPO3 Anbieter

Advertising

Binding of localizations to Domain-Names

By: Martin

01.03.08 16:39 Age: 125 days

Sometimes you want to select the active language of a website by a specific domain or subdomain instead of using the L Parameter. A combination of TS-Conditions and config.baseURL does the trick.

So check this out:

  1.  
  2. # setup for englisch :default
  3. config.baseURL = http://www.anydomain.com/
  4. config.language = en
  5. config.locale_all = en_UK
  6. config.htmlTagLangKey = en-UK
  7. config.sys_language_uid = 0 
  8.  
  9. # switch to french
  10. [globalString = IENV:TYPO3_REQUEST_HOST=http://www.anydomain.fr]
  11.   config.baseURL = http://www.anydomain.fr/
  12.   config.language = fr
  13.   config.locale_all = fr_FR
  14.   config.htmlTagLangKey = fr-FR
  15.   config.sys_language_uid = 1 
  16. [global]
  17.  
  18. # switch to german
  19. [globalString = IENV:TYPO3_REQUEST_HOST=http://www.anydomain.de]
  20.   config.baseURL = http://www.anydomain.de/
  21.   config.language = de
  22.   config.locale_all = de_DE
  23.   config.htmlTagLangKey = de-DE
  24.   config.sys_language_uid = 2 
  25. [global]
  26.  

Notice that the default language switch (HMENU, special = language) will not work with this setup. Maybe i will post a solution later.

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.