function geoip_language_init in GeoIP API 7
Same name and namespace in other branches
- 6 geoip_language/geoip_language.module \geoip_language_init()
Implements hook_language_negotiation_info().
Return value
array
File
- geoip_language/
geoip_language.module, line 61 - 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();
}
}