2 * Implements hook_entity_extra_field_info().
4 function {{ machine_name }}_entity_extra_field_info() {
6 $module_language_enabled = \Drupal::moduleHandler()->moduleExists('language');
7 $description = t('Node module element');
9 foreach (NodeType::loadMultiple() as $bundle) {
11 // Add also the 'language' select if Language module is enabled and the
12 // bundle has multilingual support.
13 // Visibility of the ordering of the language selector is the same as on the
15 if ($module_language_enabled) {
16 $configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', $bundle->id());
17 if ($configuration->isLanguageAlterable()) {
18 $extra['node'][$bundle->id()]['form']['language'] = [
19 'label' => t('Language'),
20 'description' => $description,
25 $extra['node'][$bundle->id()]['display']['language'] = [
26 'label' => t('Language'),
27 'description' => $description,