Implements hook_language_negotiation_info().
function language_language_negotiation_info() {
language_negotiation_include();
$file = drupal_get_path('module', 'language') . '/language.negotiation.inc';
$negotiation_info = array();
$negotiation_info[LANGUAGE_NEGOTIATION_URL] = array(
'types' => array(
LANGUAGE_TYPE_CONTENT,
LANGUAGE_TYPE_INTERFACE,
LANGUAGE_TYPE_URL,
),
'callbacks' => array(
'negotiation' => 'language_from_url',
'language_switch' => 'language_switcher_url',
'url_rewrite' => 'language_url_rewrite_url',
),
'file' => $file,
'weight' => -8,
'name' => t('URL'),
'description' => t('Language from the URL (Path prefix or domain).'),
'config' => 'admin/config/regional/language/detection/url',
);
$negotiation_info[LANGUAGE_NEGOTIATION_SESSION] = array(
'callbacks' => array(
'negotiation' => 'language_from_session',
'language_switch' => 'language_switcher_session',
'url_rewrite' => 'language_url_rewrite_session',
),
'file' => $file,
'weight' => -6,
'name' => t('Session'),
'description' => t('Language from a request/session parameter.'),
'config' => 'admin/config/regional/language/detection/session',
);
$negotiation_info[LANGUAGE_NEGOTIATION_USER] = array(
'callbacks' => array(
'negotiation' => 'language_from_user',
),
'file' => $file,
'weight' => -4,
'name' => t('Account'),
'description' => t('Account site language setting.'),
);
$negotiation_info[LANGUAGE_NEGOTIATION_BROWSER] = array(
'callbacks' => array(
'negotiation' => 'language_from_browser',
),
'file' => $file,
'weight' => -2,
'cache' => 0,
'name' => t('Browser'),
'description' => t("Language from the browser's language settings."),
'config' => 'admin/config/regional/language/detection/browser',
);
$negotiation_info[LANGUAGE_NEGOTIATION_INTERFACE] = array(
'types' => array(
LANGUAGE_TYPE_CONTENT,
),
'callbacks' => array(
'negotiation' => 'language_from_interface',
),
'file' => $file,
'weight' => 8,
'name' => t('Interface'),
'description' => t('Use the detected interface language.'),
);
$negotiation_info[LANGUAGE_NEGOTIATION_URL_FALLBACK] = array(
'types' => array(
LANGUAGE_TYPE_URL,
),
'callbacks' => array(
'negotiation' => 'language_url_fallback',
),
'file' => $file,
'weight' => 8,
'name' => t('URL fallback'),
'description' => t('Use an already detected language for URLs if none is found.'),
);
$negotiation_info[LANGUAGE_NEGOTIATION_USER_ADMIN] = array(
'types' => array(
LANGUAGE_TYPE_INTERFACE,
),
'callbacks' => array(
'negotiation' => 'language_from_user_admin',
),
'file' => $file,
'weight' => 10,
'name' => t('Account administration pages'),
'description' => t('Account administration pages language setting.'),
);
return $negotiation_info;
}