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 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:

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by fredericE 2 weeks, 6 days ago.

Assigned support staff: 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?

October 1, 2019 at 8:34 am #4669625

fredericE

My issue is resolved now. Thank you!