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().
| Comment | File | Size | Author |
|---|---|---|---|
| problem-when-no-translation.patch | 398 bytes | anantagati |
Comments
Comment #1
kevinseo commentedHi, good post.
I have been thinking about this issue, so thanks for writing. I will certainly be subscribing to your blog.
Comment #2
Stephen Scholtz commentedThe 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.
Comment #3
neochief commentedComment #4
iztok commentedWouldn'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.
Comment #5
knalstaaf commentedNot "can be" -> "is" (duplicate content).