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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 2 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 16, 2023 at 10:26 pm #14241493

danielE-60

Tell us what you are trying to do?
I use html in my caption. For example, an image has the following caption:
<p class="file-claim-carousel-caption"><span class="file-claim-header">Copay documentation<br></span><span class="file-claim-description">Some description text.</span></p>

Then in the media translation, I translate the caption to:
<p class="file-claim-carousel-caption"><span class="file-claim-header">Translated text<br></span><span class="file-claim-description">Some translated text.</span></p>

But the html is not preserved in the image. Instead what is show is "Translated textSome translated text".

I use the html to style the image with content in a particular place. The translated image loses this styling.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

August 17, 2023 at 3:11 pm #14247307

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Daniel,

Thank you for contacting the support.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss.

Regards.

August 21, 2023 at 7:17 am #14260149

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access.

I checked and fixed it via WordPress -> Media -> Library by the following steps:

- Switched to Spanish from top admin bar.
- Clicked the image to open for editing.
- Updated the Caption with required content (including HTML and translated text).

This is saved correctly in backend and displayed as-it-is on frontend (see attached).

Please consider following in this regard:

HTML tags on the caption field of Media Translation will be stripped out due to security reason. The best way to add the HTML caption is by editing the image.

Please go to Media > Library. From there, click on the image that will be added as translation and click on "Edit more details". From there, you can add HTML captions.

I hope this resolves the matter.

Screenshot 2023-08-21 121405.jpg
Screenshot 2023-08-21 121329.jpg