Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #3683

    Hi,

    I use qTranslate for my bilingual website. All translations work fine.

    There is just one problem with the “home” link of the “main” menu, created by the menu manager of WP 3.1:

    For “home” I have created a link to “http://mysite.de”. It works, if I now click at the English flag – the site is English = okay.

    But if I click at another English page and click back to “home” – this “home” link switches back to the default (= German) language.

    In the qTranslate forum I found, that this is a problem of themes:

    Clicking on the Title/Home-Link resets selected language:

    This is a template problem. Your template is using get_option(‘home’) to get the link for the front page, which is BAD! get_option is not supposed to be used in templates. There is a function called bloginfo for templates. Use that instead and everything will work the way it is supposed to.

    So what can I do, so that the “home” link does not resets the language?

    Thanks.

    #43295

    Hey,

    open up lots_of_small_helpers.php (avisioframeworkhelper_functions) and search for following code:

    echo "<li $current><a href='".get_settings('home')."'>Home</a></li>";

    Replace it with:

    echo "<li $current><a href='".bloginfo('url')."'>Home</a></li>";

    #43296

    You made my day!!! I have spent nearly the whole night over this problem – but now it works fine, thanks a lot!

    #43297

    Glad that I could help you :)

    #43298

    I just saw, that the menu, made with the menu manager (“main”) of WP 3.1 cannot be translated by qTranslate.

    I have no idea, how to get a translation within the menu manager fields.

    Has anybody an idea?

    Thanks.

    #43299

    ok, just found it out:

    Put in your menu manager this code for switching between German and English:

    [:de]German menu title[:en]English menu title

    This works in the menu title and in the description :-)

    #43300

    Just a last question (I hope):

    in which template file can I found the code for the “additional page options” -> “additional headline”, because qTranslate cannot translate them, too.

    If I add the required code

    [:de]german additional headline[:en]English additional headline

    in the field for the additional headline of a page, the additional headline of a page don’t “interpretes” this code, but shows it as real text [:de]german text[:en]English text

    #43302

    Hi,

    I have the same problem mentioned above, I am under the theme “Abondunce” but I can not find the file lots_of_small_helpers.php (Abundance Framework helper_functions).

    For many hours I’m looking for but I find nothing.

    Thank you for you help

    Aaron

    #43303

    Hey!

    The code can be found in abundanceframeworkphpclass-megamenu.php

    Regards,

    Peter

    #43304

    Thank you Dude :)

    Regards,

    Aaron

    #43305

    I replace the code, but it’s still not working.

    When I want to return to the home page I click on the logo and I return to the default language.

    #43306

    The logo code can be found in abundanceframeworkphpfunction-set-avia-frontend.php:

    function avia_logo()
    {
    if($logo = avia_get_option('logo'))
    {
    $logo = "<img src=".$logo." alt='' />";
    $logo = "<h1 class='logo'><a href='".home_url('/')."'>".$logo."</a></h1>";
    }
    else
    {
    $logo = get_bloginfo('name');
    $logo = "<h1 class='logo bg-logo'><a href='".home_url('/')."'>".$logo."</a></h1>";
    }

    return $logo;
    }

    #43307

    Really thank you Dude

    I found the code logo but what do I do?

    #43308

    I believe you need to do the same as in Dude’s first post.

    Replace

    <a href='".home_url('/')."'>

    with

    <a href='".bloginfo('url')."'>

    at all occurrences.

    I’m not certain if this’ll do, but it should work the same way.

    Cheers,

    Chris

    #43309

    thank you Chris

    But I have many problems, I replaced. Home_url (‘/’). “‘> with .bloginfo (‘ url ‘).'”> But it does not work. When I click on the logo I do not go back on the home page.

    Can send you more precision.

    Really thank you for your help

    #43310

    Hey,

    Replace the code Dude pasted by

    function avia_logo()
    {
    $lang = isset($_GET['lang']) ? '?lang='.esc_attr($_GET['lang']) : '';

    if($logo = avia_get_option('logo'))
    {
    $logo = "<img src=".$logo." alt='' />";
    $logo = "<h1 class='logo bg-logo'><a href='".home_url($lang)."'>".$logo."</a></h1>";
    }
    else
    {
    $logo = get_bloginfo('name');
    $logo = "<h1 class='logo bg-logo'><a href='".home_url($lang)."'>".$logo."</a></h1>";
    }

    return $logo;
    }
    }

    Cheers,

    Chris

    #43311

    Merci Chris

    Ca marche trés bien,vraiment merci à tous pour votre soutien.

    Best regards

    Aaron

    #43312

    I am back

    It works only locally it does not work live.

    #43313

    I did a lot of tests I change the permalinks now it works but the problem is that when I click “ESHOP” I do not keep the language selected.

    I’ve put a link to that can understand the problem.

    I have half the languages ​​in the lower left in the footer.

    http://tinyurl.com/d2hgxse

    Regards

    Aaron

    #43314

    Hi!

    Please contact the WooCommerce devs if they plan to support qtranslate. As far as I know WooCommerce does not support it and it’s not possible to translate the shop page with qtranslate.

    Best regards,

    Peter

    #43315

    Thank you Dude for the information I’ll get closer to WooCommerce.

    Regards

    Aaaron

Viewing 21 posts - 1 through 21 (of 21 total)

The topic ‘qTranslate: "home" link resets selected language: how to modify code?’ is closed to new replies.