Overview of the Issue
When you edit and crop a featured image in the default language, the cropped version does not appear in the translated pages. Instead, the translated pages display the original, uncropped version of the image.
Workaround
This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.
Please, make a full backup of your site before proceeding.
- Install WPML Media Translation plugin
- Be sure your image has a title and it is translated via WPML Media
- Go to WPMLSettingsMedia Translation
- If the ”Automatically detect best options for translating image texts (alt, caption, title)” option is active, then disable it
- Under How to handle Media Library texts (alt, caption, title) enable the ”Translate Media Library texts (alt, caption, title) when translating content” option.
- Then, open …/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/MediaTranslationStatus.php file.
- Look for line 174.
- Change:
return $attachment_translation_id;
- For:
$this->copy_attached_file_info_from_original( $attachment_translation_id, $attachment_id ); return $attachment_translation_id;
- Save the change.
- Make a small change to the post and its image title on default language.
- Update the translation