Skip to content Skip to sidebar

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 10 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 10 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
September 6, 2023 at 8:25 am #14349335

liseH-2

I have followed your tutorial based on the setup WPML + Newsletter plugin but on the subscribe form in front end I have all my lists displayed no matter the language associated with it.

If you visit hidden link

You see all the lists even if i set that in english you can only add to:
Company
Education
Products

Can you help me with this?

September 7, 2023 at 9:30 am #14357651

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

Can you please provide more details or explanation about the issue? Because on your site I don't see any lists or words like Company, Education and Products on hidden link (see attached).

Secondly, I see a few Newsletter plugins (from same author) in your debug information, which one is basically providing those lists? Others may be addons.

Please note that these plugins don't seem to be on our compatibility list (https://wpml.org/plugin/?wpv_view_count=120064&wpv-plugin-functionality=0&wpv_post_search=Newsletter&wpv-wpcf-recommendation-flag=&wpv_filter_submit=Search) and you may probably contact the plugin author as well.

However, let me know the details and let see if I can help resolving the problem.

Regards.

newsletter.png
September 7, 2023 at 10:11 am #14358309

liseH-2

Hi!

I Use WPML and Newsletter plugin that you have a guide WPML + Newsletter plugin
https://wpml.org/documentation/plugins-compatibility/beginners-guide-to-using-the-newsletter-plugin-on-multilingual-websites/

Sorry but i changed the names on the list after i send you a message. Thats why you didnt find Company, Education and Products.
The new lists are:

Strukturbrevet (SWEDISH)
Verktygsbrevet (SWEDISH)
Tips- och trixbrevet (SWEDISH)
The Structure Letter (ENGLISH)
The Tool Letter (ENGLISH)
The Tips and Tricks Letter (ENGLISH)

I dont want the English liststo bee visable on swedish site and etc.

September 7, 2023 at 1:12 pm #14359793

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates and pointing to the correct plugin, it is on our compatibility list.

I assume you have already searched for these strings in String Translation (https://wpml.org/documentation/getting-started-guide/string-translation/).

Did you find the string in ST? If not, can you check this guide too https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/?

If this doesn't help, I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

September 11, 2023 at 11:12 am #14375591

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access.

I checked for the strings in ST but couldn't find. So I then checked in Admin Texts Translation (hidden link) and was able to find all the strings you mentioned (https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/).

I searched for these one by one in admin strings and found that they needed to be included in String Translation (see attached).

So I've added all these to the string translation.

Now you can go to String Translation, search for the string and correct the language for the ones needing it (see attached). For example, if a string is in Swedish but you see its default language is English, while you want to translate into English. Then correct the language first (to Swedish as shown in screenshot) and then translate accordingly.

The ones already in English, can be simply translated to other languages.

string.png
change lang of string.png
September 11, 2023 at 11:30 am #14375761

liseH-2

Thank you.

I have translated or changed the language for the strigs . But the issue still exist.

This options:

Strukturbrevet
Verktygsbrevet
Tips- och trixbrevet

Shall not be visable for english and german visitors

September 11, 2023 at 2:23 pm #14377135

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the details.

I am able to observe the issue. Generally by following the guide it should work fine. However, I am suspecting another issue which may be causing this.

To investigate this further, please consider followings:

1) I've installed a fresh WP site at this sandbox: hidden link

Here I've installed and configured WPML plugins as per your site. I've also uploaded your newsletter plugin which isn't active yet. Please activate and configure it. Then create a page with that newsletter page, translate it. Also create a list as per the guide and see if you can reproduce the issue.

You can install any needed plugin also. I've installed a plugin in your site which offers to download a plugin or theme in a zip file (see Download link under each plugin name on Plugins page), which you can upload to sandbox from Plugins -> Add New -> Upload.

2) If it works fine on the sandbox site, then please create a staging/dev site based on your live site and reproduce the issue by using minimal setup (i.e. with a default theme and deactivating un-necessary plugins). So I can then investigate further without compromising your live site.

In the later case, I'll also need to download the staging site using Duplicator plugin. So it is advised to remove any sensitive and un-necessary data for safety and privacy reasons.

I've enabled your next reply as private again, in case you want to provide staging site access info.

September 12, 2023 at 9:48 am #14382307

liseH-2

Hi!

I did configure the newsletter with 2 swedish list and 2 english lists, but still all 4 lists is visable when visiting: hidden link

September 12, 2023 at 11:28 am #14383069

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I am checking this and 'll get back to you accordingly.

September 13, 2023 at 5:33 am #14386983

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I've escalated the issue to our 2nd tier team for further investigation. I'll get back to you as soon as I've some information.

September 14, 2023 at 6:52 am #14393551

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Our team investigated the issue and found that:

It is true that you can set the lists per language with WPML. However, the option to subscribe or not doesn't seem to be part of it.

However, there are 2 workarounds for this, please consider following.

1) There are some other ways to control what you want to display on the page as per plugin's documentation: hidden link. For example:

- Go to Newsletters > Subscriptions > Form > Lists.
- Uncheck the lists options.
- Add a shortcode like the following in your Newsletter page:

[newsletter_form button_label="Go!"]
[newsletter_field name="email" label="Your best email"]
[newsletter_field name="first_name" label="Your name"]
[newsletter_field name="list" number="1"]
[newsletter_field name="list" number="2"]
[/newsletter_form]

- Register "newsletter_form" and "newsletter_field" shortcodes in WPML -> Settings -> Custom XML Configuration (https://wpml.org/documentation/support/language-configuration-files/#page-builder-content) with their corresponding attributes. So then these are available for translation.
- Translate the Newsletter page and the number attribute accordingly.

2) Alternatively you can use this workaround instead of #1:

- Take a backup of the newsletter plugin before proceeding!!
- Open /wp-content/plugins/newsletter/subscription/subscription.php file for editing.
- Look for line 1328.
- Replace following code:

                    foreach ($list_ids as $list_id) {
                        $list = $this->get_list($list_id);
                        $idx++;
                        $buffer .= '<div class="tnp-field tnp-field-checkbox tnp-field-list"><label for="nl' . $idx . '">';
                        $buffer .= '<input type="checkbox" id="nl' . $idx . '" name="nl[]" value="' . esc_attr($list->id) . '"';
                        if (in_array($list_id, $checked_ids)) {
                            $buffer .= ' checked';
                        }
                        $buffer .= '> ' . esc_html($list->name) . '</label>';
                        $buffer .= "</div>\n";
                    }

- With this code:

                    $is_wpml_configured = apply_filters('wpml_setting', false, 'setup_complete');
                    $wpml_current_lang  = apply_filters('wpml_current_language', NULL);
                    foreach ($list_ids as $list_id) {
                        $list = $this->get_list($list_id);
                        if (!$is_wpml_configured || in_array($wpml_current_lang, $list->languages, true)) {
                            $idx++;
                            $buffer .= '<div class="tnp-field tnp-field-checkbox tnp-field-list"><label for="nl' . $idx . '">';
                            $buffer .= '<input type="checkbox" id="nl' . $idx . '" name="nl[]" value="' . esc_attr($list->id) . '"';
                            if (in_array($list_id, $checked_ids)) {
                                $buffer .= ' checked';
                            }
                            $buffer .= '> ' . esc_html($list->name) . '</label>';
                            $buffer .= "</div>\n";
                        }
                    }

- Save the file.

In this workaround, you can simply set your lists based on "Enforced by language" column.

Please try what suits you better and let me know.