WordPress.org

Ready to get started?Download WordPress

Forums

mqTranslate
[resolved] [closed] mqTranslate and Qtranslate Slug (22 posts)

  1. andrea.furla
    Member
    Posted 11 months ago #

    Hi Christophe,
    I have a small request to make:
    can you integrate the functions of Qtranslate Slug in your plugin, and adjust the display the correct URL after a search using the search function?

    Thanks,
    Andrea

    https://wordpress.org/plugins/mqtranslate/

  2. chsxf
    Member
    Plugin Author

    Posted 11 months ago #

    I have to admit we have not tested mqTranslate against Qtranslate Slug. Are the plugin not compatible with each other?

  3. andrea.furla
    Member
    Posted 11 months ago #

    Yes,
    Qtranslate Slug is compatible only with qTranslate.
    Actually it only works properly for the slug.
    When are active the others second languages search function doesn't work correctly, after doing a search it always connects to the home page.

    Andrea

  4. canadien
    Member
    Posted 10 months ago #

    Must admit this would be real great!

  5. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    Try modifying qtranslate-slug.php file at line 261 this way :

    Replace

    return ( version_compare($wp_version, "3.3", "<" ) || !is_plugin_active('qtranslate/qtranslate.php') );

    by

    return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );

    This should enable qTranslate Slug for mqTranslate. However, you will have to update this function for each update of qTranslate Slug. You should ask the plugin developer to add this in its code for a more permanent solution.

  6. Drasa
    Member
    Posted 10 months ago #

    This does not work I assure you, I had it until one day I realized that did not work the url, you can not make a mqtranslate slug? qtranslate and qtranslate as slug is vital.

    I had to go back to qtranslate not working because both.

    A greeting.

  7. arreguisergio
    Member
    Posted 10 months ago #

    It worked fine for me!!!

    I replaced

    return ( version_compare($wp_version, "3.3", "<" ) || !is_plugin_active('qtranslate/qtranslate.php') );

    by

    return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );

    Thank you very much chsxf

  8. Drasa
    Member
    Posted 10 months ago #

    I've also done that and it seems to work but if it gets to look good enrealidad failing.

    At least in the htttp ://web.com/en

    Everything works perfectly?

  9. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    Next release of mqTranslate should restore support for qTranslate Slug. There was indeed a bug preventing slugs from being handled correctly, notably in Pre-Path mode.

    We have some tests to do before releasing it to the public, but we hope it will be available very soon.

    However, qTranslate Slug will need to be modified to support mqTranslate as previously stated.

    PS : We have made a request to original plugin developer to support mqTranslate. However, as the plugin has not been updated for more than one year, I suppose it won't happen soon. If you want to follow the discussion, here is the link : http://wordpress.org/support/topic/please-add-support-for-mqtranslate

  10. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    Version 2.6.2.2 restored support for qTranslate Slug but this has brought a regression with that. We fixed the regression but it requires a minor update into qTranslate Slug to make it work with mqTranslate.

    In qtranslate-slug, add this after line 678 :

    if ($GLOBALS['q_config']['url_mode'] == QT_URL_PATH)
    	$req_uri = preg_replace("/^{$GLOBALS['q_config']['language']}(\/|$)/", '', $req_uri);
  11. arreguisergio
    Member
    Posted 10 months ago #

    Great!
    thanks @chsxf for the good work!

  12. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    I suppose that by saying "Now I see the two fields for the slugs", you speak about the admin box from defining custom slugs for each language.

    But what do you mean by "only the main language is taken into-account"?

  13. n4than
    Member
    Posted 10 months ago #

    Here is what I see:
    http://i.share.pho.to/74731276_o.png

    I meant, only the first slug works.

    When I switch the page in english, I see /en/french-slug

  14. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    It seems to me that it is probably related to qTranslate Slug more than mqTranslate. Try posting on their support forms (http://wordpress.org/support/plugin/qtranslate-slug). Other people may have the same issue.

  15. n4than
    Member
    Posted 10 months ago #

    In fact it's even weirder:
    The url with the english slug does exists.

    When the website is in english, the main menu's links are correct.
    When the website is in french, the main menu's links are correct.

    But when I use the selector, for instance, from french to english, the new url is domain.com/en/the-french-slug instead of domain.com/en/the-english-slug

  16. chsxf
    Member
    Plugin Author

    Posted 10 months ago #

    I agree that this is not a "correct" behavior, but maybe it is how qTranslate Slug works at this time.

    I'm sorry but I cannot provide extensive support for other plugins. Once again, you should post on the qTranslate Slug support forums and see if other users of the plugin can help you.

  17. n4than
    Member
    Posted 10 months ago #

    No problem, thanks for your time !

  18. Daniel
    Member
    Posted 10 months ago #

    Just curious if this issue has been actually "resolved?"

    I've like to switch over to mqTranslate but all our websites use Qtranslate Slug and my boss is going to kill me if anything breaks. Many directory sites link back to us via specific links and it's important we keep the structure.

    To be clear, it was said we can modify qtranslate-slug.php by replacing line 261 with this:

    return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );

    and adding this after line 678:

    if ($GLOBALS['q_config']['url_mode'] == QT_URL_PATH)
    	$req_uri = preg_replace("/^{$GLOBALS['q_config']['language']}(\/|$)/", '', $req_uri);

    Will my slugs work the same by doing this? Having read n4than's post I'm assuming it's no. :(

    N4than, have you had any progress with this?

    chsxf, I understand it's not your responsibility to account for other plugins, but I have to admit this is an important feature! Like you said, it's been long since there's been any activity with Qtranslate Slug and I don't foresee any in the near future... Like Dr. Phil says, "The best predictor of future behavior is past behaviour!"

    That said, we're at your mercy! :) Do you foresee any of the following...

    • Integrating seamless compatibility with Qtranslate Slug?
    • Implementing a feature in mqTranslate that handles slugs?
    • Perhaps creating a second child plugin, um you could call it "mqTranslateSlug"? :)

    Just trying to get a grasp on whether or not I should continue looking in this direction as an alternate to Qtranslate as the slugs are an important factor to us!

    Thanks! :)

  19. n4than
    Member
    Posted 10 months ago #

    Hi Daniel,
    to sum it up:
    - the main language of my Website is french, second language is english
    - i use mqtranslate, qtranslate slug with the hack you ve mentioned
    - when I m on the english version, the main menu's links are pointing to the correct translated urls with the english slugs
    So far so good...

    The only problem I ve noticed is when I use the mqtranslate widget selector on a page.
    The url is domain.com/en/french-slug which is not normal

    My guess is that it could be related to the permalinks structure. I should try different settings and see what happens.

    I don't think this is a major issue however. The main point of having qtranslate slug is for SEO. My plan b is to put these en/french-slugs page in no follow, no index, so I can generate a clean sitemap.

    I m not at home at the moment so I ll probably try this tonight or tomorrow. I keep you informed.

  20. Daniel
    Member
    Posted 10 months ago #

    Awesome!

    You're right... It sounds like it could just be a matter of adjusting some settings!

    Please keep us posted on your progress and thanks for your help!

    Good luck and God speed! ;)

  21. Uobet
    Member
    Posted 10 months ago #

    I have similar problems.

    I did the first update:
    return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );

    My question
    I haven't done the second update because I am not sure about the right line after having done the first update.
    Can anybody tell me, what's the code in the lines 677 and 679?

    But as much as I've understood by reading other comments, this won't solve my following problem.

    As to the default language (German) everything works.
    But in the second language (Italian) there are
    b1) some pages which are not found, although the correct Italian slug is shown
    myURL/it/home/ItalianSlug/
    b2) other pages work, but the German Slug is shown
    http://myURL/it/home/GermanSlug/

    It's rather weird and I hope that the Plugin Author may succeed in solving the problem with the next version.

    S

    b2)

    Thank You

    S

  22. n4than
    Member
    Posted 10 months ago #

    I opened a topic on the qtranslate slug's support page by the way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic