Home›Support›English Support›[Resolved] Shortcodes in a table do not appear in the translation editor, nor in the translated page
[Resolved] Shortcodes in a table do not appear in the translation editor, nor in the translated page
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to see shortcodes within HTML table cells in the translated version of their page. The shortcodes were not appearing in the WPML Advanced Translation Editor (ATE) or on the translated page itself. This issue was observed even after switching between the old and new versions of the ATE.
Solution: The client discovered that the issue was related to how data was being fetched and displayed based on the site's current language. They resolved the problem by ensuring that the data fetching function always operated in the default language, regardless of the current language of the site. This was achieved by adding the following lines of code around the data fetching function:
This solution ensured that the data was correctly fetched and displayed in all languages. If you're experiencing similar issues, we recommend checking your data handling functions to ensure they are compatible with WPML's language switching functionalities.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. 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. If the issue persists, please open a new support ticket.
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.
Background of the issue:
I am trying to translate a HTML table that includes data provided by shortcodes in some cells. The shortcodes do not appear in the translation editor for markup and don't appear in the rendered translated page. There are four columns on the original page - two with fixed text, two with shortcodes. The two columns with shortcodes do not appear on the translated page. A sample row of the original source is shown below.
Link to a page where the issue can be seen: hidden link
Symptoms:
The shortcodes do not appear in the translation editor nor in the translated page. I expected to see 4 columns with data, for example: Visa application fee £115 $151 14,500 ₽. Instead, I got 2 columns, for example: Визовый сбор £115.
Questions:
Why do the shortcodes not appear in the translation editor?
Why are the columns with shortcodes missing in the translated page?
I used the search function to search for the shortcode tag "uk_visas". It listed several instances of the tag in the content, however, I don't need to translate the shortcode this is not the problem. The output of the shortcode is a number and does not need translating.
The problem is that if I put a shortcode in a table cell, for example:
The advanced translation editor then finds only the first two cells for markup, and the last two cells with the shortcode do not appear. As they do not appear in the ATE they do not appear on the translated page.
See attached image for an example - see, only two columns - last two are missing.
I raised this issue with a colleague of yours earlier, and he said it was a known bug in the new editor. He made a config change to my system and suggested I revert to the earlier version of ATE. It seemed to work, but now it is not working again. I can't find the ticket I raised where he said what changes he made.
So, to reiterate, the problem is that the advanced editor does not find shortcodes in table cells correctly.
Thank you for the clarification, I was able to find your previous ticket.
At the moment are you using the previous version of the ATE editor?
You can see in this screenshot where you can check the version hidden link
"Dražen : Yes, or just switch back to old version and continue to work like this, check back in a month or so if it is fixed for new version of ATE editor."
I recommend switching 100% back to the old version of the editor rather than switching back and forth for now as the issue is still present.
As stated in the original message and second message the problem is now showing in the previous/ old version of the ATE. I can not simply carry on using this as you suggested.
Please note that this bug in your system is costing time and money. Please respond, or if this is outside of your competence, please pass it on to another support agent.
Repeating my previous ticket below.
"I restored a backup to Monday, so there is no issue with switching the version back and fro.
However, even with the previous/old version of the ATE, the cells with the shortcodes are still not being detected.
Is there anything I can do to get it to detect the cells, some setting maybe, or can I manually set it somehow?
Can you also show me where the previous ticket is, as I can't find it.
I understand that the workaround may no longer be an ideal solution for you. In that case, you can try manually translating/editing the content using the following method:
1. Edit the page in question.
2. In the top bar, use the language switcher to switch to the secondary language.
If you don’t see it, simply exit Gutenberg fullscreen.
3. While in the WordPress editor for the secondary language, edit the page using the page builder, adjust the shortcode, and then update.
Let me know if this helps or if you need further assistance. If the issue persists, I’d be happy to take another look to verify whether this is indeed related to the ongoing issue our team is working on.
1. The previous ticket link only shows my original question and, for me, does not show the replies from the supporter, therefore I don't know what actions they took.
2. My site uses elementor, so I switched to manually editing the Russian translation. I have the same issue, the shortcodes don't appear.
So, I did a little exploring, and it appears that on the WPML translated pages, any shortcode with more than one parameter does not appear. It does not matter if it is in a table or not, it does not appear even if it is in a text or any other block.
So:
[uk_visas cmd="this-year"]
will display a result in the translated page (the current year) while:
[uk_visas cmd="usd_visa_cost" visa_id="1"]
does not display anything. Even in the translated pages.
Thank you for sharing this with me, I would like to request temporary access (wp-admin and FTP) to your site to test the issue as I have not seen any related issues at the moment, but it does seem like a bug.
(preferably to a test site where the problem has been replicated if possible)
**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **
I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.
NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.
P.S I shared access to a google doc that has the full transcript from your previous chat support ticket. I used the email under your profile to give access.