To be honest, I don't know if it's a bug or a feature:

The link to a translated version of a shown node with CSS class="il18n-link" (in bluemarine theme it appears directly under the node ) has the wrong language prefix in url.

Example:
An English node has been translated to German.
Under that English node the link to the German node appears with linktext "German" and a German flag.

Now that link has the form:

en/node/node number

but in my opinion it should have:

de/node/node number

-> so that not only the node will be shown in German when you click that link but also the whole site with navigation etc. will switch to German.

CommentFileSizeAuthor
#1 i18n.inc_2.patch472 bytesPierreM-1

Comments

PierreM-1’s picture

Assigned: Unassigned » PierreM-1
Status: Active » Needs review
StatusFileSize
new472 bytes

I agree. My readers and I think this is a weird behavior.

A patch for i18n.inc correcting this issue is enclosed, please tell me if it works for you as well.

ronsens’s picture

Category: bug » feature
Status: Needs review » Active

Yes, thanks! It works and I will use it.

But: with this patch you get the correct language-prefixed translation-node with its node number.

But what if you use aliased URLs? - The optimal variant would be a correct link with the aliased URL.
Additionally I have with URL-aliases a similar but "opposite" problem at the language block:

In Example my example for an English/German-Site: We have two nodes, one written in German, the other one in English and each node is the translated version of the other.

The German node has the URL-alias: germanversion
The English node has the URL-alias: englishversion

By viewing the German node, you will get the following in links in language block:

www.yoursite.com/de/germanversion for the link to the German node
www.yoursite.com/en/germanversion for the link to the English node
(instead of www.yoursite.com/en/englishversion for the link to the English node)

By viewing the English node, you will get the following in links in language block:

www.yoursite.com/de/englishversion for the link to the German node
www.yoursite.com/en/englishversion for the link to the English node
(instead of www.yoursite.com/de/germanversion for the link to the German node)

I don't know if this is a problem of i18n or of path module.

PierreM-1’s picture

Yes, I understand. Well, I will try to see if I can find something better as soon as I have more time.

About the language block, I don't know yet but it may be a similar underlying issue.

kje’s picture

As far I understand (and use) i18n with drupal, working with translated aliases is not supported.

You should use this format:

en/about (points to the English version)
de/about (points to the German version)
fr/about (points to the French version)

Makes sense to me, because the virtual site structure should be the identical (except for lang tag)

Kurt

ronsens’s picture

Category: feature » task

I know what you mean, but an argument for different urls could be SEO reasons, so that you have in urls text of your headlines etc. and in the language that your articles / pages are written.

More of that I would like to use pathauto with its great advantage that you don't have to care anymore for path aliases, but now you have to correct the pathauto-urls for translation of nodes and you have to put the language prefix to any node which is a translation of an other.

Marc Bijl’s picture

I think kje's vision and ronsens argumentation for different URLs don't have to conflict. I mean, it is possible to assign an URL alias for every node, translated in whatever language. So: assign an English URL alias for an English node, and a German URL alias for the same node (translated version) in German.

jose reyero’s picture

Well, just to disipate all doubts, it is there by design, so I'd call it a feature, which is something like "manage mixed interface and content languages".
IMHO, while it may confuse some users, it will help some others, allowing to occassionally see some other version of a story while keeping an stable interface. Besides, if you want to switch language for the whole thing, you only need to click on the Languages block.

While I really want to keep that feature, we could consider adding this other behaviour you want like an option, maybe related to this one: http://drupal.org/node/16632

So if someone provides a good enough patch....

Marc Bijl’s picture

For everyone who might be interested - and to get some attention for this issue as well ;-)
I did some *quiet extensive* testing: http://drupal.org/node/34611

Does someone have any comments, ideas, workarounds, answers? I'm really looking forward to them...

Marc Bijl’s picture

Solution for correct linking from language block can be found here:
- http://drupal.org/node/22345

jose reyero’s picture

Version: 4.6.x-1.x-dev » master
Status: Active » Fixed

Won't fix for 4.6 version but I've added some additional options in HEAD, for 4.7. -translation.module-

I hope everybody is happy with the options in the new version :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)