Skip Navigation

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: 

This topic contains 15 replies, has 1 voice.

Last updated by johnH-55 3 weeks, 6 days ago.

Assisted by: Andreas W..

Author Posts
February 26, 2025 at 7:32 pm #16753142

johnH-55

Background of the issue:
I am trying to translate media using WPML Media Translation. I attempted to upload another media via 'Use a different file', adding Name, Caption, and Alt text. The issue can be seen on this page: hidden link.

Symptoms:
The 'Save media translation' button remains inactive and cannot be pressed. There is a warning: 'Any changes you make to the text here will not affect any previous publications of this media on your website. This edited version will only appear if you select it from the library to be embedded.' Instead of seeing a translated image, I got an English image.

Questions:
Why is the 'Save media translation' button not active?
How can I ensure the translated image appears instead of the English image?
Screen from DEV, but exactly like in PROD

February 27, 2025 at 7:17 am #16754116

Christopher Amirian
Supporter

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!
Same.

Upload only.jpg
March 1, 2025 at 6:27 pm #16764363

Andreas W.
Supporter

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
Andreas

March 3, 2025 at 6:17 pm #16770471

johnH-55

Andreas,
Button stays inactive.

Scenario:
1) Edited source page (en) and uploaded new image
2) Via page list* in en found source page and edited FR-FR translation in WPML, saw image meta and filled it out.
3) Via WPML media translation edited FR-FR translation and uploaded new image. BUT was not able to save due to inactive button

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.
Supporter

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.

Untitled.png
March 4, 2025 at 11:06 pm #16776193

Andreas W.
Supporter

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
Please be sure to back up the site and database before granting us access.

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:
hidden link

The next time you reply, click on "I still need assistance".

Video:
hidden link

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,
I was able to figure out Media translation - appears one of plugins we are using - "Easy Media Replace" is the reason. Any idea of compatible alternatives ? Any fixes?

March 5, 2025 at 12:33 am #16776298

Andreas W.
Supporter

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:
https://wpml.org/documentation/getting-started-guide/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.
Supporter

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:
hidden link

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:convera/card-block {"title":"Governance: our approach to creating best-in-class governance of the ESG program","text":"","mediaID":4736,"mediaURL":"hidden link","cardType":"title-text-image","mediaStyle":"none","mediaPosition":"right"} -->
<!-- wp:paragraph -->
<p>Ongoing governance of the program will be managed under Convera’s Risk and Compliance organization, reporting upwards to the Convera Board.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>There are many other programs already established in such areas as Ethics, Compliance and Risk, Cyber Security, and Legal which are integral to a successful ESG strategy.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Convera will review each program to ensure they all encompass the principles and values of our ESG strategy, and correct alignment around governance and reporting.</p>
<!-- /wp:paragraph -->
<!-- /wp:convera/card-block -->
<!-- /wp:areoi/column -->
<!-- /wp:areoi/row -->
<!-- /wp:areoi/container --></div></div>
<!-- /wp:cover -->

March 7, 2025 at 1:33 am #16785838

Andreas W.
Supporter

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,
When we edit source page (EN) in WordPress our block contains mediaURL and mediaID, but we are using mediaID like this:

$thumbURL = $attributes['mediaURL'];
if($attributes['mediaID']) {
$thumbURL = wp_get_attachment_image_src($attributes['mediaID'], 'post-thumbnail')[0];
}

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"} -->
<figure class="wp-block-image size-full"><img src="hidden link" alt="Convera ESG 2023 Report" class="wp-image-103670"/><figcaption class="wp-element-caption">Convera ESG 2023 Report</figcaption></figure>
<!-- /wp:image -->

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.