Skip Navigation

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

Problem:
You are trying to translate SVGs using Media Translation with Elementor Icon, but it only works on the Image Widget. Instead of seeing the translated media in other languages, you see the default language.
Solution:
We have escalated the issue to our developers. In the meantime, we recommend you try this workaround:
- Edit the

.../wp-content/plugins/elementor/includes/managers/icons.php

file.
- Look for line 309.
- Replace:

return Svg::get_inline_svg( $value['id'] );

- With:

$value['id'] = apply_filters( 'wpml_object_id', $value['id'], 'attachment');<br />return Svg::get_inline_svg( $value['id'] );

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.

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

Last updated by Dražen 8 months ago.

Assisted by: Dražen.

Author Posts
August 17, 2024 at 3:52 pm #16080317

philB-8

Background of the issue:
I am trying to translate SVG with Media Translation on Elementor Icon. It only works on Image Widget. Link to a page where the issue can be seen: hidden link

Symptoms:
I expected to see translated media in other languages. Instead, I got the default language in other languages.

Screencast:
hidden link

Left SVG is Elementor Icon
Right SVG is Elementor Image

Questions:
Why is Media Translation not working with Elementor Icon?
How can I get SVGs to translate properly with Media Translation for Elementor Icon?

August 19, 2024 at 6:27 am #16082135

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons, and themes.

You can access the WordPress dashboard using the link below:

- hidden link

Try to replicate the issue with a simple example page.

This will help us report the probable issue to the compatibility team and solve the problem faster.

Regards,

Drazen

August 19, 2024 at 3:56 pm #16084613

philB-8

Hi Drazen,

I've setup Elementor and added the same szenario as on my other page.

Here's the Test-Page:
hidden link

As you can see, the left SVG is not getting translated with media translation (Elementor Icon Widget).
The right SVG is an Image Widget and is getting translated by Media Translation.

Best regards,
Phil

August 20, 2024 at 6:40 am #16085737

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks.

I have confirmed it and escalated it to our compatibility team.

I will update you soon, when there are some news.

Regards,
Drazen

August 21, 2024 at 5:42 pm #16091900

philB-8

Hello,

thanks. By the way. The same problem exists for the «Wordpress Menu» Widget which is an elementor pro Widget. It doesn't translate custom links.

The Menu Items are translated correctly with String Translation but no effect in the Frontend.

I've added a new page in the sandbox where you can see it.
hidden link

Best regards,
Phil

August 22, 2024 at 6:34 am #16092816

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Phil,

that is not the correct way. First, you should not translate page content via String translation, and second you are adding an existing menu there, which means you need to translate the menu first as explained in our docs: https://wpml.org/documentation/getting-started-guide/translating-menus/#fully-custom-create-menus-manually

Then on the translated page translated menu will show.

Also please open a new ticket if you have any other issues or doubts, since we limit 1 issue per ticket and try to keep it clean for other readers and clients.

Hope this helps, I will update you when I have some news on the original issue.

Regards,
Drazen

August 23, 2024 at 8:51 am #16097753

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

issue is escalated to our devs, in the meantime you can use the next workaround:

Workaround

- Edit .../wp-content/plugins/elementor/includes/managers/icons.php file.

Look for line 309.

- Replace:

return Svg::get_inline_svg( $value['id'] );

- With:

		$value['id'] = apply_filters( 'wpml_object_id', $value['id'], 'attachment');
		return Svg::get_inline_svg( $value['id'] );

Regards,
Drazen