i just updated my site to 4.6.1. before anything was fine, but now i've some troubles with the links to translations of the nodes.

the link is generated with the correct nid, but the wrong language code, e.g. "de/node/4" where it should be "en/node/4". the language code is always the currently active language.
this occurs for the links generated by hook_link and also for the links shown at the translation page of a node.
however, the links in the block are still working (and only these..)

i just don't know, if it's a generic problem or if it has something todo with my setup.
previously i used the patch for taxonomy.module which enables the taxonomy_access module. but i've also tried patching the original files with the orignial i18n patch - no change in behaviour.

i think the problem is in i18n_supported_languages(), which seems to return an incorrect array.
(i use the languages from the localication system)

has anyone else this troubles?

CommentFileSizeAuthor
#1 i18n.inc.patch259 bytesiang
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iang’s picture

FileSize
259 bytes

I have made a patch for this problem.

fago’s picture

thanks, works great.

arsart’s picture

That`s not all!!!

Same bad-urls in "Translation Status" table node/nid/translation
i18n.inc - string 331.

And same error in "translations" table node/nid/edit
i18.inc - string 401

This strings must be patched same way as in attached patch here.

And after all same error in admin/node, so when we`re staying in first language for example ru we have bad url in node list under links of Title and Operations for translated nodes (en).
So, all translated and native node-edit-links and node-title-links in (ru/admin/node) are begins with ru/node/nid/edit BUT must begins with it`s trans-lang.

dtan’s picture

Not too sure what the 4.6.1 upgrade did to break i18n, but I don't think the patch provided in 1 provides the intended behaviour.

From http://drupal.org/node/21151, the desired behaviour was to provide a way to view the translated content by keeping the untranslated interface. . .

Jose Reyero’s picture

Yes, dtan, you're right.
I've just fixed the bug keeping that intended behaviour.

Jose Reyero’s picture

fago’s picture

Category: support » bug

i updated to the latest cvs version.

now the links in the block and these, which are generated by hook_link, are correct and work (as long the translation exists)
but the the translation tab prefix all links with the same language code and the same in the admin/node content overview

a link with the correct language prefix would do it..
however, of course viewing translation without changing the whole interface would be a nice feature

fago’s picture

i've seen that the line 297 i18n.inc was commented out.
i reenabled the line:

    default:
       print theme('page', node_page_default(), '');

now the links are all correct again :)
is there any cause why this should be commented out?

further this would fix this too.
however the "upcoming events" block shows every event 2 times (for each language once) only if viewing a node (not in e.g. the admin-center) :(

steffen’s picture

I have problems with keeping to the selected language. I tried commenting out line 297, as suggested in this thread, but it didn't change my problem.

When I click on a flag, the page I'm currently on changes completely to the other language. However, when I click a link on that page, I revert back to Norwegian again, keeping the page text for the node-link I clicked, but the whole UI, including menus and links reverts to Norwegian.

I have tried this with browser language detection on and off, and with prepended front page on and off, and with all imaginable browsers in different environments with different OS-languages. I cannot find any error messages anyway. My PHP has register globals on, and no strict safe settings.

Jose Reyero’s picture

Status: Active » Closed (fixed)

I've just committed some bug fixes related to this, and anyway this thread is a bit messed up, so I will close it, but feel free to create a new one if any of the bugs persist.

Just some clarifications:

- The intended behaviour, in i18n, is to keep interface language separated from node language. Thus, it should be ok to have the content (node) in one language but all the remaining of the interface in a different one.

- When a node has no translation, clicking on the flag should take you to a page with the same node, but a different language for the remaining of the page.

- Latest cvs version, if something -its not currently being updated- is intended to work only with Drupal-HEAD