While creating multi-lingual websites with TYPO3 generally you have two ways to do that:
either create one page tree which contains a single page for each language, i.e. using TYPO3's language overlay concept
or create multiple page trees, one for each language. In this case you want the visitor to start at different pages depending on the preferred language.
Installing this extension is fairly easy. Just download it via the extension manager (EM) and click on the install button.
There's (almost) no configuration necessary! The only things you'll have to take into account are the titles of your supported languages. Let's see how it works:
You create your website's languages just as normal, but instead of choosing a descriptive title like "english" or "german" you'll have to use the two-letter country codes defined in ISO 3166 (see Appendix A for a full list).
You only have to define the addtitional languages, your default language (L=0) will be used whenever no other language seems to fit. So if your website provides german, english and spanish, your website languages list might look as follows:
If you have the table static_languages installed (which you should if you're running TYPO3 3.6.0 or later), it's even one step easier: You don't have to care about the language's title, just choose the right ISO code instead (as you can see in the next screenshot):
You should define which language is your default language, ie. the ISO code of the language which will be shown with the parameter L set to zero. See the TypoScript Reference below how to set the default language.
So you need different structures for each language? Then you will likely choose the multiple page tree method (this method is explained on this page at typo3.org).
In order to enable it, you'll have to add some TypoScript to the setup field of your root template. Just have a look at the example:
plugin.tx_rlmplanguagedetection_pi1 {useOneTreeMethod = 0
multipleTreesRootPages {de = 216
en = 120
es = 482
}
}
First you disable the One-Tree-Method by setting useOneTreeMethod = 0. Then you define the unique ids of those pages being the root page for each language.
In our example visitors who prefer spanish will automatically guided to the page with the id 482 if they enter the website.
Property: | Data type: | Description: | Default: |
|---|---|---|---|
useOneTreeMethod | boolean | If true, the One-Tree-Method will be used, otherwise the Multiple-Trees concept is chosen. See the manual for more information about these two concepts. | 1 |
multipleTreesRootPages | array of isocodes | When using the Multiple-Trees-Method, you have to define the different languages which are available throughout your website. You do that by using isocodes for the languages and pointing them to the appropriate page id. Example: ... multipleTreesRootPages {de = 216 en = 120 es = 482 } | |
defaultLang | string | Set this to the ISO code of your default language (L=0) plugin.tx_rlmplanguagedetection_pi1 {defaultLang = de } | |
dontAddSchemeToURL | boolean | When the URI is built for redirecting to a different page, the URL is parsed through a function which adds the correct scheme. I.e. 246.0.html?L=1 will be transformed to http://yourhost.com/246.0.html?L=1. This behavior makes sense of course, but you might have a certain enviroment (some testing setup) where you want to disable this feature. In that case, set dontAddSchemeToURL to 1. For most people it's safe to leave setting as is. | 0 |
How can I make sure that the language detection works fine?
Just change your browser's language settings: You can choose different languages as well as a priority for each of them. If you hit a page of your website without any L parameter in the URL, the extension should apply the correct language.