ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE and bi-lingual sites

March 07, 2008 5:46pm

Subscribe [2]
  • #1 / Mar 07, 2008 5:46pm

    Francis F.

    45 posts

    I have a need for a site that must have English and French content (I’m in Canada). Basically every page on the site has to be duplicated in both languages. Ideally they also want the English page to link directly to the French version of the same page.

    I’m trying to wrap my head around what would be the best way to do this. Has anyone else had to do something like this?

    Any Ideas?

  • #2 / Mar 07, 2008 5:56pm

    Mark Bowen

    12637 posts

    Hi there Francis,

    There are now actually quite a few ways of achieving what you need. One of the best would be Leevi Grahams - Multi Language extension.

    There are also a few of wiki entries here, here and here that may help also.

    Hope that helps.

    Best wishes,

    Mark

  • #3 / Mar 07, 2008 6:13pm

    Francis F.

    45 posts

    Thanks Mark…Thanks great.

    Thanks for the quick reply.

    /ff.

  • #4 / Mar 07, 2008 6:14pm

    Peter Sommerfeld

    86 posts

    Yes, unfortuanatly!  :roll:

    There are several options for your basic design. Search for multi language in the wiki/forum. I’m using this one which generates urls like “fr/news/” or “en/news/” respectivly.

    If you actually translate each article it is not a big deal. You can make custom weblog fields [CP Home› Admin › Weblog Administration] with english-title/french-title, english-body/french body etc. You can access these either in conditional statements or include it like this:

    <div id="content">
    {embed="site/.content-{language_code}" blog="news" }
    </div>

    I prefer the latter because there are usually lots of language dependend snippets like alt/title in images, names, snippets of text etc.

    Regarding switching to the other language I use a small php function on input (german/english here)

    <?php
    function switchLanguage($language_code){
       $uri = explode('?',$_SERVER['REQUEST_URI']);
       $uri = array_slice(explode('/',$uri[0]),1);
       if($uri[0]=='de' || $uri[0]=='en')
          array_shift($uri);
       array_unshift($uri,$language_code);
       return '/'.implode('/',$uri);
    }
    ?>

    and acces it like this:

    <a href="http://">Goto french page</a>

    There are still some gory details like date formatting etc I haven’t find a final solution yet but well…

    HTH, Peter

  • #5 / Mar 07, 2008 6:18pm

    Mark Bowen

    12637 posts

    Thanks Mark…Thanks great.

    Thanks for the quick reply.

    /ff.

    No problem. Hope it all goes well for you.

    Let us know how you get on.

    Best wishes,

    Mark

  • #6 / Mar 07, 2008 6:20pm

    Francis F.

    45 posts

    Thanks Peter. Appreciate the help.

    I will definitely post the link once the site goes live. Won’t be for a few months.

    Best,
    /ff.

  • #7 / Mar 07, 2008 6:31pm

    Mark Bowen

    12637 posts

    Looking forward to seeing it.

    Good luck with everything. My wife and I actually recently did a multi-lingual site here and we used one of the wiki entries to do that but I will definitely be using Leevis; extension in the future if needed as he is an excellent developer.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases