Skip Navigation

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

Problem:

MailPoet - Checkbox opt-in message - if the user changes the message the string cannot be found for translation

Solution:

1. Open the following file with the text or code editor that you are using.
/wp-content/plugins/mailpoet/lib/WooCommerce/subscription.php

2. Change this line:

<span class="woocommerce-terms-and-conditions-checkbox-text">' . $this->wp->escHtml($label_string) . '</label>

To this:

<span class="woocommerce-terms-and-conditions-checkbox-text">' . esc_html_e($label_string, 'wpml-fix') . '</label>

3. Save the change.

4. Visit the page on the front-end where this string is showing and this way the string will be registered.

5. Go to String Translation, and you will find this string under the 'wpml-fix' domain.

6. Translate the string.

It will now also work on the front-end.
Relevant Documentation:

50% of people find this useful.

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 8 replies, has 3 voices.

Last updated by Itamar 3 years, 9 months ago.

Assisted by: Itamar.

Author Posts
September 9, 2019 at 1:04 pm

fredericE

Hi,

Our site is in English, Danish, French and German

In mailpoet setting we enable the checkbox opt-in message so the new clients can opt-in to be on the newsletter.

The straing we typed is:
I would like to be added to the naturezoo mailing list

In the wpml string translation. we searched for the string but it return no result.

Can you please assist

September 9, 2019 at 9:32 pm #4540259

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

The MailPoet plugin (MailPoet 3) is not officially compatible with WPML.
https://wpml.org/documentation/plugins-compatibility/
When I search our forum, I can see that there are a few reported issues with this plugin.
In our internal documentation, I can see that we have tried to contact the author of the plugin, but they are not responsive in the last few months, and the compatibility process is stuck due to this.

If you want to continue, then we need to replicate the issue that you are having on a clean WordPress installation. For this, I created a test website with a fresh WordPress install. You can access it through this link:
hidden link
Through this link, you will be automatically logged in. (If nobody logs in the test site will be available for one week from today.)
Could you please install the MailPoet 3 plugin and see if the issue is replicable on a clean WordPress installation?
Please configures WPML as it is configured on your site.
Please also make sure that you are installing the latest version of the plugin.
If the issue is replicable on a fresh installation, then I'll get the help of our compatibility team on this issue.

Thanks,
Itamar.

September 14, 2019 at 1:19 pm #4572717

fredericE

Hi,

I cannot save the changes I made in mailpoet
When I go to
hidden link
I change the string Yes, I would like to be added to your mailing list but it doesn't save

September 16, 2019 at 11:50 am #4579891

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

I was able to save the changes in in MailPoet settings. But I could not find the new string in String Translation or in Translate texts in admin screens. Therefore I've escalated this issue to our compatibility team.

I'll keep you updated here for any news regarding this issue.

Thank you for your patience.
Itamar.

September 22, 2019 at 9:06 am #4617799

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Here is the fix that our compatibility gave fro this issue.

1. Open the following file with the text or code editor that you are using.
/wp-content/plugins/mailpoet/lib/WooCommerce/subscription.php

2. Change line 49 to:

<span class="woocommerce-terms-and-conditions-checkbox-text">' . esc_html_e($label_string, 'wpml-fix') . '</label>

3. Save the change.

4. Visit the page on the front-end where this string is showing and this way the string will be registered.

5. Go to String Translation, and you will find this string under the 'wpml-fix' domain.

6. Translate the string.

It will now also work on the front-end.

Please let me know if it is working for you.

Regards,
Itamar.

October 1, 2019 at 8:24 am #4669441

fredericE

Hi,

I don't have that code in line 49.
Do you want me to change line 55 from

<span class="woocommerce-terms-and-conditions-checkbox-text">' . $this->wp->escHtml($label_string) . '</label>

to your code

<span class="woocommerce-terms-and-conditions-checkbox-text">' . esc_html_e($label_string, 'wpml-fix') . '</label>

Is that correct?

July 8, 2020 at 1:28 pm #6548529

dirkB-14

Hi,

Currently I'm debugging the same problem and found this thread.

I'm wondering why you have suggested to modify the plugin? The modification could be overwritten with the next plugin update.

July 8, 2020 at 7:16 pm #6551401

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

You are correct @dirkb-14 in case, of a plugin update the modifications would probably get overwritten. In such a case, you would need to insert our suggested fix again. But the code from the plugin might change and exactly be as we specified.

In case you have missed the beginning of the thread I'll repeat here what I explained.

The MailPoet plugin (MailPoet 3) is not officially compatible with WPML.
https://wpml.org/documentation/plugins-compatibility/
When I search our forum, I can see that there are a few reported issues with this plugin.
In our internal documentation, I can see that we have tried to contact the author of the plugin, but they are not responsive in the last few months, and the compatibility process is stuck due to this.

In such a case this is the only possible fix that we can give. Moreover, since it is a string in one of the plugin's files there could be no way for a fix to this from WPML's side. Only the author of the plugin can permanently include the fix in the plugin's files. I hope that now things are more clear.

It would be great if you could contact the authors and urge them to join our Go Global Program. You can find details about it here.
https://wpml.org/documentation/theme-compatibility/go-global-program/
We will be happy to cooperate with the authors in making their plugin officially compatible with WPML.

Thanks,
Itamar.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.