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];
}
doc_Drupal
2016-10-29 09:23:02
Comments
Leave a Comment

Please login to continue.