Results 1 to 5 of 5

Thread: Multiple language help

  1. #1
    User
    Join Date
    02-18-10.
    Posts
    32

    Default Multiple language help

    Hi I currently working on a online shop. The shop should work with 22 different languages. I used the change language extension. This was useful in translation of articles. But I have small labels I want to translate.
    For example, I have contact us form. And there is a label on the side of each text box like username,password etc. When I change the language I want to change these labels to. As of now, i think I should make a different form using different languages and add them to there respective site structure. Is there a simpler way to do this. There are so many sismilar cases like this, and repeating the process for each site structure does not seam feasible.
    Please help.

  2. #2
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Multiple language help

    I'm afraid that there is no solid multiple language support like you might be used to. I've, up to this point, always made one form per language.

    Perhaps a translation module could be written? Each element in TL is pretty unique: type/id
    for example: formelement/12 (which could be a select field for example), or contentelement/34, page/1. based on the type you get different content. But if that was constructed I'd like it in the core so each item has this handled properly. You'd get one extra table id,lang,type,typeId,value. If no value exists, then the element is not translated. That's how I did it for my (deceased) cms.

    However, I do not think Leo will ever integrate it Perhaps if we ask him nicely? :mrgreen:

  3. #3
    User
    Join Date
    02-18-10.
    Posts
    32

    Default Re: Multiple language help

    Hmm i see. Well thats bad. Most shops will be multilingual. Hope it will be resolved when Isotope kicks in. Otherwise, this is a serious didsadvantage.

  4. #4
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Multiple language help

    I'm using isotope and it says in the svn log files that they added multilingual support. I haven't tried to use a second language yet and not seen any translation buttons. So it should definitely be in at some level, but I just haven't found it yet...

  5. #5
    New user
    Join Date
    06-11-09.
    Location
    Valence, France
    Posts
    21

    Default Re: Multiple language help

    Hi blessan,

    There is a new insert tag to do that : {{label::*}}

    In /system/langconfig.php define yours vars for each language :
    Code:
    if ($GLOBALS['TL_LANGUAGE'] == 'de')
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = 'Apfel';
    }
    if ($GLOBALS['TL_LANGUAGE'] == 'fr')
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = 'Pomme';
    }
    else
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = 'Apple';
    }
    Replace My_Form and My_Label by what you want.

    And use the insert tag like that :
    {{label::My_Form:My_Label}}

    You can do that in form to have key/value data :
    Code:
    if ($GLOBALS['TL_LANGUAGE'] == 'de')
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = array('Apfel','Wahl eines Apfels');
    }
    if ($GLOBALS['TL_LANGUAGE'] == 'fr')
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = array('Pomme','Choisissez une pomme');
    }
    else
    {
    $GLOBALS['TL_LANG']['My_Form']['My_Label'] = array('Apple','Choose an apple');
    }
    And use the insert tag like that :
    {{label::My_Form:My_Label:0}} //Apple

    {{label::My_Form:My_Label:1}} //Choose an apple

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •