function language_language_types_info_alter

language_language_types_info_alter(array &$language_types)

Implements hook_language_types_info_alter().

We can't set the fixed properties in \Drupal\Core\Language\LanguageManager, where the rest of the properties for the default language types are defined. The LanguageNegation classes are only loaded when the language module is enabled and we can't be sure of that in the LanguageManager.

File

core/modules/language/language.module, line 494
Add language handling functionality to Drupal.

Code

function language_language_types_info_alter(array &$language_types) {
  $language_types[LanguageInterface::TYPE_CONTENT]['fixed'] = [LanguageNegotiationUI::METHOD_ID];
  $language_types[LanguageInterface::TYPE_URL]['fixed'] = [LanguageNegotiationUrl::METHOD_ID, LanguageNegotiationUrlFallback::METHOD_ID];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!language!language.module/function/language_language_types_info_alter/8.1.x