Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
Unable to translate the alt text for 'property images' from English to German using the Media Translation feature in WPML. Despite changing the alt text in the Media Translation and Real Estate sections, the frontend displays the English alt text instead of the German alt text, and the backend reverts to the English alt text after saving.
Solution:
This issue is due to a compatibility problem with the Houzez theme. We have implemented a workaround by adding the following code to the functions.php file of your theme:

add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4);
 
function wpml_compsupp7300_filter_fave_property_images($null, $object_id, $meta_key, $single) {
     
    // Target the specific meta key
    if ($meta_key !== 'fave_property_images') {
        return $null;
    }
 
    // Prevent recursion by temporarily removing the filter
    remove_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10);
 
    // Fetch the original meta value
    $images = get_post_meta($object_id, $meta_key, $single);
 
    // Re-add the filter
    add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4);
 
    // Check if we actually got an array
    if (is_array($images)) {
        foreach ($images as &$image_id) {
            // Apply the WPML filter to each item (image ID)
            $image_id = apply_filters('wpml_object_id', $image_id, 'attachment', true);
        }
    }
 
    return $images;
}

Please ensure to perform a full site backup before applying this workaround. For more details on this issue, refer to the errata page at https://wpml.org/errata/houzez-property-media-images-not-showing-translated-alt-text/.

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. Additionally, you can open a new support ticket for further assistance at WPML support forum.

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 18 replies, has 2 voices.

Last updated by Bigul 4 weeks, 1 day ago.

Assisted by: Bigul.

Author Posts
September 24, 2024 at 10:16 pm #16217697

markusP-25

Background of the issue:
I can change the alt text everywhere, but not in the pictures of the property.
I am trying to edit the alt text for 'property images' from English to German using the Media Translation feature in WPML. After adding the image again under the german property, the alt text is correctly displayed in German. But after saving, the frontend is not displayed in German.
The issue can be seen on this page: hidden link

Symptoms:
Despite changing the alt text in the Media Translation and Real Estate sections, the frontend displays the English alt text instead of the German alt text. Additionally, the backend reverts to the English alt text after saving.

Questions:
Why is the alt text for 'property images' not updating to German on the frontend?
Why does the backend revert to the English alt text after saving?

September 25, 2024 at 6:40 am #16218181

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue. A couple of requests for tracking the issue.

1) Please share a couple of screenshots for a better understanding of the problem. Because we are not able to reproduce it exactly here - hidden link

2) Please fill in the private details fields after a full site backup{mandatory}. I would like to access the admin area of your site to check further. Refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

September 25, 2024 at 4:26 pm #16221917

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the detailed information and credentials. Please try the following steps after a site backup and make sure the issue exists or not.

1) Please visit WPML>>Settings>>Media Translation
2) Choose the *How to handle media library texts: >> Translate media library texts with posts* option and save the changes
3) Open the post for editing in the original language - hidden link
4) Make a minor change in the content and save it (to refresh the translation settings)
5) Update the translation

Please refer to the following tickets for more details

https://wpml.org/forums/topic/translated-alt-text-is-not-showing-up-on-the-translated-page/

https://wpml.org/forums/topic/unable-to-translate-image-alt-text/

--
Thanks!

Bigul

September 25, 2024 at 5:07 pm #16222038

markusP-25

Unfortunately, it didn't work. The English alt text is still displayed on the German page. I have carefully done all your points:

1) Please visit WPML>>Settings>>Media Translation ---- DONE
2) Choose the *How to handle media library texts: >> Translate media library texts with posts* option and save the changes ---- DONE
3) Open the post for editing in the original language - hidden link ---- DONE
4) Make a minor change in the content and save it (to refresh the translation settings) ---- DONE
5) Update the translation ---- DONE

alttext1.png
September 26, 2024 at 7:28 am #16223270

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the feedback. Please create a dummy blog post and property post with an image for testing. Try the following steps and check whether it shows the expected results.

