How can i enable anonymous user to switch to other language different then detected. So that GeoIP Language only sets language once per user session.
Now im not able to change language without disableing module.

Thx

Comments

drewish’s picture

Status: Active » Postponed (maintainer needs more info)

Not sure I follow. If you're using 'Path prefix with GeoIP detection fallback.' it will use the language from the path first. So using the language switcher block to load a URL with a different language code would take care of it. Right?

momentuminc’s picture

For my site, this is still a problem. I have 4 languages, and for the default language (english), there is no path prefix, but the other languages have a path prefix.

Basically, the outcome is that users in other countries who are redirected can never view the site in English.

chromix’s picture

I'm seeing this problem as well. Trying to find a solution now.

chromix’s picture

Maybe someone can check my logic here, but I did something like the following in the if block on line 109:

<?php
  // First check to see if a language was previously determined.
  if (isset($_SESSION['geoip_language']) && isset($languages[$_SESSION['geoip_language']])) {
    if (variable_get('geoip_debug', FALSE)) $_SESSION['geoip_language'] = NULL;
    return;
  }
?>

...And then changed the drupal_goto around line 140:

<?php

  // Now that the language is detected, do an absolute redirect to avoid page
  // caching in the wrong language.
  drupal_goto($language->path, NULL, NULL, 301);
  exit();
?>

This works perfectly for how I originally expected this module to work. I don't need this module to force the user into their detected language every time they visit the site, just send them to the appropriate home page on their first visit. I think the session is a good way to ensure than they aren't looped over and over again (especially if they want to see things in English).

If this works for others I'll submit a formal patch, but I'm thinking this might need to be configurable behavior, since some may prefer this module the way it worked before.

bojanz’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)