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

Last updated by Mohamed Sayed 1 year, 3 months ago.

Assisted by: Mohamed Sayed.

Author Posts
March 27, 2024 at 11:12 am #15455052

helenC-4

Hi, we had a issue previously with translations of Essential Blocks accordions which you kindly helped resolve, as explained here - https://wpml.org/forums/topic/accordion-titles-not-translating/.

However we've now discovered a further issue - if there's a line break in the accordion title, the translation of the title fails. Weirdly this doesn't happen if there's no content in the body of the accordion.

March 27, 2024 at 11:31 am #15455158

Mohamed Sayed

Hi,

I have created this clean sandbox setup on our servers here:
hidden link (one-click login)

I would need you to please set up WPML + the WPML add-ons as you have them on your site (they are already installed) and to also install the Essential Blocks plugin then try to recreate the issue.

Please don't install anything else like plugins that are not necessary, on a clean sandbox we try to use just the WPML plugins and the plugin/theme that's part of the issue

If the issue is going to take place on this clean setup on our servers too, then I can forward this to our compatibility department.

Please let me know how that goes and what you can find.

Kind regards,
Mohamed

March 27, 2024 at 12:18 pm #15455474

helenC-4

Hi. The problem is visible on your servers too but appears slightly different.The translation fails whenever there's a line break, regardless of whether or not there's content in the accordion (I'm not sure how I managed to get a different result).

See hidden link and hidden link

March 27, 2024 at 3:06 pm #15456633

Mohamed Sayed

You see a different result because you didn't add the code that fixed the issue on the other ticket. I added the code and I see the same result now.

I'm consulting our compatibility team about this issue and will let you know once I get their reply.

March 28, 2024 at 8:31 am #15459310

Mohamed Sayed

Hi,

The issue happens because of the HTML <br> tag is added without closing it, which breaks the xPath functionality.

The <br> tag in HTML should be a self-closing tag. So to fix it, you should add a slash there and use <br/> instead of <br>. If we do that, the issue does not happen. This is a recommended practice in HTML and is compatible with xPath.

Please try the following steps:

1. Edit the original page
2. Edit the accordion title with the line break
3. In the "Title Text" field, replace <br> with <br/>
4. Update the page and update the translation

I tested this on the sandbox site and it works as you can see here: hidden link