Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 4 replies, has 2 voices.

Last updated by Bobby 1 year, 6 months ago.

Assisted by: Bobby.

Author Posts
January 22, 2024 at 2:06 pm #15211847

alexandreI-2

Hello,

I can't translate the text contained in a shortcode added via Elementor using the Heading widget on a WordPress page.

Example shortcode: [test-wpml string="Hello X."]
Original version : Fr, Translation : En

What works:
OK: use the shortcode directly in Gutenberg (by configuring the shortcode in WPML > Settings > Custom XML Configuration)
OK: find and translate the shortcode in Adv. CE
OK: Display the front page with the result of the correctly translated shortcode.

What doesn't work:
OK: use the shortcode in a Heading widget (or HTML or Custom code widget) by configuring the shortcode in WPML > Settings > Custom XML Configuration.
OK: find and translate the shortcode in ACE
KO: The front page displays the UNtranslated version of the shortcode.

WPML Configuration

<wpml-config>
<shortcodes>
<shortcode>
<tag>test-wpml</tag>
<attributes>
<attribute>string</attribute>
</attributes>
</shortcode>
</shortcodes>
</wpml-config>

What can I do ?

Best regards.

January 23, 2024 at 12:44 am #15213854

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

It looks like you are already familiar with our documentation but for good measure, I will link it below, please give it a quick read and verify everything is set up OK:

https://wpml.org/documentation/support/language-configuration-files/translate-custom-shortcodes-with-wpml/

If that does not help,

I have created a sandbox environment for us here to further investigate:
hidden link

Please set up the shortcode in an Elementor widget as you do on your site and let me know your results.

January 23, 2024 at 10:46 am #15215707

alexandreI-2

Hi,

I confirm that I read this page in full before contacting you. I have just redone it, taking into account the following paragraphs:
- Making Shortcodes Translatable
- Translating Registered Custom Shortcodes

No ID, no link and no hardcoded text in my case.

Thanks for the sandbox. I've just used it. Unfortunately it's worse, I can't see the shortcode in the Advanced Translation Editor. Could you help me ?

January 23, 2024 at 8:58 pm #15218844

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, I am reviewing this on the sandbox and will update you shortly!

January 23, 2024 at 10:42 pm #15219141

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

1. If you search for the shortcode directly in the ATE you can find it and tranlsate it, however, I can confirm that even after it still does not display.

https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/

2. Switching from Eleementor back to Guttenberg/standard WP Editor it works as expected.

3. Translating manually with Elementor it works OK also

Please share with me on here the code you use to add the shortcode

The topic ‘[Closed] Shortcode selfending with string in Elementor widget’ is closed to new replies.