This thread is resolved. Here is a description of the problem and solution.
Problem:
Shortcodes added to links are not showing for translation.
Solution:
The user marked the ticket as resolved but did not mention what resolved it.
You can read my last reply to understand better about translating shortcodes with the Advanced Translation Editor.
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: ATE
This topic contains 7 replies, has 2 voices.
Last updated by Itamar 1 year, 2 months ago.
Assisted by: Itamar.
Author | Posts |
---|---|
September 24, 2023 at 4:18 pm #14453213 | |
zenC |
Hello there, i am using elementor and wpml. This is possible by updating the link using string translation. So everytime i update the page of that form, my parameter gets removed. |
September 26, 2023 at 8:47 am #14464561 | |
Itamar Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+02:00) |
Hi, We need to replicate this issue on a fresh WordPress installation. Then, I'll be able to escalate it to our compatibility team. For this, I created a test website with a clean WordPress install. You can access it through this link: hidden link With this link, you'll be directly logged in. Could you please install the Elementor plugin and see if the issue is replicable on a clean WordPress installation? Please configure WPML and Elementor as on your site (just the basic configurations needed to replicate the issue are enough). Please also ensure you install the latest version of the plugin. Please let us know when everything is finished, and you can replicate the problem. Thanks, |
September 27, 2023 at 8:40 am #14471563 | |
zenC |
Hi Itamar, I recreated that issue on your test website. The [field id="amount"] is not displayed in the ATE. |
September 28, 2023 at 3:47 pm #14483361 | |
Itamar Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+02:00) |
Hi, and thanks for replicating this issue on the sandbox site. Some characters are not allowed or considered unsafe in URLs. Square brackets [] are allowed but not so common. However, quotes "x" are not allowed. Please see the following sources as a reference. hidden link I can see that the ATE is removing even the square brackets. I'm consulting our ATE experts about this and will update you with their reply. Meanwhile, I have found that if you convert the special characters to Unicode, then ATE accepts them. I used this convertor to convert your URL. hidden link It gave me this result. hidden link And then I could translate it like this in ATE. hidden link Please see the attached screenshot. You can also check the test site. Please let me know if this workaround is good for you. |
September 28, 2023 at 3:53 pm #14483445 | |
zenC |
Hello Itamar, thank you for your answer. |
September 28, 2023 at 4:27 pm #14483731 | |
Itamar Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+02:00) |
Hi, I'm confused and maybe I misunderstood something. Is [field id="amount"] a shortcode you add to this URL's end hidden link? If so, how does this work? Do you have it working without WPML, meaning does the shortcode convert to what it needs to be when you insert it in a dynamic Elementor field? |
September 29, 2023 at 1:21 pm #14487825 | |
zenC |
Hi there, you should try out the elementor pro forms. In my case i use it to adjust the path of the redirect URL depending on a form field. This works out fine. The only problem was that this shortcode wasn‘t displayed in the ATE, but i figured out that the space inside the shortcode was the problem. So i replaced it with an underscore. |
October 1, 2023 at 2:20 pm #14493275 | |
Itamar Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+02:00) |
Hi, Shortcodes are hidden in WPML's Advanced Translation Editor. There is a reason for this, as only the shortcode attributes should be translated. You should find the shortcodes and translate them using the search field if you need to. We explain this in the following guide. As mentioned in the guide, you can register the shortcodes and attributes for translation in a wpml-config.xml file. You can learn how to do this in the following guide. https://wpml.org/documentation/support/language-configuration-files/#page-builder-content If you register them correctly, then you will be able to translate the attribute. In your example, you would need to translate "amount" into "amount". On the test site, I registered the shortcode you gave as an example like this. <wpml-config> <shortcodes> <shortcode> <tag>field</tag> <attributes> <attribute>id</attribute> </attributes> </shortcode> </shortcodes> </wpml-config> Nevertheless, because I still don't fully understand how this works with a URL, I'm not sure that it will work for you by concatenating a parameter after the translation of the attribute. To the best of my knowledge, please note that by adding an underscore (_) instead of space to the shortcode like this [field_id="amount"], you are, in practice, removing the shortcode name and leaving it only with an attribute. Please see WordPress's codex about shortcodes. https://codex.wordpress.org/Shortcode_API This is why WPML's Advanced Translation Editor does not consider this a shortcode, and you get it for translation. However, if this is a good workaround, please keep using it. Regards, |