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 ago.

Assisted by: Andreas W..

Author Posts
May 14, 2025 at 10:05 am #17031299

tomasH-28

Background of the issue:
I'm trying to translate a notification email from Czech to English in WP Forms, which is sent to a user after registration on the website and manual approval by the website administrator. I found the string to translate and translated it using WPML.

Symptoms:
The email that arrives to the user after registration and manual approval is not translated, even though the string is translated in the WPML editor. This is probbably same issue like here: https://wpml.org/forums/topic/user-activation-emails-not-translating/ The problem was not resolved though.

Questions:
How can I translate the email?

May 15, 2025 at 5:29 am #17034912

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Please try the following and let me know your results:

1. Edit your WP Form and adjust the HTML of the email in the default language

2. Remove line breaks that were added using the 'ENTER' button, instead replace them by using <p> or <span> tags.

Once that is done, make a small edit to the default language and update then review the translation.

May 15, 2025 at 9:45 am #17036029

tomasH-28

Hi Bobby,

thank you for reply.

I applied your recommendation. See screenshot. I then slightly edited the Czech text and saved it. Then I checked it in the WPML translation editor and everything looked fine there again. The texts and translations were updated. Unfortunately, after testing and delivering the real email after registration here: hidden link, the text in the email is still in the original language, i.e. Czech. It is important to mention that 2 emails are sent after registration. The first one arrives immediately after registration automatically. This email is fine and translated into the desired language, English. The second one will arrive only after we manually approve the user in WordPress in the user administration. This second email, however, will arrive in Czech instead of English.

At the same time, I later tried one more thing. I switched the WPML switch in the WordPress administration to English and edited the text directly in the WP Forms administration. The form has a different ID, so I assume that I am editing the English version directly. Even though I have English text in my WP forms settings, the email still shows Czech.

Best Regards,
Tomas

edited czech text.jpg
May 15, 2025 at 5:30 pm #17038277

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

May 20, 2025 at 5:07 pm #17053954

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Am I able to do a test purchase in order to send out the email?

You also mentioned the following.

"The second one will arrive only after we manually approve the user in WordPress in the user administration. This second email, however, will arrive in Czech instead of English."

When you manually approve the order -- what language are you using in the backend? What are your results if you switch to the desired language and then approve it, does that make a difference here?

May 21, 2025 at 9:32 am #17056179

tomasH-28

Hello Bobby,

The website is on a live domain, but it is still under development and not accessible to the public, so you can do any tests you want. You can do registration here: hidden link and after that manually approve the user from admin profile in users - Please, see screenshot.

To clarify and answer your question: I also tried all this before approving the user

Change language to English in backend with WPML language switcher on the top bar.

Change the default language of the user administrator profile "hones" from which the user is approved to English.

Change the default language in WordPress in the WPML settings to English.

None of these settings helped, the confirmation email is still in Czech. Now all the above settings are in their original state.

Best Regards,
Tomas

approve user.jpg
May 24, 2025 at 8:12 am #17068340

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I have a theory on what is happening now, thank you!

When a user registers the email is sent based on the language that was used to register.

The account created, is set to use "default " language, which would be Czech.

When you approve the email manually it sends based on the user's profile language.

Since the language is set to 'default' it sends in the default language of the site.

I would like to further investigate this. Where can I add this email or customize it in the backend? When I review the WP Form I am not able to locate it.

May 25, 2025 at 3:07 pm #17070092

tomasH-28

Hello Bobby,

thanks for insight. You can edit message or template of email in specific WP Forms Form. Choose form "Register" in forms list (ID 881) --> click on "Settings or nastavení" on left side --> click on "user registration" -->scroll down --> click on "edit template" next to "Email the user once their account has been activated." There you can edit that message which cant be translated from czech into english. - See attached screenshot.

Best Regards,
Tomas

wp form - user activation settings.jpg
May 29, 2025 at 1:53 am #17085757

Andreas W.
WPML Supporter since 12/2018

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

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

Hello,

My colleague Bobby is on vacation which is why I am assisting you today.

According to Bobby's last comment he was suspecting that the issue is that the user locale is not set in the moment the user is registering on the site.

Could you please give this Code Snippet a try?

add_action( 'user_register', function ( $user_id ) {
  $userdata = array();
  $current_lang = apply_filters('wpml_current_language', NULL);  
  $userdata['ID'] = $user_id;

  if ($current_lang == "cs") {
      $userdata['locale'] = "cs_CZ"; 
    } elseif ($current_lang == "en") {
      $userdata['locale'] = "en_US"; 
    }    
  wp_update_user( $userdata );
});

This snippet will set the user's locale based on the current active language.

Please implement the snippet and test by registering a new user. Please make sure to let me know if this snippet solved the issue or not.

---

Important, when reporting an issue please always make sure all plugins remain updated and test if the issue persists while using the latest versions of all plugins.

Best regards
Andreas

May 30, 2025 at 9:56 am #17091496

tomasH-28

Hello Andreas,

I tried to add snippet via Code Snippets plugin and it seems snippet is working as expected. The default languange of user is English after registration. But unfortunately, the confirmation email after account activation is still in Czech instead of English.

Best Regards,
Tomas

May 30, 2025 at 3:49 pm #17092798

Andreas W.
WPML Supporter since 12/2018

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

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

I suspect that the confirmation email after account activation will be triggered by an admin who activates the account on wp-admin and this is causing a conflict between the current admin language and the actual user language.

I will set up a test site with WPML and WPForms and test if I can recreate this issue and then get back to you.

May 30, 2025 at 3:57 pm #17092816

Andreas W.
WPML Supporter since 12/2018

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

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

Before I will try to recreate this issue, could you please update WP Forms and test again?

Let me know if the issue persists after running the update.

June 2, 2025 at 7:11 am #17096433

tomasH-28

Hello Andreas,

I updated WPforms to latest version (1.9.5.2), tested registration of new user and approved the user. Snippet is active, user profile languange is in English, but email is still in Czech.

Thank you for recreating the issue.

Best Regards,
Tomas

June 3, 2025 at 2:38 pm #17102951

Andreas W.
WPML Supporter since 12/2018

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

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

I suspect that it is the admin language that triggers the issue, in the moment an admin confirms the user.

Please run another test and investigate if the admin language is influencing the language of the e-mail.

Also, please test if setting the admin's profile language to "Site default" can solve this issue.

June 9, 2025 at 1:22 pm #17118600

tomasH-28

Hello Andreas,

thanks for the tip. I've tried this before, it didn't have any effect. Now I've tried it again and still nothing. Even though I have the administrator language set to English when confirming users and even though I have it as "Default". Unfortunately the email sent from WP Forms is still in Czech. It's really a big mystery. Don't the WP forms developers have any information about this? Unfortunately it's important for us to confirm the user manually, I didn't expect there to be such a problem and although it may seem like a trivial problem, I would need to solve it somehow. 🙁

Best Regards,
Tomas