You are here

ContentTranslationDefaultsConfigOverride.php in Open Social 10.3.x

Same filename in this branch
  1. 10.3.x modules/social_features/social_featured_content/src/ContentTranslationDefaultsConfigOverride.php
  2. 10.3.x modules/social_features/social_content_block/src/ContentTranslationDefaultsConfigOverride.php
  3. 10.3.x modules/social_features/social_landing_page/src/ContentTranslationDefaultsConfigOverride.php
  4. 10.3.x modules/social_features/social_page/src/ContentTranslationDefaultsConfigOverride.php
  5. 10.3.x modules/social_features/social_book/src/ContentTranslationDefaultsConfigOverride.php
  6. 10.3.x modules/social_features/social_topic/src/ContentTranslationDefaultsConfigOverride.php
  7. 10.3.x modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  8. 10.3.x modules/social_features/social_featured_items/src/ContentTranslationDefaultsConfigOverride.php
  9. 10.3.x modules/social_features/social_core/src/ContentTranslationDefaultsConfigOverride.php
  10. 10.3.x modules/social_features/social_follow_taxonomy/modules/social_follow_landing_page/src/ContentTranslationDefaultsConfigOverride.php
  11. 10.3.x modules/social_features/social_group/modules/social_group_flexible_group/src/ContentTranslationDefaultsConfigOverride.php
Same filename and directory in other branches
  1. 8.9 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  2. 8.4 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  3. 8.5 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  4. 8.6 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  5. 8.7 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  6. 8.8 modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  7. 10.0.x modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  8. 10.1.x modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
  9. 10.2.x modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php

File

modules/social_features/social_event/src/ContentTranslationDefaultsConfigOverride.php
View source
<?php

namespace Drupal\social_event;

use Drupal\social_core\ContentTranslationConfigOverrideBase;
use Drupal\Core\StringTranslation\StringTranslationTrait;

/**
 * Provides content translation defaults for the event content type.
 *
 * @package Drupal\social_event
 */
class ContentTranslationDefaultsConfigOverride extends ContentTranslationConfigOverrideBase {
  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  protected function getModule() {
    return 'social_event';
  }

  /**
   * {@inheritdoc}
   */
  protected function getDisplayName() {

    // We can't use dependency injection here because it causes a circular
    // dependency for the configuration override.
    return $this
      ->t('Events');
  }

  /**
   * {@inheritdoc}
   */
  protected function getTranslationOverrides() {
    return [
      'language.content_settings.node.event' => [
        'third_party_settings' => [
          'content_translation' => [
            'enabled' => TRUE,
          ],
        ],
      ],
      'core.base_field_override.node.event.title' => [
        'translatable' => TRUE,
      ],
      'core.base_field_override.node.event.menu_link' => [
        'translatable' => TRUE,
      ],
      'core.base_field_override.node.event.path' => [
        'translatable' => TRUE,
      ],
      'field.field.node.event.field_event_image' => [
        'third_party_settings' => [
          'content_translation' => [
            'translation_sync' => [
              'file' => 'file',
              'alt' => '0',
              'title' => '0',
            ],
          ],
        ],
      ],
    ];
  }

}

Classes

Namesort descending Description
ContentTranslationDefaultsConfigOverride Provides content translation defaults for the event content type.