language_configurable_language_insert

language_configurable_language_insert(ConfigurableLanguageInterface $language)

Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.

File

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

Code

function language_configurable_language_insert(ConfigurableLanguageInterface $language) {
  if ($language->isLocked()) {
    return;
  }

  // Add language to the list of language domains.
  $config = \Drupal::configFactory()->getEditable('language.negotiation');
  $domains = $config->get('url.domains');
  $domains[$language->id()] = '';
  $config->set('url.domains', $domains)->save();
}
doc_Drupal
2016-10-29 09:23:00
Comments
Leave a Comment

Please login to continue.