Hi,

Checking "Switch by node's language" it was supposed to switch in the node's language, I remember that this was happening in the a past istallation of the module.
Now seems to not work. what about changing locale in a language in which the node is not translated? I would like to notify the user that the node is not traslated in that language but it serves the same page making a bit of confusion.

You can see this behaviour in my test site . I am developing the userbook module which is supposed to rely on localizer.

thanks for hard work,
Elio

Comments

elio’s picture

Sorry I forgot that this happen when the content is not translated in the current language.

Say the node is in English and in Italian and the current language is Spanish, following the node link will not switch the locale.

Is it right? is it a bug?

Roberto Gerola’s picture

> what about changing locale in a language in which the node is not translated?
No language change occurs, of course.

>Say the node is in English and in Italian and the current language is Spanish, following the node link will not switch the locale.
Not sure to understand.

"Switch by node's language" is intended to change language according to the target node.
If you are using the default language change block, this option isn't necessary.

Let me know.

Roberto

elio’s picture

That's a way to note this behavior:

on this test site change the language in portugues just clicking the right flag on top (the border will become gray)
on the next page you will see the drupal default welcome message and a block containing two flags that point to a english and italian translation of the user page (me!), following one of this links you will see that the current language in still portugues which means that there was not a switch of the locale.

Regards,
Elio

Roberto Gerola’s picture

Could you try substituting the code from row 844 to 853 in localzier.module with this ?

    //locale by path
    if(variable_get('localizer_switch_bynode', TRUE) && module_exists('localizernode')) {
      $pathlocale = localizernode_get_contentlocale($_GET['q']);
      if($pathlocale && localizer_get_uilocale() != $pathlocale && array_key_exists($pathlocale, $valid_locales) && localizernode_existscontentlocale($_GET['q'], localizer_get_uilocale()))
      {
        localizer_set_uilocale($pathlocale);
        drupal_goto($_GET['q']);
      }
    }

Let me know.

Thanks

Roberto

Roberto Gerola’s picture

Status: Active » Closed (fixed)
elio’s picture

Hi Roberto!

I am sorry for the delay but I had to work a lot.

reducing the if statement in the above code to this:

if($pathlocale && localizer_get_uilocale() != $pathlocale )

the switch will work even id that content is not translated in the current language

Thanks,
Elio