Feeds:
RSS
Atom

This question often pops up in the mailing lists: how do I create multilanguage web site using TemplaVoila?

The answer can be found in Kasper's excellent Opens external link in new windowlocalization guide but this document is very large and two technical. There are step-by-step instructions there and it can be hard to read for non-technical people. Thus I decided to publish instructions here.

  • Open List module on the "Globe" level. This is a very top of the page tree
  • Create your web site languages there. Remember if you have many sites in the tree all these languages will be available to all sites!
  • Go to your record storage. This is a sysfolder where your TemplaVoila data sources (DS) and template objects (TO) are located
  • Open DS record for page. Check if you have the following code after <T3DataStructure> but before <ROOT>:

       <meta>
            <langDisable>1</langDisable>
        </meta>

    If there is no such code, add it
  • Now go to your TypoScript template for this site (use Web>Template module) and add the following there:

    config.linkVars = L
    config.uniqueLinkVars = 1
    config.sys_language_overlay = content_fallback
    config.language = en
    config.sys_language_uid = 0

    [globalVar = GP:L = 1]
    config.language = de
    config.sys_language_uid = 1
    [global]

    This code does the following:
    • Adds parameter named "L" to each link. This parameter will contain identifier of current language
    • Define correct language overlay mode (do not ask why, see Kasper's tutorial)
    • Defines default language as English. Notice how it is set: regardless of any value that "L" parameter may have. So you always have value for the default language!
    • If "L" is set to 1, modify language settings to German (I ecided to use German in this example)
  • Now use Web>Page module and go to the page you want to localize. Make sure that "Translations" tab is visible and expanded
  • Use "Create new page translation" and select a language for translation (German in out example). Notice that you do not have default language there
  • Edit page properties for this language (enter localized title, etc) and save it
  • Now all content elements on the page will have a link to localize them. You can add translations

This is it. The only other thing you may want to do is to change flag for default language. It is easy, just add the following to the TS config of the root page of your site (in page properties):

mod.SHARED.defaultLanguageLabel = English
mod.SHARED.defaultLanguageFlag = /typo3/gfx/flags/en.gif

[Update, 14.09.2007] There was a error in this article. Thanks to "!ian" for noticing and notifying me.

Like it? Then bookmark it! digg.comdel.icio.usgoogle.comMyLink.deYahooMyWebTechnoratiFurllive.comnetscapeTagThatWebnews

10 Comments

  1. on Tuesday, 17-10-06 09:52 Peter
    Excelent work, Dimitry! I've searched for such a short summary two weeks ago, unsuccessfully ...

    Regards
    Peter
  2. on Monday, 23-10-06 18:37 Martin
    Hi,

    Don't you mean:


    1


    For container DS elements? This is what the localization guide suggests.
  3. on Monday, 23-10-06 18:38 Martin
    Oh well, the XML was stripped. Trying again:

    <meta>
    <langDisable>1</langDisable>
    </meta>
  4. on Tuesday, 24-10-06 12:18 Dmitry
    Martin, you are right, I accidentally copied from FCE DS.
  5. on Monday, 05-02-07 16:56 Nils
    hi, thanx for the comprehensive & simple instruction!

    one question: ain't
    uniqueLinkVars boolean?

    and linkVars is where you add the params?

    that's what I found here:
    http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/7/3/
  6. on Sunday, 22-04-07 16:00 Perelin
    hi, i must add that one will need the static_info_tables extension.
  7. on Wednesday, 02-05-07 10:43 umc
    Indeed it is an axcelent tutorial. Do you also have a small tutorial on how to add the language flags to a page ? I have found something written by Kasper, and I have seen the TypoScript from the testsite, but I'm not exactly sure how I should make it work with my own site...
  8. on Monday, 24-12-07 14:39 Feodor
    Thanks Dmitry, good and clever tutorial!
  9. on Friday, 28-12-07 14:36 Jazzman
    I found an error:

    Better if we use (in newer versions of Typo3):

    mod.SHARED.defaultLanguageLabel = English
    mod.SHARED.defaultLanguageFlag = en.gif
  10. on Monday, 06-10-08 20:40 kuchdilnekaha
    fuck u

Leave a Reply