This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue with WPML Media Translation where the 'Save media translation' button remains inactive, and despite adding Name, Caption, and Alt text to a different file, the translated image does not appear, but the English image does.
Solution:
We recommend using the
apply_filters('wpml_object_id', $mediaID, 'attachment', true); function to ensure that the media ID is correctly translated, which should resolve the issue with the inactive button and the incorrect display of images. Here is a step-by-step guide:
1. Retrieve the original media ID and URL.
2. Use the
apply_filters
function to get the translated media ID.
3. If the original media ID does not match the translated media ID, update the media URL and ID to the translated ones.
4. Verify that the translated media appears correctly in place of the English image.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.
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.
Tagged: Custom Work
This topic contains 15 replies, has 1 voice.
Last updated by johnH-55 1 year, 1 month ago.
Assisted by: Andreas W..
| Author | Posts |
|---|---|
| February 26, 2025 at 7:32 pm #16753142 | |
|
johnH-55 |
Background of the issue: Symptoms: Questions: |
| February 27, 2025 at 7:17 am #16754116 | |
|
Christopher Amirian WPML Supporter since 07/2020
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi, Welcome to WPML support. I am going to answer his question before the ticket is assigned to one of my colleagues. Would you please test if the same thing happens if you do not touch the meta information of the image? Usually the meta info is added while you use the image on the page itself. See if it frees up the button? Thanks. |
| February 27, 2025 at 3:12 pm #16756877 | |
|
johnH-55 |
HI! |
| March 1, 2025 at 6:27 pm #16764363 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, You will need to edit the meta information and then the botton should become available. Can you please confirm? Best regards |
| March 3, 2025 at 6:17 pm #16770471 | |
|
johnH-55 |
Andreas, Scenario: Please read whole conversation before answering and kindly advice with EXACT steps you want me to test. I learn that WPML in some cases can behavior differently* depending on how you call it, so we need to be very precise. Long story short: ME: I attempted to upload another media via 'Use a different file', adding Name, Caption, and Alt text. The 'Save media translation' button remains inactive and cannot be pressed. Christopher Amirian: Would you please test if the same thing happens if you do not touch the meta information of the image? ME: same Andreas W.: You will need to edit the meta information and then the bottom should become available. Thank you. * for example structural changes will be pushed to translations ONLY if you edit translation from page list, but they remains intact if you edit source page and than open translation from here. IMHO its bug. Also when you duplicate translation from here - link will be broken, you have to use duplicate feature in Translation management to keep link. IMHO its bug #2. Also when you have translation duplication, in source page (en) translation duplicate of fr-fr, fr-be looks like translation of en, instead of fr-fr, while on fr-fr its displays correctly. IMHO its bug #3. |
| March 4, 2025 at 4:00 pm #16775091 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
On WPML > Media Translation, when translating the media, after uploading an alternative media file make sure to edit some of the text fields, like the title, alt text, or caption, and then the button will become available. The button will not be activated until a text box is edited. |
| March 4, 2025 at 10:31 pm #16776115 | |
|
johnH-55 |
Done it now and previously. Not working. |
| March 4, 2025 at 11:06 pm #16776193 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I would like to request temporary access (wp-admin and FTP) to the site to investigate the issue further. The required fields are below the comment section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it. IMPORTANT If you can't see the "wp-admin / FTP" fields, your post and site login details will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields. I may need to install a plugin called "All In One WP Migration" here to create a copy of the site that I can use to investigate the issue further. However, I would also be very grateful if you could provide a staging site or copy of the website from your server for this purpose. If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/de/account/websites/. If you are not able to provide such a copy of the website for testing, please let me know on this ticket. The private reply form looks like this: The next time you reply, click on "I still need assistance". Video: Please note that we are obliged to request this information individually on each ticket. We are not allowed to access any credentials that were not specifically submitted on this ticket in the private response form. |
| March 4, 2025 at 11:11 pm #16776195 | |
|
johnH-55 |
Hi Andreas, |
| March 5, 2025 at 12:33 am #16776298 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Let me ask you, what are you using the plugin "Easy Media Replace" for? For the moment we do not have any recommendations for "Media Replacement Plugins". If you need to replace media in a second language, you use WPML Media Translation: |
| March 6, 2025 at 3:18 pm #16784276 | |
|
johnH-55 |
Easy Media Replace allows you to replace images and media files easily while retaining the attachment URL and ID. No more delete, re-upload, and search-replace. IE. Instead of deleting old image or upload new - we simply replace file. |
| March 6, 2025 at 5:15 pm #16784823 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
It might be that you will need to sync the media again in WPML Media Translation if a original image is being replaced. The problem might be, that this media sync dialog will only show up after you upload alternative media on Media Translation. Does reuploading the media to WPML Media Translation not solve the issue? --- I can offer a WPML test site to try to recreate the issue and we can take further steps from there. Please try to recreate the issue here: One-Click-Login: |
| March 6, 2025 at 10:21 pm #16785588 | |
|
johnH-55 |
Andreas, sorry, problem remains with Media Translation - case where we use Custom Block. I've translated media, but when use it with my custom page block "convera/card-block", which have mediaURL and mediaID param, remains untranslated, unless in source page (EN) I insert separate image and choose same image like in block, than edited translation in FR-FR - both images get translated, but when I remove image - my image in custom block again not translated. ============ <!-- wp:paragraph --> <!-- wp:paragraph --> |
| March 7, 2025 at 1:33 am #16785838 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
If you open the translation for a page that contains this block and the media URL does appear on the WPML Translation Editor, then you will need to translate the media source URL manually. Can you please confirm if this is the cause of the issue? |
| March 7, 2025 at 3:29 pm #16789147 | |
|
johnH-55 |
Andreas, $thumbURL = $attributes['mediaURL']; When we edit translated page (FR-FR) in WPML - we dont have mediaURL and mediaID. What is confusing me, when I add regular image which same as used in my block <!-- wp:image {"id":103670,"sizeSlug":"full","linkDestination":"none"} --> while have my block <!-- wp:convera/card-block {"title":"Working together for the future","headingLevel":"h2","text":"","link":"hidden link","linkTitle":"","linkTarget":"_blank","mediaID":103670,"mediaURL":"hidden link","cardType":"title-text-image","mediaStyle":"none","mediaPosition":"right","mediaAlignment":"justify-content-right"} -->... everything works as expected. once regular image deleted - block translation stop working. |


