• Resolved m4j4

    (@m4j4)


    Hi,

    I have a WordPress site and I’m using qTranslate-X.
    I have two languages (English and Deutsch).
    I’m on the page titled Map (in English) and Landkarte (in Deutsch).
    Site title is Jane Roe.

    In head the title is written like this:

    <title><?php wp_title( '|', true, 'right' ); ?></title>

    and displays like this in the browser’s toolbar like this:

    MapLandkarte - Jane Roe

    This is not okay because it displays the page title in English (Map) as well as in Deutsch (Landkarte).

    So what should I do to make it display like this (if I’m on English site):

    Map - Jane Roe

    and like this if I’m on Deutsch site:

    Landkarte - Jane Roe

    Thanks if you can help.

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 15 replies - 16 through 30 (of 32 total)
  • Thread Starter m4j4

    (@m4j4)

    I’ve searched all the files in wp-content/plugins/wordpress-seo folder. There is 131 matches of apply_filters in 19 files. Should I now go and look for a specific filter?

    Hopefully I’m on the right track. I really appreciate your help.

    Plugin Author John Clause

    (@johnclause)

    Yes, this is a good test for the start, but you need to find a place of their code where exactly the wrong title string goes out (normally with echo, printf or similar) and then see if that string is passed through some apply_filters or do_action before that. In case you never heard about those functions yet, you may read https://codex.www.ads-software.com/Function_Reference/apply_filters and related articles, in case you wish to get familiar with this stuff.

    This can be very complex actually, if you never done such thing before, it may be challenging. And it could be that there is no applicable filter, in which case we will have to talk to “WordPress SEO” folks to put one in. But they would expect us to tell them exactly what we want to do, I mean by the line of code. If you do not find the place in the code where it outputs the wrong string for the title by tomorrow, then I will try to do it later in the week.

    Thread Starter m4j4

    (@m4j4)

    Okay. Now I understand what I need to do. I’ll do my best and let you know about my findings.

    Plugin Author John Clause

    (@johnclause)

    BTW, have you seen plugin Yoast SEO fix for qTranslate?

    Plugin Author John Clause

    (@johnclause)

    I looked into their code, it actually enables just one filter, maybe exactly the one which you are looking for? Please, try it.

    Thread Starter m4j4

    (@m4j4)

    I didn’t know about this plugin. I’ve just installed it but the problem remains.

    Plugin Author John Clause

    (@johnclause)

    Hi @m4j4, I may be able to work on this tomorrow, did you get any progress? Some tips for me to take into account? Are you still interested in resolving it?

    Thread Starter m4j4

    (@m4j4)

    Hi, @john, I have found that if I put:

    if ( is_page() ) {
        return $title;
    }

    at the very beginning of the function called title (line 323 of wordpress-seo/frontend/class-frontend.php) than my Pages get a nice <title> again.

    A nice means translated so:

    Map - Jane Roe

    when on English and

    Landkarte - Jane Roe

    when on Deutsch site.

    Is this of any help?

    Thread Starter m4j4

    (@m4j4)

    And yes, I’m still interested in resolving it.

    Plugin Author John Clause

    (@johnclause)

    Yes, it points to a right file. Is $title already translated at that point or does it get translated later? I need to be able to reproduce your case, which I did not try yet. It just occured to me that the author of Yoast SEO fix for qTranslate may be able to improve his plugin with your case much quicker than anybody else, since he apparently already did a lot of investigation.

    Could you ask him first, and if he does not reply, then we will have no choice but to get engaged on our own. Could you please, submit a message on his support forum and cite a link to this thread, so that you would not have explain all over again.

    Thread Starter m4j4

    (@m4j4)

    Okay, I’ve posted a question also on WordPress SEO by Yoast support forum.

    https://www.ads-software.com/support/topic/title-tag-displays-all-the-languages?replies=1#post-6574685

    Plugin Author John Clause

    (@johnclause)

    This will probably not help, since that community does not use q. It seems like the author of “Yoast SEO fix for qTranslate” does not support his plugin anymore, so he will not help either. I might start looking into it today.

    Plugin Author John Clause

    (@johnclause)

    @m4j4: There is a workaraound solution found in this topic: https://www.ads-software.com/support/topic/both-english-and-german-titles-showing-up-in-the-page-title, does it help you?

    Plugin Author John Clause

    (@johnclause)

    @m4j4: Now, I cannot reproduce the described behavior, it shows title correctly for me. Please, figure out the minimum configuration, which I could reproduce with publicly available theme and plugins, or send me admin login to qtranslateteam at gma il d co m for a test-copy of your site, where I could do modifications without interfering with you.

    Thread Starter m4j4

    (@m4j4)

    … just answering one of your questions above:

    Your question: Is $title already translated at that point or does it get translated later?

    Answer: Yes it is already translated when it gets into the function called title.

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘How to make title tag translatable?’ is closed to new replies.