This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is trying to translate a form from English to Spanish using WPML, specifically needing to make the form shortcode translatable and handle numeric values like IDs in translations.
Solution:
First, we recommend adding the following XML configuration in WPML > Settings > Custom XML Configuration to make the shortcode translatable:
<wpml-config> <shortcodes> <shortcode> <tag>forminator_form</tag> <attributes> <attribute>id</attribute> </attributes><attributes> </attributes></shortcode> </shortcodes> </wpml-config>
Next, use this PHP snippet to allow translating numeric values like IDs with the Advanced Translation Editor (ATE):
/** * Allow translating numbers * * @see https://wpml.org/forums/topic/wpbakery-post-grid-element-exclude-from-filter-list-category-reappears<br /> */ function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) { $data = $job_translate['field_data']; if ( 'base64' === $job_translate['field_format'] ) { $data = base64_decode( $data ); } if ( is_numeric( $data ) ) { return true; } return $is_translatable; } add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );
After applying these changes, edit the form shortcode in the original content and open ATE. If the ID is not directly visible, use the search bar to locate it. When translating, replace the original ID with the correct ID of the translated form.
Please note that this solution might be outdated or not applicable to your specific 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 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 3 replies, has 2 voices.
Last updated by 8 months, 3 weeks ago.
Assisted by: Andreas W..