[Resolved] Ninja Table shortcodes can not translated in ATE
This thread is resolved. Here is a description of the problem and solution.
Problem: You are using Ninja Tables as a price list embedded in Accordion widgets with shortcodes on your site. You need to modify some text and images in the default Hungarian language and then start WPML synchronization. Previously, you could change shortcodes in WPML String translation, but now you can't find this option in either String translation or ATE. Additionally, Ninja Table shortcodes cannot be translated in ATE, and WPML changes every Ninja Table shortcode to Hungarian shortcodes during synchronization. Solution: Currently, there is no solution or workaround available for this issue as it is a known problem that our developers are aware of. We recommend manually translating the shortcode directly on the translated page using the Elementor Editor.
If this solution is 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 you still need 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.
Background of the issue:
I am using Ninja Tables as a price list embedded in Accordion widgets with shortcodes on my site hidden link. I need to modify some text and images in the default Hungarian language and then start WPML synchronization. Previously, I could change shortcodes in WPML String translation, but now I can't find this option in either String translation or ATE.
Symptoms:
Ninja Table shortcodes cannot be translated in ATE, and WPML changes every Ninja Table shortcode to Hungarian shortcodes during synchronization.
Questions:
How can I keep shortcodes unchanged on translated pages during synchronizations?
How can I edit shortcodes during synchronization?
If it is not an option for you, you can use manual translation on the page that you used the shortcode: (You can not mix and match ATE with manual translation)
In our case manual translation is NOT OPTION, so I started XML configuration following the first link.
First I have made test page in Hungarian (default WPML languge), using Elementor Pro. This page is including a flex container and shortcode widget.
Shortcode widget contains : [ninja_tables id='4786']
It is OK in Hungarian.
So, I guess, I must register "ninja_tables" shortcode in WPML Custom XML Configuration, so added this code:
<wpml-config>
<shortcodes>
<shortcode>
<tag>ninja_tables</tag>
<attributes>
<attribute>id</attribute>
</attributes>
</shortcode>
</shortcodes>
</wpml-config>
As this shortcode is ID based, so I added this this lines to functions.php:
/*This code enables WPML to translate numbers (like IDs) by overriding a default setting.*/
add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );
After saving all the files I started to translate to czech language. Unfortunetly no shortcode appeared for translation. (see image)
When I search for "shortcode" in ATE Custom fields appeared for translation. I have transleted the the field, changing ninja_tables id to Czeh table id. Saved, "completed the translation. After all, on front, switching to Czeh still Hungarian table is displayed.
see here: hidden link
So please help me how to go on, what to do?
As mentioned, we need WPML sync in ATE, mnaula translation is not good in our case.
Thanks for contacting us. You need to add this custom PHP code to allow number translations. Could you please backup and insert the custom PHP code mentioned here https://wpml.org/forums/topic/translating-numbers-2/#post-16201433 into your theme's functions.php file? Then, make minor edits to the primary language page and translate it again to see if the number shows up. Let me know how it goes.
Dear Kor,
Thanks for reply.
I have inserted the code into functions,php, than made a small change - header widget added - started Englesh translation.
No shortcode fields appered in ATE.
Serching for number 4786 -which is ID of Ninja Table in Hungarian - Custom Fields appeared. In custom fields I have changed the ID to 25102. Than saved with Completed translation.
At least this method has no effect, on English page still 4786 Ninja Table is displayed.
See attached screenshots.
Let me ask: maybe Elementor Shortcode widget registration problem exists? Not registered for translation?
I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.
Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.
Your upcoming reply will be treated with confidentiality and will only be visible to you and me.
✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.
Thanks for your reply. Could you check now? I've switched to the Gutenberg editor and corrected the PHP code. Now, the ID shows up in the advanced translation editor.
Well, yes, I see it works for "Tesztoldal-test1" page.
But in our case Elementor Pro is a must, our customer's authors and editors can not use Gutenberg.
So I have made a new page "Tesztoldal- test2" with Sortcode widget including [ninja_tables id='34668'].
Tried to translate to Czeh and English with ATE: no fileds apper. Then writing 34668 in search -> no field appear. If writing "ninja" in search "ninja_tables" is appear.
It is a good example of a producton page. It contains accordion widget with embedded shortcode widgets. On this page there are 5 shortcodes. All shortcodes must chage for every language.
Please try it with Elementor!
Thanks for your reply. It looks like it's not working if it's inside the elementor editor. Could you replicate the issue on our sandbox site here hidden link so that I can escalate this further to our 2nd Tier Support for further investigation? You can install the required plugins that are needed to replicate the issue.
Dear Kor,
I have built a sample site.
Theme was changed to "Hello Theme".
Elementor (free) and Ninja Tables (free) plugins were installed.
These are used on production site hungarospa.hu
I added "main" page and "Test page for Elementor – WPML" page in English.
I have added Czeh and Hungarian in WPML settings to test translation.
I have editied "Test page for Elementor – WPML" in English with Elementor and I have placed on it regural widgets.
It is very important to note, that during translation
Button text and url should be change to proper langauge link @hungarospa.hu.
Example image should be change for proper languge -see media library images.
pdf icon url should be changed for proper pdf -see pdf files in media library.
In accordion, embedded ninja tables shortcode should be changed for proper table. Se All tables in Ninja Tables.
This test environment very well illustrates our production situation, where we have to change URLs and shortcodes in many widgets (image, button) to display the appropriate language content.
I tried to translate to Hungarian - translation is not shown on front.
Thanks for your reply. I can see that the links and PDF files are appearing in the Advanced Translation Editor and are available for translation, as shown in the attached screenshot. Regarding the issue with the Ninja Forms shortcode translation, I’ll escalate this to our 2nd Tier Support for further assistance.
Dear Kor,
The end user needs to update the prices on the hungarospa.hu production website, which means modifying about 320 Ninja Tables.
The work will start on June 30th at 06:00 UTC. We ask You to stop debugging WPML or making any changes on the hungarospa.hu WordPress backend from this time. To avoid misunderstandings and for security reasons, your account will be temporarily disabled from the above time.
When end user job finished I contact You again.
During this period please use only Sendbox.
Endre Kover