The existing preview code in EmbedController doesn't pass current language to filters, so it's not possible to show the embedded content according to the current language. For example, if translatable media is embedded, the matching media translation is shown when the container entity is viewed, but not when it's edited. I suggest to add langcode parameter to the render array in EmbedController::preview().
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | embed-preview_language-3000871-6.patch | 859 bytes | maximpodorov |
| #2 | embed-preview_language-3000871-2.patch | 491 bytes | maximpodorov |
Comments
Comment #2
maximpodorov commentedComment #3
maximpodorov commentedComment #5
dave reidComment #6
maximpodorov commentedBTW, the content language should be selected here instead of the interface language. The patch is updated.
Comment #8
dave reidTested and committed #6 to 8.x-1.x. Thanks!
Comment #9
maximpodorov commentedThis line was lost: use Drupal\Core\Language\LanguageInterface;
Oh, it was added by previous commits.
Comment #10
dave reidI was using git add -p and I made sure it made it in a following commit before I tagged the 8.x-1.2 release.