Add translation for media entities

Created on 16 March 2025, 21 days ago

Problem/Motivation

In the moment I can select content, comments, terms, settings and UI for translation.
I cannot see media entities here.

Steps to reproduce

Add a media entities and try to translate.

Proposed resolution

Add media entities to translation.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany jan kellermann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jan kellermann
  • 🇩🇪Germany jan kellermann

    In preparation of this ticket i found this function in src/TranslationManager.php:

      public function getTranslatableFields($entity) {
        switch ($entity->getEntityTypeId()) {
          case 'node':
            return [
              'title'       => ['value'],
              'body'        => ['value', 'summary'],
              'field_image' => ['alt'],
            ];
    
          case 'comment':
            return [
              'subject'      => ['value'],
              'comment_body' => ['value'],
            ];
    
          case 'taxonomy_term':
            return ['name' => ['value']];
    
          default:
            // Type not implemented.
            return [];
        }
      }

    You hardcoded the translatable fields. But what to do with all the other fields? And you can not presume that these fields really exists. This should be replaced by a field iterator per entity.

  • Added support for media & other type translatable entities in versions 1.1.x-dev and 1.1.0.

Production build 0.71.5 2024