* @ConfigEntityType(
* id = "configurable_language",
* label = @Translation("Language"),
+ * label_collection = @Translation("Languages"),
+ * label_singular = @Translation("language"),
+ * label_plural = @Translation("languages"),
+ * label_count = @PluralTranslation(
+ * singular = "@count language",
+ * plural = "@count languages",
+ * ),
* handlers = {
* "list_builder" = "Drupal\language\LanguageListBuilder",
* "access" = "Drupal\language\LanguageAccessControlHandler",
// Install any available language configuration overrides for the language.
\Drupal::service('language.config_factory_override')->installLanguageOverrides($this->id());
}
+
+ if (!$this->isLocked() && !$update) {
+ // Add language to the list of language domains.
+ $config = \Drupal::configFactory()->getEditable('language.negotiation');
+ $domains = $config->get('url.domains');
+ $domains[$this->id()] = '';
+ $config->set('url.domains', $domains)->save();
+ }
}
/**
if (!\Drupal::languageManager()->isMultilingual()) {
ConfigurableLanguageManager::rebuildServices();
}
+
+ // Remove language from language prefix and domain list.
+ $config = \Drupal::configFactory()->getEditable('language.negotiation');
+ $config->clear('url.prefixes.' . $entity->id());
+ $config->clear('url.domains.' . $entity->id());
+ $config->save();
}
/**