• Resolved behrang

    (@behrang)


    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/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Carlos

    (@carlos_a_sanz)

    Hi,

    how are your slugs? Paste it here.

    Thread Starter behrang

    (@behrang)

    hi my slugs are very simple like ‘stadt’ and ‘cities’

    Plugin Author Carlos

    (@carlos_a_sanz)

    Can you paste it here all url, please?

    Thread Starter behrang

    (@behrang)

    Plugin Author Carlos

    (@carlos_a_sanz)

    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.

    Plugin Author Carlos

    (@carlos_a_sanz)

    Here the issue for this bug, targeted to 1.1.5

    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 %.

    Plugin Author Carlos

    (@carlos_a_sanz)

    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?

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

    Thanks

    Plugin Author Carlos

    (@carlos_a_sanz)

    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.

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Qtranslate Slug Problem’ is closed to new replies.