This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is unable to translate a contact form created with the Metform plugin and Elementor widgets on their multilingual site.
Solution:
A. Translate the form content:
1. Navigate to WPML > Settings > Post Types Translation and set the post type "metform-form" to Translatable.
2. Go to WPML > Settings > Custom XML Configuration and add the following code to translate the form fields:
<wpml-config> <elementor-widgets> <widget name="mf-text"> <fields> <field>mf_input_label</field> <field>mf_input_validation_warning_message</field> </fields> </widget> <widget name="mf-email"> <fields> <field>mf_input_label</field> <field>mf_input_validation_warning_message</field> </fields> </widget> <widget name="mf-telephone"> <fields> <field>mf_input_label</field> <field>mf_input_validation_warning_message</field> </fields> </widget> <widget name="mf-textarea"> <fields> <field>mf_input_label</field> </fields> </widget> <widget name="mf-button"> <fields> <field>mf_btn_text</field> </fields> </widget> </elementor-widgets> </wpml-config>
3. Visit Metform > Forms and translate the form titled "New Form # 1693676945".
B. Translate the widget form on the contact page:
1. Follow step 2 above to add a custom XML code to translate the form ID:
<widget name="metform"> <fields> <field type="Metform ID">mf_form_id</field> </fields> </widget>
2. Switch to the English language in Metform to retrieve the form ID from the URL, which is 2710.
3. Add the following PHP code to the file functions.php in the theme folder to make the number translatable in the Advanced Translation Editor:
add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );
4. Update the contact page and its translation.
5. In the Advanced Translation Editor, search for the form ID and translate it.
Now, the form should appear translated on the frontend.
Refer to the documentation for further details:
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Also, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum 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 is split from https://wpml.org/forums/forum/english-support/
This topic contains 3 replies, has 2 voices.
Last updated by 6 months, 3 weeks ago.
Assisted by: Long Nguyen.