1 language.inc language_negotiation_info()

Returns all the defined language negotiation providers.

Return value

An array of language negotiation providers.:

Related topics

File

core/includes/language.inc, line 381
Language Negotiation API.

Code

function language_negotiation_info() {
  $language_providers = &backdrop_static(__FUNCTION__);

  if (!isset($language_providers)) {
    // Collect all the module-defined language negotiation providers.
    $language_providers = module_invoke_all('language_negotiation_info');

    // Add the default language negotiation provider.
    $language_providers[LANGUAGE_NEGOTIATION_DEFAULT] = array(
      'callbacks' => array('language' => 'language_from_default'),
      'weight' => 10,
      'name' => t('Default language'),
      'description' => t('Use the default site language (@language_name).', array('@language_name' => language_default()->name)),
      'config' => 'admin/config/regional/language',
    );

    // Let other modules alter the list of language negotiation providers.
    backdrop_alter('language_negotiation_info', $language_providers);
  }

  return $language_providers;
}