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: Custom Work
This topic contains 10 replies, has 2 voices.
Last updated by Eran Helzer 1 year, 10 months ago.
Assisted by: Eran Helzer.
Author | Posts |
---|---|
August 2, 2023 at 9:28 pm #14144879 | |
arnaudA-8 |
Tell us what you are trying to do? Is there any documentation that you are following? Is there a similar example that we can see? What is the link to your site? |
August 3, 2023 at 12:11 pm #14149413 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, I read your previous ticket, and I see that Mohamed provided you with a wpml-config.xml configuration. The previous sandbox expired, I created a new one for your here: So I can start looking, do you mean that all text surrounded by <b> tags is no longer translatable? Is any other text missing? Also, I would like to point out that from the debug information you supplied I can see that the WordPress memory limit is set to 40MB. You should increase this to 128MB, as that is the minimum requirement for using WPML in the best way. |
August 3, 2023 at 2:05 pm #14150217 | |
arnaudA-8 |
Hi, Thanks for your reply. I was unable to recreate the issue in the new sandbox, but in the new sandbox the previously provided fix to translate the additional strings of the typed text also doesn't work. Could you please check why that is the case? Br, |
August 4, 2023 at 11:43 am #14154737 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
I checked and noticed that the WPML String Translation plugin was not activated. After activating it, I managed to translate all the texts, except for the bold and highlighted text. Please take a look at the page translations and tell me if the issue is replicated now. |
August 4, 2023 at 1:56 pm #14155335 | |
arnaudA-8 |
Yes, that's the issue, the bold and highlighted text is not showing in the translation editor and after translating the text is still shown in the original language. Please provide a solution. Thanks in advance! |
August 4, 2023 at 7:24 pm #14156679 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Update. I added the necessary configuration, it seems to be working correctly now. Let me tell you what I did so you know what you can try in the future: <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]/text()</xpath> To this: <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6 or self::strong or self::mark]/text()</xpath> Please verify that this resolves the issue, and if so you can copy the configuration from the test site to yours: |
August 7, 2023 at 7:27 am #14161529 | |
arnaudA-8 |
I changed the custom XML configuration but it didn't solve the issues. It's unclear what I need to do in the code editor and what you mean with the following step: |
August 7, 2023 at 8:22 am #14161843 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Yes, of course. 1. Please take a look at the fourth line of the WPML -> Settings -> Custom XML Configuration: <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6 or self::strong or self::mark]/text()</xpath> This includes all the HTML elements that will be sent to translation (h1, h2, h3, ... strong, mark). 2. In order to know what HTML elements I needed to add, I opened the page with the code editor (screenshot attached). 3. Then, I saw what HTML element the untranslated texts were in, "strong" and "mark", and added them to the configuration. <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]/text()</xpath> Turned to this: <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6 or self::strong or self::mark]/text()</xpath> After updating the configuration, I had to re-translate the page, and this time the highlighted and bold text was also translatable. |
August 7, 2023 at 3:00 pm #14164759 | |
arnaudA-8 |
Yes, this 'solves' the issue in the sense that all text is now visible again in the translation editor. However, it's split up in a lot of different strings that need to be translated separately. Before, it was one big string in which 'tags' could be added to influence the text (bold words). This is not only way more convenient, but is also required because the sequence of words is not the same in every language. Please advise on how to fix this. |
August 7, 2023 at 3:17 pm #14164907 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
I need to consult with the 2nd tier about this. I will update you when I know more. |
August 8, 2023 at 3:27 pm #14170631 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Update. After taking a deeper look into this, the 2nd tier have found that to enable translating this in one part would take some development work, which would take more time. For now, the only solution is the one we have, but as soon as the development is done I will update you. |