Problem/Motivation

Currently, pagedesigner always loads the default language of a media entity (audio, images, documents etc.). It should check, if there is an available translation in the current content language and load it instead of the default translation.
This way, media entities can be made translatable and language versions of files provided.

Proposed resolution

In MediaFieldHandlerBase and children, check if a translation in the current language is available and load the file entity from the translation. If no translation is available, fall back to the original language of the media entity.
If there is no file on the translation don't provide any output for the file source (as this means that the translation doesn't have a file attached).

Remaining tasks

- Adjust MediaFieldHandlerBase and children
- Test

API changes

Media handler plugins will provide media entities / files in the content language preferably.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pvbergen created an issue. See original summary.

  • pvbergen committed d51f3b29 on 2.0.x
    Issue #3349659: Support translatable media entities
    
pvbergen’s picture

Status: Active » Reviewed & tested by the community
pvbergen’s picture

Status: Reviewed & tested by the community » Fixed

  • pvbergen committed d51f3b29 on misc/debugger_improvement
    Issue #3349659: Support translatable media entities
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.