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.
Issue fork pagedesigner-3349659
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
Comment #4
pvbergen commentedComment #5
pvbergen commented