public function ContentTranslationDefaultsConfigOverride::loadOverrides in Open Social 10.3.x
Same name in this branch
- 10.3.x modules/social_features/social_featured_content/src/ContentTranslationDefaultsConfigOverride.php \Drupal\social_featured_content\ContentTranslationDefaultsConfigOverride::loadOverrides()
- 10.3.x modules/social_features/social_content_block/src/ContentTranslationDefaultsConfigOverride.php \Drupal\social_content_block\ContentTranslationDefaultsConfigOverride::loadOverrides()
- 10.3.x modules/social_features/social_featured_items/src/ContentTranslationDefaultsConfigOverride.php \Drupal\social_featured_items\ContentTranslationDefaultsConfigOverride::loadOverrides()
- 10.3.x modules/social_features/social_core/src/ContentTranslationDefaultsConfigOverride.php \Drupal\social_core\ContentTranslationDefaultsConfigOverride::loadOverrides()
- 10.3.x modules/social_features/social_follow_taxonomy/modules/social_follow_landing_page/src/ContentTranslationDefaultsConfigOverride.php \Drupal\social_follow_landing_page\ContentTranslationDefaultsConfigOverride::loadOverrides()
Returns config overrides.
Parameters
array $names: A list of configuration names that are being loaded.
Return value
array An array keyed by configuration name of override data. Override data contains a nested array structure of overrides.
Overrides ConfigFactoryOverrideInterface::loadOverrides
File
- modules/
social_features/ social_featured_content/ src/ ContentTranslationDefaultsConfigOverride.php, line 37
Class
- ContentTranslationDefaultsConfigOverride
- Provides content translation for the Social Featured Content module.
Namespace
Drupal\social_featured_contentCode
public function loadOverrides($names) {
$overrides = [];
// If the module "social_content_translation" is enabled let make translations
// enabled for content provided by the module by default.
$is_content_translations_enabled = $this->moduleHandler
->moduleExists('social_content_translation');
if (!$is_content_translations_enabled) {
return $overrides;
}
// Translations for "Featured Content" custom block.
$config_name = 'language.content_settings.block_content.featured';
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'third_party_settings' => [
'content_translation' => [
'enabled' => TRUE,
],
],
];
}
$config_name = 'core.base_field_override.block_content.featured.info';
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'translatable' => TRUE,
];
}
// Translations for "Featured Content" paragraph type.
$config_name = 'language.content_settings.paragraph.featured';
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'third_party_settings' => [
'content_translation' => [
'enabled' => TRUE,
],
],
];
}
$config_name = 'core.base_field_override.paragraph.featured.status';
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'translatable' => TRUE,
];
}
return $overrides;
}