Skip Navigation

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 1 reply, has 0 voices.

Last updated by Bigul 2 months, 1 week ago.

Author Posts
April 2, 2025 at 4:23 pm #16888068

Pavel Balandin

Background of the issue:
I am trying to set up notification translation for Gravity Forms on a site under development. I've translated all the notifications and added a field to store the language in which the form was sent. I am using the following code to switch the language: add_filter('gform_pre_send_email', 'set_notification_language', 10, 4); function set_notification_language($email, $message_format, $notification, $entry) { if (isset($entry['9999'])) { $submission_lang = $entry['9999']; do_action('wpml_switch_language', $submission_lang); $email['subject'] .= " (" . strtoupper($submission_lang) . ")"; } return $email; }

Symptoms:
Notifications are still being sent in English despite attempting to switch to the form's submission language.

Questions:
How can I ensure that notifications are sent in the correct language for Gravity Forms?

April 6, 2025 at 7:11 am #16900761

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. Before passing this thread to my colleague, I would like to share some suggestions and possible solutions for the issues you mentioned.

Sorry for the late response because of the holidays and the high support load. It is not normal here. Thank you for your kind understanding.

This will be related to the following ticket. So the workaround suggest there will help in your case also.

https://wpml.org/forums/topic/gravity-forms-sends-english-emails-for-non-english-submissions/

Please check if there is any difference in the result when you change the User Profile language: https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/

Or while using the following condition in your custom code.

$my_current_lang = apply_filters( 'wpml_current_language', NULL );

if($my_current_lang=="fr"){
  do_action('wpml_switch_language', "fr");
}elseif($my_current_lang=="es"){
  do_action('wpml_switch_language', "es");
}elseif($my_current_lang=="de"){
  do_action('wpml_switch_language', "de");
}

https://wpml.org/wpml-hook/wpml_current_language/

https://wpml.org/faq/how-to-get-current-language-with-wpml/

--
Thanks!

Bigul

The topic ‘[Closed] How to properly set up notification translation for gravity forms?’ is closed to new replies.