Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\media_wysiwyg_token_to_markup() receives $langcode but doesn't use it for the file_view() call. This was added in #2129273: Pass langcode to media_wysiwyg_token_to_markup resolving media alt attributes in interface and since it was even added to the legacy field_attach mode, I can only assume that was a simple oversight.
This is a problem because the field system builds and caches the safe_value already during file_load, for all languages. Without passing it along, they're all displayed in the same language. Or not at all, if you disable the language fallback.
Comment | File | Size | Author |
---|---|---|---|
#2 | media-wysiwygfile-view-langcode-2949151-2.patch | 940 bytes | Berdir |
Comments
Comment #2
BerdirComment #3
joseph.olstadThanks
Comment #7
joseph.olstad