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.

Need some help with multi-language support

January 03, 2011 9:10am

Subscribe [3]
  • #1 / Jan 03, 2011 9:10am

    ICCRS

    30 posts

    I’ve run into a few problems with a site I’m trying to make available in different languages. It’s actually live now, and can be seen here.

    I followed the Multi language site alternative method but without removing index.php from my urls.

    I’m having two major problems, one of which I have already described in the code share corner, but there hasn’t been any help yet and I don’t know where else to turn.

    First, I’m having an issue with the language switching code that is mentioned in the wiki. The given code is:

    < script type="text/JavaScript">
    <!--
    function switchLanguage(lang) {
        u = location.href.split('/');
        u[3] = lang;
        location.href = u.join('/');
    }
    //-->
    < /script>

    with links that look like this:

    <a href="/en/">EN</a> | 
    <a href="/fr/">FR</a>

    If you go to the site and navigate to an entry in english, then choose a different language, it will lead to a 404 because index.php is not included in the url. So, it shows “site.com/country_code/template_group/etc…” rather than “site.com/country_code/index.php/template_group/etc…”

    Another issue I’m having is that {comment_url_title_auto_path} is not adding the country_code in between the domain name and index.php. So, any links using {comment_url_title_auto_path} will lead to the default english version, regardless of the language the user is viewing the site in.

    If I could get some help with these issues I’d really appreciate it. The site is live unfortunately, with all of these bugs. Thankfully the target audience is forgiving, but I need to resolve these issues asap, in order to move forward with other development.

  • #2 / Jan 04, 2011 8:06am

    Sue Crocker

    26054 posts

    Hi, ICCRS. This is more of a CodeShare Corner kind of question, but let me see what I can do to help.

    {comment_url_title_auto_path} won’t work for you, so you’ll need to make either a global variable for a snippet to hold the variable you need.

    I’m not seeing the ability to change languages on the site.. am I missing something?

  • #3 / Jan 04, 2011 9:03am

    ICCRS

    30 posts

    Hi Sue,

    Regarding the {comment_url_title_auto_path}, I have gone through and replaced all instances of that tag with the url for each language spelled out and {url_title} dropped in at the end. Ideally, I was hoping for a way to just add the {country_code} into the url. Anyway, that problem has been fixed. I may go back and use a global variable as you suggested.

    The language links are in the upper right hand corner along the menu bar, I guess overshadowed by a graphic. The problem can be seen when on any part of the site other than the front page, and trying to change the language.

    I’m also aware that these questions should really be put into the Code Share Corner, but I’ve waited a while for support and I felt like I’d exhausted my options.

  • #4 / Jan 04, 2011 5:49pm

    Ingmar

    29245 posts

    As Sue said, this is really a topic for the CSS. Moving there for some additional community support. Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases