Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using the Uncode theme with WPBakery Page Builder and has an issue with the 'Pricing Table' shortcode not translating correctly in WPML. Specifically, the 'body' attribute in the shortcode does not retain line breaks when shown in the translation editor.
Solution:
We recommend modifying the WPML configuration XML to specify the attribute type and encoding for the 'body' attribute. Here are the steps:
1. Update the WPML configuration XML as follows:

<shortcode><br />  <tag>uncode_pricing</tag><br />  <attributes><br />    <attribute>title</attribute><br />    <attribute>price</attribute><br />    <attribute type="area" encoding="allow_html_tags">body</attribute><br />  </attributes><br /></shortcode>

2. Make a minor change in the default language page to trigger the translation reload, then attempt to translate the page again.
For more detailed information, please refer to the following documentation:

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please open a new support ticket at WPML support forum.

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 1 reply, has 0 voices.

Last updated by Rico Heinrich 2 months, 3 weeks ago.

Assisted by: Noman.

Author Posts
November 11, 2024 at 10:45 am #16387932

Rico Heinrich

<b>Background of the issue: </b>
We are using the Uncode theme which includes the WPBakery Page builder.

There is a shortcode "Pricing Table" with the id uncode_pricing which is not translated by WPML automatically (WPML just ignores this tag in the editor).

Here is an example of this shortcode:

[uncode_pricing title="Rahmen|Kosten" price="19,90€|inkl. MwSt." price_color="accent" col_elements="tb" body="Versand als Paket|DPD
schnelle Laufzeit|circa 1-3 Tage
Sicher und nachhaltig verpackt
versicherter Versand
Tracking" uncode_shortcode_id="137489" price_color_type="uncode-palette"]

Please note there are line breaks in the "body" attribute.

We use these settings in the WPML Config XML:

    <shortcode>
      <tag>uncode_pricing</tag>
      <attributes>
        <attribute>title</attribute>
        <attribute>price</attribute>
        <attribute>body</attribute>
      </attributes>
    </shortcode>

<b>Symptoms: </b>
The fields show up for translation in the classic translation editor, but the body-attributes are shown as a line and line breaks are omitted.

<b>Questions: </b>
What do we have to do in order to retain line breaks and use a text area kind of field for translation?

Bildschirmfoto 2024-11-11 um 11.50.41.png
November 11, 2024 at 12:16 pm #16388482

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. Could you please try to follow the below steps and see if this resolves the issue:

1. Add the attribute type area/visual and encoding type as follows:

<shortcode>
      <tag>uncode_pricing</tag>
      <attributes>
        <attribute>title</attribute>
        <attribute>price</attribute>
        <attribute type="area" encoding="allow_html_tags">body</attribute>
      </attributes>
    </shortcode>

2. Make a small change in the default language page to reload the translation and try to translate the page and see if this resolves the issue.

Here are docs for more details:
https://wpml.org/documentation/support/language-configuration-files/
https://wpml.org/documentation/support/translating-urlencoded-shortcodes/

Please let me know results,
Thank you

November 11, 2024 at 1:45 pm #16389018

Rico Heinrich

Thanks a lot, that worked perfectly.