Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16381

    Hello, I’m having a problem with the qTranslate plugin. If I’m on a page, and want to navigate to other language version, I clicked the flag, however it takes me to the home page in the new languagua, but not to the page I wanted.

    A friend of mine put the language selection flags next to the search box of the theme, however I think he did something wrong because If I’m in a page and hover the mouse over the English Flag, Chrome shows me before I click that the url is the English version of my site, and not the English version of that page/post.

    I leave here the code my friend put on the header of the template. Thanks for your help!

    <ul class="idioma">
    <?php
    global $q_config, $lang;
    if(!empty($q_config['enabled_languages'])){

    //echo(get_query_car("lang"););
    $sub = "<ul>";
    ?>
    <li>
    <?php
    foreach($q_config['enabled_languages'] as $lenguaje){?>

    <?php
    if(qtrans_getLanguage() == $lenguaje){
    ?>
    <a title="<?php echo $q_config['language_name'][$lenguaje];?>" href="<?php echo get_bloginfo("url")."/".$lenguaje."/";?>">
    <img src="<?php echo content_url()."/".$q_config['flag_location'].$q_config['flag'][$lenguaje];?>" />
    </a>
    <?php
    }else{
    $sub .= '<li><a title="'.$q_config['language_name'][$lenguaje].'" href="'.get_bloginfo("url")."/".$lenguaje."/".'">
    <img src="'.content_url()."/".$q_config['flag_location'].$q_config['flag'][$lenguaje].'" />
    </a></li>';
    }
    ?>
    <?php
    }

    #91303

    Hi,

    Find this code on the snippet above

    <a title="<?php echo $q_config['language_name'][$lenguaje];?>" href="<?php echo get_bloginfo("url")."/".$lenguaje."/";?>">
    <img src="<?php echo content_url()."/".$q_config['flag_location'].$q_config['flag'][$lenguaje];?>" />
    </a>

    and replace it with this

    <a title="<?php echo $q_config['language_name'][$lenguaje];?>" href="<?php echo the_permalink()."/".$lenguaje."/";?>">
    <img src="<?php echo content_url()."/".$q_config['flag_location'].$q_config['flag'][$lenguaje];?>" />
    </a>

    Change bloginfo(url) to the_permalink. Hope this works.

    Regards,

    Ismael

    #91304

    Ismael,

    Thanks for your help, unfortunately It doesn’t work, but you are close to the solution. If you visit:

    http://chacrasdecoria.travel/es/nuevo-chef-lares-de-chacras/

    before making the changes your suggest, when I hover the mouse over the the flags, the url that Chrome shown were:

    Spanish: http://chacrasdecoria.travel/es/

    English: http://chacrasdecoria.travel/en/

    Now, after I made the changes the results are:

    Spanish: http://chacrasdecoria.travel/es/nuevo-chef-lares-de-chacras//es/

    English: http://chacrasdecoria.travel/en/

    In the Spanish url the problem is the las /es/

    And in the English url nothing changed, after modifying the code.

    Any idea on how to solve it?

    Thanks Ismael!

    #91305

    Guys, do you have any idea on how to solve the problem I had after modifying the code?

    Thanks!

    #91306

    Hi saynw,

    I’ve tagged Ismael on this topic so he can address the code he provided and see if a fix is doable.

    Regards,

    Devin

    #91307

    Thanks Devin, I´ll be waiting for Ismael help!

    thanks

    #91308

    Afaik “the_permalink” already echos the permalink. I corrected Ismaels code a bit:

    <a title="<?php echo $q_config['language_name'][$lenguaje];?>" href="<?php echo get_permalink()."/".$lenguaje."/";?>">
    <img src="<?php echo content_url()."/".$q_config['flag_location'].$q_config['flag'][$lenguaje];?>" />
    </a>

    #91309

    Dude, thanks for your code. Still is the same result. If you enter to this Spanish post

    http://chacrasdecoria.travel/es/nuevo-chef-lares-de-chacras/

    Hover your mouse over the Spanish flag, you’ll see the url is incorrect, and the English flag is linking to the English home page.

    I don’t know if it helps, but this site (www.laresdechacras.com) uses the plungin and is correctly working.

    Thanks for your help, I think this is the las issue I have with my site before the final result!

    Thanks!

    #91310

    Guys a friend of mine fixed it. He said there was a problem with the code of the hidden flag, so he put one next to the other and it fix the problem.

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

The topic ‘Problem with qTransalete. Please Help!’ is closed to new replies.