Skip to content Skip to sidebar

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

Problem:
You are trying to translate a notification email from Czech to English in WP Forms, which is sent after user registration and manual approval. Despite translating the string in WPML, the email remains untranslated.
Solution:
We recommend registering the strings again and translating them. You can add the following snippet to the functions.php file of your theme or use a Code Snippet Plugin. It's advisable to use a child theme, such as the Hello Elementor Child Theme, to avoid losing changes when updating the theme. Here are some resources to help you:

add_filter( 'wpforms_user_registration_email_notifications_after_activation_user_email', function( $email ) {
    if ( ! empty( $email['address'] ) ) {
        do_action( 'wpml_switch_language_for_email', $email['address'] );
    }
 
    // Apply translation manually
    $email['subject'] = apply_filters( 'wpml_translate_single_string', $email['subject'], 'wpforms-41', 'setting-registration_email_user_after_activation_subject' );
    $email['message'] = apply_filters( 'wpml_translate_single_string', $email['message'], 'wpforms-41', 'setting-registration_email_user_after_activation_message' );
 
    return $email;
}, 5 );

After adding the code, revisit WPML > String Translation to find the newly registered strings under the 'wpforms-41' text domain.

If this solution does not resolve your issue or seems outdated, 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 needed, please open a new support ticket for further assistance.

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 22 replies, has 0 voices.

Last updated by tomasH-28 9 months, 1 week ago.

Assisted by: Andreas W..

Author Posts
June 10, 2025 at 3:54 pm #17122813

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This might be a compatibility issue between WPML and WPForms, which would be something we would need to solve in our WPForms Multilingual Addon.

I will try to replicate this issue on a new WPML test site with WPForms and then get back to you with the results.

June 10, 2025 at 5:34 pm #17123147

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Your site is not using the latest version of WPForms. Also, some other plugins are not updated.

Can you please update all plugins and then test again by creating a new user and confirm if the issue persists?

If this will not solve the issue, please install the latest version of "WPForms User Registration" on the following test site and try to replicate the issue:

One-Click-Login:
hidden link

June 12, 2025 at 8:41 am #17129039

tomasH-28

Hello Andreas,

I updated all plugins and tried again. Snippet with change user languange is active, I also tried to manually change admin languange to English. - Confirmation email about user activation is still in Czech.

Also installed WP user registration on your testing site.
- created form "Registration" Original languange here: hidden link
- Created DE version of page as your plugin settings - hidden link
- Configured form in WP forms for registration - You can check form "User registration form"
- Traslated specific strings to DE (especially strings featuring in User email after user manual activation)
- Tried to test with user registration on hidden link

But activation email doesnt arrived - There is probably problem with emails on your testing site - Maybe missing SMTP configuration?

Please let me know if you can do something with emails, or try it myself.

Best Regards

June 12, 2025 at 10:11 am #17129393

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you very much for your cooperation!

The sandbox can sadly not send out emails but I have installed an email logging plugin.

I then registered on hidden link

I can confirm that the admin notification in this case is sent in German languages, even if the admin uses a different language on the profile like for example English.

I completely understand that in this case the emails are supposed to be sent in the English language to the admin and in the current site language (German) to the client.

I will be escalating this issue internally for further revision and then get back to you.

June 12, 2025 at 11:23 am #17129724

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The issue was replicable on our sandbox and has been escalated to the compatilbity team for further revision.

Once I received internal feedback I will contact you on this ticket again.

June 13, 2025 at 8:24 am #17132073

tomasH-28

Hi Andreas, thank you for forwarding it for further processing. Just to clarify. I'm not talking about emails that are sent to the administrator. That's not that important. It's a confirmation email that is sent to the user who registers on the website and the admin subsequently approves their registration.

The first automatic email after registration is fine. There, the translation into the desired language will occur. The problem is with the second email that should arrive to the user after the admin approves their registration. There, we never managed to translate the email into the language in which the website was translated at that moment.

In the test site that you sent, this email second email should be in German - because the customer registered on the German version of the registration form - hidden link.

Best Regards,
Tomas

June 13, 2025 at 3:42 pm #17134154

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you very much for the details!

I was able to confirm this issue and I am sadly not able to find a workaround. The approval email will always be sent in site default language on my test, no matter which language is set for the admin.

I have forwarded this information to the compatilbity team and I will reach out to you again once I receive feedback.

June 15, 2025 at 12:36 am #17135812

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

We would like to provide a workaround that will register the strings again and then allow you to translate them.

You can place this snippet inside the functions.php file of the theme or use a Code Snippet Plugin.

It would be recommended to install the Hello Elementor Child Theme and place the code into the functions.php file as if you would use the parent theme, the changes will be overwritten if you update the theme.

Guide on creating a Hello Elementor Child Theme:
hidden link

or

Code Snippets Plugin:
https://wordpress.org/plugins/code-snippets/

Here is the snippet:

add_filter( 'wpforms_user_registration_email_notifications_after_activation_user_email', function( $email ) {
	if ( ! empty( $email['address'] ) ) {
		do_action( 'wpml_switch_language_for_email', $email['address'] );
	}

	// Apply translation manually
	$email['subject'] = apply_filters( 'wpml_translate_single_string', $email['subject'], 'wpforms-41', 'setting-registration_email_user_after_activation_subject' );
	$email['message'] = apply_filters( 'wpml_translate_single_string', $email['message'], 'wpforms-41', 'setting-registration_email_user_after_activation_message' );

	return $email;
}, 5 );

Now go again to WPML > String Translation and you should find newly registered strings inside a wp-forms text domain called 'wpforms-41'.

Let us know if you need assistance with applying this workaround.

The issue has been escalated to the development team for further integration inside the WP Forms Multilingual Addon.

June 16, 2025 at 7:29 am #17137196

tomasH-28

Hello Andreas,

thank you! Its working now, email sent to the user after manual activation is translating now.

I added snippet as you wrote. Just edited one thing - "wpforms-41" was probably related to Form ID. My registration form got ID: "wpforms-881." So I changed it.

Another thing. The newly registered strings you are writing about were already there from the very beginning and were already translated, as I wrote in the introduction to the ticket.

There was not problem with missing strings, but the translated strings were not copied to the email anyway.

after adding this snippet, its just started working and email is translated. I didn't translate any new strings.

So thank you again for your cooperation, and also thanks to Bobby.

Best Regards,
Tomas