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.

This topic contains 23 replies, has 2 voices.

Last updated by pascalB-17 1 month, 2 weeks ago.

Assigned support staff: Bigul.

Author Posts
April 7, 2020 at 11:02 am #5856395

pascalB-17

Hi Bigul

Thanks a lot! with the php snippet it does show the translated images.
But if I got it right it still doesn't translate the images in the automatic translation when I re-translate the post (although it said 1745 words)? When I check the images only those that were translated manually are in english.. the other ones seem to remain in german...

Or did I misunderstand something?

Here is what the people from livemesh said:
"We aren't doing anything different with gallery element when it comes to storage. We rely on Elementor to store the data and hence I cannot recall exactly where the data ends up.

Are you using the bulk upload or adding adding manually each item? If you are adding items manually, it should work like any other addon of ours since we add items in most of our addons like team, services, testimonials, features, FAQ, sliders, carousels etc. If using bulk upload of images, the translation should happen for media gallery or attachment attributes and not inside our plugin. Hope this makes sense."

Thanks, Pascal

April 7, 2020 at 2:21 pm #5858275

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Pascal,

Thank you for the updates. Because of the compatibility issues, we have two workarounds for this issue now.

We have to translate the images from WPML>>Media Translation if so this fix code will help us to show the translation.

Or

We have to translate the Gallery Page manually in English using Elementor.

So please check it and let me know your feedback.

--
Thanks!

Bigul

April 10, 2020 at 10:17 am #5883073

pascalB-17

Hi Bigul
Thanks for your reply.
So basically - if I am not mistaken - there is no way to make an automatic translation of the gallery module, right?
And if I am correct the Media Translation from WPML doesn't offer automatic translation? That would certainly be somethng helpful if there was a way to have automatic translation for Media...

Thanks, Pascal

April 10, 2020 at 3:16 pm #5884717

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Pascal,

Thank you for the updates. Because of compatibility, we have limitations to translate and display the Livemesh Galley Image captions using Advanced Translation Editor. I hope you only want to translate all the images add to the Gallery automatically. If so may the following workaround will help.

1) Create a Post with all the Gallery Image
2) Visit WPML>>Translation Management Dashboard
3) Choose the Post for translation and you can also choose the images that want to translate(the one added to the newly added post)
4) Send the Post for translation to Translation Basket
5) Visit WPML>>Translation Management>>Translation Basket and send it for translation
6) Translate it using Advanced Translation Editor

Please check the attached images for more details.

--
Thanks!

Bigul

April 11, 2020 at 10:43 am #5888435

pascalB-17

Hi Bigul

Thank you for the work around. We're getting there step by step!
Now I do have the image text in english in the gallery BUT when activating Lightbox or showing alt-text I still get the german text although the image is fully translated ... see images

Thanks for furter instructions
Pascal

April 11, 2020 at 3:20 pm #5889331

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Pascal,

Thank you for the feedback. On mouseover on the Gallery Images, the ALT text is showing in German, am I right? If so, it is happening because of a compatibility issue. The Livemesh Galley functions are always called the default language data.

I am getting the expected result in the local copy after the following steps. Please check the attached images for more details.

1) Go to *wp-content/plugins/addons-for-elementor-premium/includes/blocks/source*
2) Open *gallery-source.php* file for edit
3) Scroll down to line 148 and make the following change

From

$output = '<a class="lae-lightbox-item ' . $anchor_type . '" data-fancybox="' . $this->settings['block_class'] . '" data-thumb="' . $thumbnail_src . '" href="' . $this->item['item_image']['url'] . '" data-elementor-open-lightbox="no" title="' . esc_html($this->item['item_name']) . '" data-description="' . htmlspecialchars(wp_kses_post($this->item['item_description'])) . '">';

To

       $attachment_title = get_the_title(apply_filters( 'wpml_object_id', $this->item['item_image']['id'], 'attachment', true));

       $output = '<a class="lae-lightbox-item ' . $anchor_type . '" data-fancybox="' . $this->settings['block_class'] . '" data-thumb="' . $thumbnail_src . '" href="' . $this->item['item_image']['url'] . '" data-elementor-open-lightbox="no" title="' . esc_html($attachment_title) . '" data-description="' . htmlspecialchars(wp_kses_post($this->item['item_description'])) . '">';

Please try it after a full site backup and let me know your feedback.

--
Thanks!

Bigul

April 12, 2020 at 9:13 am #5891821

pascalB-17

Hi Bigul

Thank you so much.. we're another stept closer.
Your php workaround works fine for the alt-text!
Now I still have the german text displayed when a picture is open in lightbox... where I obviously would like to see the english version as well 😉

Thanks a lot for your fantastic support!
Pascal

April 12, 2020 at 3:22 pm #5892415

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Pascal,

Thank you for the updates. We have to do the same modifications to make the text on Lightbox to show the translation. Please make the following changes after a full site backup and let me know your feedback.

1) Go to *wp-content/plugins/addons-for-elementor-premium/includes/blocks/source*
2) Open *gallery-source.php* file for edit
3) Scroll down to line 148 and make the following change

From

$attachment_title = get_the_title(apply_filters( 'wpml_object_id', $this->item['item_image']['id'], 'attachment', true));

$output = '<a class="lae-lightbox-item ' . $anchor_type . '" data-fancybox="' . $this->settings['block_class'] . '" data-thumb="' . $thumbnail_src . '" href="' . $this->item['item_image']['url'] . '" data-elementor-open-lightbox="no" title="' . esc_html($attachment_title) . '" data-description="' . htmlspecialchars(wp_kses_post($this->item['item_description'])) . '">';

To

$translated_title = get_the_title(apply_filters( 'wpml_object_id', $this->item['item_image']['id'], 'attachment', true));
$translated_caption = wp_get_attachment_caption( apply_filters( 'wpml_object_id', $this->item['item_image']['id'], 'attachment', true) );

$output = '<a class="lae-lightbox-item ' . $anchor_type . '" data-fancybox="' . $this->settings['block_class'] . '" data-thumb="' . $thumbnail_src . '" href="' . $this->item['item_image']['url'] . '" data-elementor-open-lightbox="no" title="' . esc_html($translated_title) . '" data-description="' . htmlspecialchars(wp_kses_post($translated_caption)) . '">';

--
Thanks!

Bigul

April 13, 2020 at 3:20 pm #5897299

pascalB-17

Hi Bigula

Thank you so much! This did the trick and now the gallery translation is working just fine!
Pascal

April 13, 2020 at 5:16 pm #5898173

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Pascal,

Thank you for the feedback. Happy to know you are getting the expected result now. We are happy to help.

--
Thanks!

Bigul

April 16, 2020 at 12:10 pm #5922277

pascalB-17

My issue is resolved now. Thank you!