Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing an issue with translating a Contact Form 7 form using WPML. The form includes a dynamic hidden field to capture the page title, which works in the original language but not in the translated Italian version.
Solution:
1. Navigate to Contact -> Contact Forms.
2. Use the top admin bar to switch the language.
3. Edit the translated form.
4. Add the dynamic hidden field:

[dynamic_hidden cf7s-application "CF7_get_current_var key='title'"]

5. Update the translated form.
After completing these steps, verify if the translated form correctly captures the page title.

If this solution does not apply to your situation, or if it's outdated, we recommend opening a new support ticket. We also highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our 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.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 2 months ago.

Assisted by: Osama Mersal.

Author Posts
April 12, 2024 at 4:59 pm #15513663

antonioC-97

Hallo, I have successfully used WPML to translate the website from the main language (English) into Italian, including forms made with Contact Form 7.

However I am still facing a minor issue when using the wpml translation plugin to translate a "contact form 7" plugin. The form includes a hidden field to get the page title, which works fine in the original language:

[dynamic_hidden cf7s-application "CF7_get_current_var key='title'"]

However, when the form is called from the Italian page and the mail is sent, the page title is not getting assigned to the 'title' key, so we just get the unassigned "title" string.

May you please suggest where to look for this issue ?

Thank you

April 14, 2024 at 11:45 am #15515622

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) First of all, sorry for the late reply; it was due to a higher workload. Please login to this sandbox site and create a test form. (hidden link)

After that, please translate this form to replicate the issue. If it is replicable, please let me know how to reproduce it.

2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:

/* Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M');

Best regards,
Osama

April 16, 2024 at 3:47 pm #15527001

antonioC-97

Hallo Osama,
thanks for your reply and providing me with a ready to use sandbox.

I have installed the required plugins and replicated a basic sample made of a page containing a Contact form 7, then translated both of them, which reflects our actual configuration.

The page are named as TEST PAGE ENGLISH and TEST PAGE ITALIAN - which is the data assigned to cf7s-application field from the "CF7_get_current_var key='title'" and used for the email body and email subject.

Everything is working and the issue is being replicated as you can see from the received emails from the attached picture, only the original English page is working while on the Italian translation the title value is not assigned to cf7s-application.

Hopefully you can sort out the issue and let me know a solution.

Thank you for your support
Kindest Regards
Antonio Cristiani

received-emails.jpg
April 16, 2024 at 5:03 pm #15527365

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Antonio,

Thanks for replicating the issue. I'll consult our compatibility team regarding this issue and update you as soon as I get their reply.

Best regards,
Osama

April 17, 2024 at 8:38 am #15530184

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Please try the following workaround:

1- Go to Contact-> Contact Forms
2- Switch the language from the top admin bar
3- Edit the translated form
4- Add the field
5- Update the translated form

After that, please check if the translated form works as it should.

Best regards,
Osama

2024-04-17_10-35-50.jpg
April 17, 2024 at 9:36 am #15530530

antonioC-97

Thank you Osama, very appreciated,

In fact I didn't notice the hidden field in the form template was wrongly translated, I just copied the row from the English form and everything is working fine now.