function language_negotiation_method_get_first

Returns the ID of the language type's first language negotiation method.

Parameters

$type: The language type.

Return value

The identifier of the first language negotiation method for the given language type, or the default method if none exists.

Related topics

2 calls to language_negotiation_method_get_first()
AccountFormController::form in drupal/core/modules/user/lib/Drupal/user/AccountFormController.php
Overrides Drupal\Core\Entity\EntityFormController::form().
LocaleUninstallTest::testUninstallProcess in drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
Check if the values of the Locale variables are correct after uninstall.

File

drupal/core/includes/language.inc, line 264
Language Negotiation API.

Code

function language_negotiation_method_get_first($type) {
  $negotiation = variable_get("language_negotiation_{$type}", array());
  return empty($negotiation) ? LANGUAGE_NEGOTIATION_SELECTED : key($negotiation);
}