WordPress.org

Ready to get started?Download WordPress

Forums

Qtranslate Slug
[resolved] Qtranslate Slug Problem (12 posts)

  1. behrang
    Member
    Posted 1 year ago #

    Hi,
    i got this one problem:
    wenn i create posts with different slugs for english and german then i get a not found error when switching from english view of the post to the german.
    I use the normal flag switcher.
    and the url changes as it should (different slug, so it's normal)

    when i use the same slug for both english and german it's fine
    any suggestion?
    i have latest wordpress (3.5) and qtranslate (problem existed before 3.5 too)
    greets
    behrang

    Posts: 2
    Joined: Sun Dec 23, 2012 11:53 pm

    http://wordpress.org/extend/plugins/qtranslate-slug/

  2. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    how are your slugs? Paste it here.

  3. behrang
    Member
    Posted 1 year ago #

    hi my slugs are very simple like 'stadt' and 'cities'

  4. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    Can you paste it here all url, please?

  5. behrang
    Member
    Posted 1 year ago #

  6. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, there is a little bug, it doesn't recognise the main language because is disabled on the url...

    Try to enable it:

    • Go to Settings > Languages
    • Click in Advanced Settings ( Show )
    • And disable the option ''Hide URL language information for default language."
    • Save and visit Settings > Permalinks to rebuild permastructures

    Post here if this works to close the topic.
    C.

  7. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    Here the issue for this bug, targeted to 1.1.5

  8. redywebs
    Member
    Posted 1 year ago #

    I have tried your workaround but it doesn't work. Slugs aren't translated so it redirects to de/slug_in_english which doesn't exist.

    Update: it works on widget but not when post exists in other languages with: Sorry, this entry is only available in %LANG:, : and %.

  9. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    For now this qtranslate feature on the content (Sorry, this entry is only available in %LANG:, : and %) is unsuported by qtranslate-slug. I will add support in next versions. Here the issue.

    The switcher in widget and menu works for you?

  10. redywebs
    Member
    Posted 1 year ago #

    Yes it does.
    Would you please publish here when your next version is ready? In the meantime, is there any workaround?

    Thanks

  11. Carlos
    Member
    Plugin Author

    Posted 1 year ago #

    Ok!

    You could modify (at your own risk) qtrans_use function, in qtranslate_core.php on line 785

    // if no languages available show full text
    if(sizeof($available_languages)==0) return $text;
    // if content is available show the content in the requested language
    if(!empty($content[$lang])) {
    	return $content[$lang];
    }

    add:

    else {
    	return '';
    }

    the result:

    // if no languages available show full text
    if(sizeof($available_languages)==0) return $text;
    // if content is available show the content in the requested language
    if(!empty($content[$lang])) {
    	return $content[$lang];
    }  else {
    	return '';
    }

    This will disable the message Sorry, this entry is only available.....
    Hope was useful.
    C.

  12. redywebs
    Member
    Posted 1 year ago #

    Thanks for your time and quick response Carlos, I'll try, but also wait for the new version as disabling the message is not exactly what I intended.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic