Skip Navigation

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.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: ,

This topic contains 0 replies, has 0 voices.

Last updated by Kor 10 hours, 10 minutes ago.

Assisted by: Kor.

Author Posts
December 2, 2024 at 4:40 pm

yannM-18

Background of the issue:
I am trying to translate images on my site hidden link using WPML. I have completed the media translation and assigned each photo with the English and German versions, however on the website they don't appear.

Symptoms:
When I translate the page, it still shows the French version of the images.

Questions:
Why are the translated images not displaying correctly on the page?

December 2, 2024 at 4:55 pm
December 3, 2024 at 8:24 am #16469951

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your patience.

I regret any inconvenience caused, but to proceed with troubleshooting, I kindly ask for a snapshot of the site. Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.

To guide you further, please adhere to these instructions:

1. View the Duplicator instructions video: hidden link

2. Consult WPML's instructions on providing supporters with a copy of your site: https://wpml.org/faq/provide-supporters-copy-site/

3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.

Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.

Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.

December 3, 2024 at 2:35 pm
December 4, 2024 at 3:46 pm #16477763

yannM-18

Hello did you manage to find the issue ?

December 4, 2024 at 3:52 pm #16477785

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. I'm sorry for the delays. I'm working on the package you provided and I will come back to you once I have updates.

December 5, 2024 at 9:45 am #16480675

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I'm able to import your Website into our dev site and I'm checking on this and will come back to you as quickly as possible.

December 9, 2024 at 1:47 pm #16493362

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Sorry, I cannot find a solution for this and I will have to escalate this further to our 2nd Tier Support for further assistance. I will come back to you once I've feedback.

December 23, 2024 at 4:26 am #16539245

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

We have feedback from our 2nd Tier Support and kindly add the custom PHP code to your theme's functions.php file (at the end). I've removed the custom XML configuration here hidden link

// WPML Workaround for compsupp-7754
add_filter( 'elementor/frontend/before_render', 'wpml_compsupp7754_trx_widget_slider_widget');

function wpml_compsupp7754_trx_widget_slider_widget($element) {
	if ( 'trx_widget_slider' !== $element->get_name() ) {
        return;
    }

    $settings = $element->get_settings();

    if ( isset( $settings['slides'] ) && is_array( $settings['slides'] ) ) {
        foreach ( $settings['slides'] as $key => $value ) {   
			if ( is_array($value) && isset( $value['image']['id'] ) ) {
				$post_type = get_post_type( $value['image']['id'] );      
				if ( $post_type ) {
					$translated_id = apply_filters( 'wpml_object_id', $value['image']['id'], $post_type, true );
					$translated_url = wp_get_attachment_url($translated_id);
					$settings['slides'][$key]['image']['id'] = $translated_id;
					$settings['slides'][$key]['image']['url'] = $translated_url;
				}
			}
			
		}

        $element->set_settings( 'slides', $settings['slides'] );
    }
}

If you're not sure how to do this, kindly share FTP access or grant me permission to install the file manager plugin and I will add this code for you.

Once we've done that, translating the images using Translation Media should be possible.