You are here

function geoip_language_init in GeoIP API 6

Same name and namespace in other branches
  1. 7 geoip_language/geoip_language.module \geoip_language_init()

Implementation of hook_init().

File

geoip_language/geoip_language.module, line 53
Language negotiation based on GeoIP detection.

Code

function geoip_language_init() {

  // Configured presentation language mode.
  $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
  $drush = function_exists('drush_verify_cli') && drush_verify_cli();

  // Only take action if language negotiation is set to GeoIP and there is more
  // than 1 enabled language.
  if (!$drush && $mode == GEOIP_LANGUAGE_NEGOTIATION_PATH && (int) variable_get('language_count', 1) > 1) {
    geoip_language_negotiation();
  }
}