1) Visit WPML>>Translation Management Dashboard
2) Choose the newly added posts for translation
3) Send it to Translation Basket
4) Visit WPML>>Translation Management>>Translation Basket
5) Send it for translation, by choosing yourself as a translator
6) Visit WPML>>Translations queue and translate the page by clicking the *Translate* button

This is the actual workflow for translation. Refer to this article for more details https://wpml.org/documentation/translating-your-contents/

--
Thanks!

Bigul

September 26, 2024 at 10:22 am #16224408

markusP-25

Hi Bigul!

Everything was done exactly according to your new instructions. Unfortunately without success. After done translation job: English "alt text" is displayed in the German version.
I found out the following after completing the translation job:

1) in the DE property the EN alt text is displayed
2) in WMPL - Media Translation - DE image the correct German text is displayed
3) Even if I try to embed the property image again in the DE property, it doesn't work.
4) even if I change and update the DE text at WMPL - Media Translation again, no success

english:
hidden link

german:
hidden link

alttext.png
September 26, 2024 at 4:24 pm #16226809

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the feedback. Please allow me to make a copy of your site using the Duplicator plugin (https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server. So we can troubleshoot the bug without affecting your live site.

--
Thanks!

Bigul

September 27, 2024 at 6:32 am #16228174

markusP-25

Hi Bigul!
Just to be sure. If you use the Duplicator plugin, there are no conflicts with the purchase codes anyway? Because I can only use my Houzez theme, plugin, etc. on one domain. If that's not a problem then please do it with the Duplicator plugin.

Please note. I created a "post" yesterday and everything worked perfectly with the media translation. So the error must be specifically related to the houzez theme "property" translation.
Thanks for your support!

September 27, 2024 at 12:37 pm #16229855

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the updates. This may be a compatibility issue. Please note, your live site will not have any effects, if we make a Duplicator copy. But take a full site backup.

--
Thanks!

Bigul

September 30, 2024 at 7:03 am #16234574

markusP-25

Hi Bigul!
OK, full site backup is done. Then please make everything necessary with the Duplicator copy.
Thanks

October 1, 2024 at 2:22 am #16238119

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the updates and permission. I made a copy of the site now, will debug it further locally and get back to you as early as possible. Please wait.

--
Thanks!

Bigul

October 2, 2024 at 11:11 am #16245067
markusP-25

Please don't stress about this case. I have found another bug in the meantime. If you are already working "locally" on my case, can you please look at this error?

Situation: it works on the EN landing page (montecarloresidences.com) but not on the translated pages: DE FR IT

If you click "FOR RENT" and "Price max" on the EN landing page, the amounts I entered appear, such as 2000€, 5000€, etc.

Problem: These amounts do not appear on the DE FR IT page.

I was able to set these amounts on Houzez here: Houzez Theme Options - Searches - Settings - Maximum Prices List for Rent Only

I tried to edit something on the DE landing page (in elementor) and save it. But no success. I think this error has always existed but I have only seen it now.

Thanks for your support!

New threads created by Bigul and linked to this one are listed below:

https://wpml.org/forums/topic/minimum-prices-list-for-rent-only-amounts-do-not-appear-on-the-de-fr-it-page/

maxpricerent.png
October 3, 2024 at 3:59 pm #16251250

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the updates. The bug exists in my local copy after the initial checks. So consulting with our team for an expert opinion now.

Please note that I have opened a new ticket for the Rent price issue. As per our support policies, we can only handle one issue per ticket. It will help us to serve you better and we can avoid discussing multiple problems in one ticket.

I will get back to you soon on the latest ticket. Please wait. Thank you for your understanding.

--
Thanks!

Bigul

October 7, 2024 at 3:09 pm #16262429

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Sorry for the late response due to the weekend. Please check my reply in the following ticket.

https://wpml.org/forums/topic/minimum-prices-list-for-rent-only-amounts-do-not-appear-on-the-de-fr-it-page/#post-16262408

--
Thanks!

Bigul

October 10, 2024 at 7:28 am #16273156

markusP-25

I just had to reply to this conversation otherwise it will be closed automatically.