Hello,
I talk with WPML team and there is a bug between the feature “enable svg” from Bricks and WPML Media to put different image per language. As you can see when we use WPML Media to put a different svg for each language, it doesn’t work as you can see on my short recording that I made for you : WPML SVG Media translation.mp4 - Google Drive
It seems it doesn’t store the data.
We temporary solved it with this code
- Open the /wp-content/themes/bricks/includes/integrations/wpml/wpml.php file.
- Look for line 509.
- Replace:
public function get_translated_attachment_id( $attachment_id ) {
return apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );
}
- With:
public function get_translated_attachment_id( $attachment_id ) {
if ( is_admin() && did_action( 'admin_init' ) ){
$current_screen = get_current_screen();
}
// Check if the current screen is the WPML Media Translation screen (you'll need the exact screen ID)
if ( $current_screen && $current_screen->id === 'wpml_page_wpml-media' ) {
return $attachment_id; // Return the original image if it's a WPML Media Translation screen.
}
return apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );
}
Now, I can upload different svg in Media translation per language but it won’t work with svg widget to display translated svg, it only works if we put the svg in a image widget.
Greetings,