This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with Offload Media, specifically duplicated entries in the database, and is unsure about the functionality of certain WPML Media Translation settings. They observed that when translating posts through the editor with specific settings untoggled, the featured images are not copied, although content images are. Solution: We explained that the behavior of media in WPML is as expected. If the 'Duplicate existing media for translated content', 'Duplicate the featured images for translated content', 'Duplicate media attachments for translations', and 'Duplicate featured images for translations' settings are not enabled, the system does not duplicate or translate these elements. Specifically, for featured images to be translated or duplicated, the relevant checkbox must be checked. Then, the images should be managed via Translation Management to ensure they are correctly assigned per language. When translating a post that includes an image within its content and the media functionality is disabled, the original image from the default language is displayed unless adjusted by other settings or filters, such as those used by some page builders.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your specific case, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If problems persist, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to fix issues with Offload Media (duplicated entries in the database) on a site under development. They suggest untoggling certain settings in WPML Media Translation.
I can't find any documentation explaining what these settings actually do.
I have observed that with the "future conent" options untoggled :
- when I upload two images, translate them,
- use them in the content and as featured images of a post,
- then duplicate the post,
I get both images (content and featured).
However, when I translate the post through the editor, I get the content image but not the featured one.
I have also provided a video for reference (I skipped some unecessary parts, but there are other no actions in between): hidden link.
Symptoms:
featured images not being copied when translating posts through the editor.
Questions:
What do the settings
'Duplicate existing media for translated content',
'Duplicate the featured images for translated content',
'Duplicate media attachments for translations',
'Duplicate featured images for translations' actually do?
Why the featured images aren't copied when translating posts through the editor with the future options untoggled, while the content images are?
After running some additional tests, here is what I found.
1. When you insert an image file into a page content, it copies over to the translation and the image meta shows in the advanced translation editor.
2. If you have a translation for an image in WPML -> Translation Media and you check the boxes to duplicate media (featured and uploaded), the media translations will show in the translated page.
3. If you don't have the featured image check box selected on the page edit screen, the featured image will not copy and it will not show a translation if there is one in media translation. To get it to show, you should check the box to duplicate featured image in the page edit screen in the original language.
So the best steps to take would be the following:
1. Add your media file translations in WPML -> Media Translation
2. Check the boxes in the page edit screen to duplicate uploaded media and featured image media
3. Update or create the translation.
Feel free to use the link for my staging site and test other options if you like. This link will log you in: hidden link
Here are my findings;
I checked: uploading an image from the Media Library then create a post and add it, against uploading a content image from a newly created post won't change anything to its translation behavior. In both case, it'll be added to the ATE when translating as an admin.
If the setting > "Translate media library texts with posts" is ticked, then all the available texts will be sent to the ATE during the post translation.
Disregarding where it was loaded.
If that setting wasn't ticked: only the alt is sent to ATE.
This is worth mentioning in your documentation, since I would have thought the "alt" was included in the "Media library texts".
Now, again, I'm really questionning the logic, from a user point of view.
I mean... I understand you guys make a difference between the medias IN the content, and the featured image. I don't know why, but I trust you have a good reason for that). So that you offer separate settings for those:
- Duplicate uploaded media to translations
- Duplicate featured image to translations
Without further explanation -afaik, there's not documentation explaining all these curious behaviors- I assume the "uploaded media to translations" refers to the media used in the post content, and that it excludes the "featured image", for which the translation behaviour is set by the other option "Duplicate featured image to translation".
Now, NOT ticking "Duplicate uploaded media to translations":
- When a translation image was already uploaded to the Media Translation, it will be displayed in the translated page content, but won't retrieve the already translated texts
- When no translation image was already added, it will just deliver the same content as the original media (same file, same image texts).
While NOT ticking Duplicate featured image to translations"...
- WON'T set any featured image in the translations, disregarding what's been added from the Media Translation. Never. The only thing to get a translated feature image, is to add it manually from the edition page (not the ATE)
You explained how it actually behaves, and I'm grateful you spent time on this.
However, while the settings are clearly split between featured image and content media settings, their behavior is just not consistent against each other.
It sounds like our findings are the same. I can submit a request for the behaviors to be more consistent, or request clarification on why they are acting different. In the meantime, knowing the actions should allow you to move forward with the correct means of translation.
Please let me know if you need any further assistance and I will be happy to help.
I discussed the different behaviors of media with our developers and it is working as expected, and here is some further explanation:
If you try to translate a featured image, if the checkbox is not set - what to set there? Nothing. In other words, there is nothing to "translate", so the box must be checked and then translated via Translation management if you want different images per language.
When an image is added to a post, it is inside of the post contents. When you translate such a post, and you don't have the media functionality enabled - then the value is copied 1:1 which in turn will display the original language image - provided that other filterings are not applied (which happens for some page builders). When the check is checked, the value is copied 1:1 and adjusted to match the proper attachment ID and the translated image is being displayed.