I have site with 3 languages. I enabled Language switcher block and found that when node is translated at least to one language Language switcher block show correct links.

But when there is no translations (for example node/23 is only in English and for Dutch and French there are not translation) Language switcher shows links for all languages (for example /en/node/23, /nl/node/23 and /fr/node/23). Problem is that it should show only link to English.

If somebody use one of links /nl/node/23 or /fr/node/23 it switch to some mix language environment.

Attached is a patch which fixes it. And all languages which don't have translation for specific node are unset in translation_translation_link_alter().

CommentFileSizeAuthor
problem-when-no-translation.patch398 bytesanantagati

Comments

kevinseo’s picture

Hi, good post.
I have been thinking about this issue, so thanks for writing. I will certainly be subscribing to your blog.

Stephen Scholtz’s picture

Title: Wrong links when there is no translation » Language Switcher links when there is no translation
Version: 6.6 » 6.16
Status: Needs review » Needs work

The logic used in this patch (post #3) over in this Drupal 7 issue - #518364: Nodes with one language don't affect the language switcher block - is a little bit better (I think), as it makes sure it's dealing with a node and not something else (ie. View). Suggest maybe updating the above patch, or getting the D7 fix (once it's solid & accepted) back ported to D6.

neochief’s picture

Status: Needs work » Closed (duplicate)
iztok’s picture

Wouldn't it be better if paths in other languages would not exist? This is can be very bad for SEO too!

I guess language switcher should link to front page for languages not translated.

knalstaaf’s picture

This is can be very bad for SEO too!

Not "can be" -> "is" (duplicate content).