Hello, when i edit a node in a language but with the interface in a other language, some links disappears, it's because of the selection mode.
I can correct this with the preserve language module but it had some bad behaviors with others modules.

I corrected this bug by commenting these lines (in i18n_selection_mode function of i18n.module) :

<?php
       
if (($node = menu_get_object('node')) && $node->language) {
         
//$current_mode = 'node';   // LINE COMMENTED
          //$current_value = $node->language; // LINE COMMENTED
       
}
?>

I tested many things to see if this patch could make a problem but i haven't find anything wrong.

I don't have the time to analyze the code of this module so i ask if somebody which knows this module can tell me if this patch can cause a problem.

Thank you

Comments

Indeed, this is another bug in this buggy i18n code :( :(
Can somebody please elaborate why this weird code is there ?? It messes up a lot.

Commenting it out seems to fix the problems, please react!
It took me a few hours on finding the root cause of all my troubles, if somebody looked at it before, I'd have saved a lot of time.

----------------------------
JGO | http://www.e2s.be
----------------------------

I guess it's related yes.
Unsure what the proper solution is, but the current code is absurd if you ask me.

I believe this has to do with a setting that I have seen in the i18n module and having the interface change to the language that is being translated to at the time of translation.

In other words you choose to translate an article and the interface can change to the new language when you go to do the translating.

I hope that makes sense. I agree that i18n could use some love!

Hi,

In other words you choose to translate an article and the interface can change to the new language when you go to do the translating.

This is not correct, I commented out these lines and the functionality you talk about still works!!

I will try this out and report back, though, it would be nice for a clown like me if you could make an actual patch file. If I was better at this I would. Who knows if I can find the time I may just try.

BTW are you running this patch?
variable_get.i18n.module.1.41.2.41_0.patch

Don't know what I was thinking there, the patch that I meant was this one;

EDITED: 614548_i18n_init_not_run_early_enough.patch

No patch on that last URL :)

1) Install EN, FR , NL
2) Set content negotiation to mixed
3) Install the "usernews" module
4) Post 3 EN usernews topics
5) Translate one of the 3 to NL and FR
6) Add the latest news default block
7) It will not show the EN only nodes when switched to NL or FR

All is fixed when commenting out those 2 lines as in the issue post.
Furthermore it solved similar problem in another block for me as well.

I had to edit out this code as well right below the one in OP's post:

<?php
elseif (arg(1) == 'add' && !empty($_GET['translation']) && !empty($_GET['language'])) {
         
// $current_mode = 'translation';
          // $current_value = db_escape_string($_GET['language']);
       
}
?>

Otherwise, I don't get to see my menu on the translate-page

indeed Rakward, same here

Status:Active» Closed (duplicate)