diff -u b/core/modules/content_translation/config/schema/content_translation.settings.schema.yml b/core/modules/content_translation/config/schema/content_translation.settings.schema.yml --- b/core/modules/content_translation/config/schema/content_translation.settings.schema.yml +++ b/core/modules/content_translation/config/schema/content_translation.settings.schema.yml @@ -3,30 +3,35 @@ -#content_translation.settings: -# type: sequence -# label: 'Entity type' -# sequence: -# - type: sequence -# label: 'Bundle' -# sequence: -# - type: mapping -# label: 'Content translation settings' -# mapping: -# content_translation: -# type: mapping -# mapping: -# enabled: -# type: boolean -# label: 'Content translation status' -# fields: -# type: sequence -# sequence: -# - type: boolean -# label: 'Per field content translation' -# translation_sync: -# type: sequence -# label: 'Field translation synchronisation settings' -# sequence: -# - type: sequence -# label: 'Field' -# sequence: -# - type: string -# label: 'Column' +content_translation.settings: + type: mapping + label: Entities + mapping: + entities: + type: sequence + label: 'Entity type' + sequence: + - type: sequence + label: 'Bundle' + sequence: + - type: mapping + label: 'Content translation settings' + mapping: + content_translation: + label: 'Content translation settings' + type: mapping + mapping: + enabled: + type: boolean + label: 'Content translation status' + fields: + type: sequence + sequence: + - type: boolean + label: 'Per field content translation' + translation_sync: + type: sequence + label: 'Field translation synchronisation settings' + sequence: + - type: sequence + label: 'Field' + sequence: + - type: string + label: 'Column' diff -u b/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module --- b/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -148,7 +148,7 @@ * Implements hook_entity_base_field_info_alter(). */ function content_translation_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) { - $translation_settings = \Drupal::config('content_translation.settings')->get($entity_type->id()); + $translation_settings = \Drupal::config('content_translation.settings')->get('entities.' . $entity_type->id()); if ($translation_settings) { // Currently field translatability is defined per-field but we may want to @@ -273,7 +273,7 @@ function content_translation_get_config_key($entity_type, $bundle, $setting) { $entity_type = preg_replace('/[^0-9a-zA-Z_]/', "_", $entity_type); $bundle = preg_replace('/[^0-9a-zA-Z_]/', "_", $bundle); - return $entity_type . '.' . $bundle . '.content_translation.' . $setting; + return 'entities.' . $entity_type . '.' . $bundle . '.content_translation.' . $setting; } /** @@ -362,7 +362,7 @@ $entity_type = preg_replace('/[^0-9a-zA-Z_]/', "_", $field->getTargetEntityTypeId()); $bundle = preg_replace('/[^0-9a-zA-Z_]/', "_", $field->targetBundle()); $field_name = preg_replace('/[^0-9a-zA-Z_]/', "_", $field->getField()->getName()); - return $entity_type . '.' . $bundle . '.translation_sync.' . $field_name; + return 'entities.' . $entity_type . '.' . $bundle . '.translation_sync.' . $field_name; } /** diff -u b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php --- b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php @@ -61,7 +61,7 @@ // Sync if the field is translatable, not empty, and the synchronization // setting is enabled. - $key = $entity->getEntityTypeId() . '.' . $entity->bundle() . '.translation_sync.' . $field_name; + $key = 'entities.' . $entity->getEntityTypeId() . '.' . $entity->bundle() . '.translation_sync.' . $field_name; if ($field_definition->isTranslatable() && !$items->isEmpty() && $translation_sync = \Drupal::config('content_translation.settings')->get($key)) { // Retrieve all the untranslatable column groups and merge them into // single list. diff -u b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php --- b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php @@ -81,7 +81,7 @@ ), ), ); - $key = $this->entityTypeId . '.' . $this->entityTypeId; + $key = 'entities.' . $this->entityTypeId . '.' . $this->entityTypeId; \Drupal::config('content_translation.settings')->set($key, $settings)->save(); // Enable content translation for the 'alt' and 'title' properties on the