WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Using with qTranslate (10 posts)

  1. mamouneyya
    Member
    Posted 3 years ago #

    qTranslate filters the post titles/contents using a hidden html/shortcode tags:
    <!--:en-->English Title<!--:--><!--:ar-->Arabic Title<!--:-->
    [:en]English[:ar]Arabic

    Since WordPress SEO fills the SEO title unfiltered, the post gets an ugly and long (very long sometimes) SEO titles. Is it possible to make a workaround for this?

    The ultimate solution would to assign the right title to every translation version (English title with pointing to the English URL, Arabic title with pointing to the Arabic translation URL, etc). The short solution would to always assign the default locale name with the default post URL.

    Any thoughts...?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. M
    Member
    Posted 3 years ago #

    I would be interested in a solution for this as well.

  3. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    I do not currently have anything planned for this, patches are welcome though!

  4. youtag
    Member
    Posted 3 years ago #

    hello, i thought i'd share my quick patch.

    basically, I added the wp translate function __() to title, meta description and keywords, so it should work with all standard compliant translation plugins.

    file: frontend/class-frontend.php

    Line 170: return esc_html( stripslashes( __($title) ) );

    Line 416: echo "\t<meta name='description' content='".esc_attr( strip_tags( stripslashes( __($metadesc) ) ) )."'/>\n";

    Line 374: echo "\t<meta name='keywords' content='".esc_attr( strip_tags( stripslashes( __($metakey) ) ) )."'/>\n";

    Joost, Thank you for the amazing plugin. I would love to see this patch integrated in future versions.

  5. karl19
    Member
    Posted 3 years ago #

    Yeah, we'd also love it if WordPress SEO played nice with qTranslate, as it's the multi-lingual plugin we use for most projects.

    It would be great if WP-SEO could check languages and if two, show two input fields for meta titles, one for each language, and so on.

    What would be absolutely amazing would be if WP-SEO would sense which language is currently being worked with (which language content tab is selected) and allow for SEO/meta input for just that language.

    But I guess either of these two scenarios would require too much custom coding specific to qTranslate?

    At the moment, we're using All-in-One-SEO and have it so it works to input [:se]Svensk titel[:en]English, but it doesn't feel very clean.

    On the whole, we'd love to switch over to WordPress-SEO, it seems like an amazing plugin, love details such as "snippet preview"!

  6. Beee
    Member
    Posted 3 years ago #

    @youtag that solution works for me as well, thank you for that patch...

    yoast should check it and if proven ok, implement it...

  7. treska32
    Member
    Posted 3 years ago #

    Hey, can you @beee and @youtag describe me more in details how can code above (with implanted translate function) helps me. I did that but I still have problem. I would love if there would be any solution from Yoast in a way as qTranslate META plugin (so different SEO title, description for each language).

    Thank you!

  8. youtag
    Member
    Posted 3 years ago #

    @treska32 do you get an error message? if not, please provide a copy of the meta tags in your source code, so we might be able to help you.

    @beee you're very welcome.

    @karl19 i am aware that this is just a quick patch ... i've also tried to make the translations play nice with the live preview, but it didn't really work as expected.
    your idea of editing language specific content according to the selected language tab would certainly require a very tight dependency between both plugins.

    i would love to see a future version of qTranslate scrap the idea of language tabs entirely, and make editing different languages as easy as switching between admin language using the flags in the main menu. This would keep editing different languages simple and friendly to all plugins as long as they pass all language specific input strings through the __() function...

  9. karl19
    Member
    Posted 3 years ago #

    @youtag, yes that's a great idea, if qTranslate could swap the whole editing screen when switching between languages, instead of just the content field. We've been working with WPML for a client project lately and it's very convenient having all language specific options on one page without having to switch tabs or use shortcodes - if qTranslate could have it all within the same post (rather than linking posts as with WPML), that would be very neat.

  10. Javier A.S.
    Member
    Posted 2 years ago #

    @youtag,

    Hello, I´m trying to apply the patch.
    Please, Could you help me with some comments?

    I open the file: frontend/class-frontend.php

    But I have this code on line 416, original code:

    * @since 1.0.3

    Example:

    413 /**
    414 * Adds 'prev' and 'next' links to archives, as described in this Google blog post: http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
    415 *
    416 * @since 1.0.3
    417 */

    What should I do?
    Replace the original code by your code on that lines seems not working. Specially on line 416 ( A commented codeline ), so
    I ´m forgotting something but I don´t know what...

    Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic