First, great module. Second, I'm running into an issue where the front page always defaults to the English translation when I go to the front page, either by clicking the logo or deleting a post. When I am on that node (node/3) or navigate directly to that node, the proper translation comes up just fine. It's only when I access that node through the front page.

I've got two langauges set up, English and Spanish. I believe all my setting are default, and at this point, I think I've tried them all. Right now I'm looking through the code to try and figure out why th is is happening.

If someone could at least tell me if localizer_change_uilocale() is the correct place to start looking, it would be much appreciated.

Thanks!

Comments

Roberto Gerola’s picture

Hi

> It's only when I access that node through the front page.
Is the option
"Redirect the front page ti the localized version"
under "Locale switching options"
selected ?

seanbfuller’s picture

Yes it is. I should probably have mentioned that I was using the session to determine the language (not the subdomain, etc). Looking through localizer_change_uilocale(), it didn't seem like there was a case that would catch for that. This is what I just added at the bottom of that function:

    // Need to redirect front page to the proper version
    // By now we should have weeded out search engines?
    if(drupal_is_front_page() && variable_get('localizer_frontpage_redirect', TRUE) && module_exist('localizernode')) {
      $destination = localizernode_get_localizedpath($_GET['q'], $_SESSION['current_locale']);
      if($_GET['q'] != $destination) {
        drupal_goto($destination);
      } 
    }

This seems to be working for me now. Is there any reason why I shouldn't be doing this?

Roberto Gerola’s picture

It should work also it isn't the cleanest solution.
I leave this issue open as reminder for me to take a deeper look at this problem.