Skip Navigation

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

Problem:
The client reported that the language switcher was not working on the desktop version of their site when viewed in English, although it was functioning correctly in French. The mobile menu was unaffected. The site is using the Impreza theme, and the issue persisted even after the theme was updated to address a WPML compatibility issue.

Solution:
We recommended the following steps:
1. Increase the WP Memory Limit to at least 128MB, preferably 256MB, by adding the following code to the

wp-config.php

file:

/* WP Memory Limit */<br />define('WP_MEMORY_LIMIT', '256M');<br />define('WP_MAX_MEMORY_LIMIT', '256M');

2. Clear all caches from any caching plugins and server/CDN.
3. Remove and re-add the Menu Language Switcher in WPML > Languages.
4. If the issue persists, test for a compatibility issue by deactivating all non-WPML plugins and switching to a default WordPress theme.
5. If necessary, provide access for further investigation and duplication of the site in a local testing environment.

After thorough investigation, we discovered that the desktop menu ("Menu principal") was missing a "CUSTOM LINK" for the French language, which was present in the mobile menu ("Menu mobile"). We added the missing custom link to the desktop menu, and the language switcher now appears correctly on the site.

If you're experiencing a similar issue, we recommend you try the steps outlined above. However, please note that the solution might be irrelevant due to being outdated or not applicable to your case. If the problem persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please open a new support ticket.

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

Last updated by Mihai Apetrei 12 months ago.

Assisted by: Mihai Apetrei.

Author Posts
February 21, 2024 at 11:44 pm #15330729

francoisA-14

My site had the language switcher working since a long time and we found out that lately the language switcher does not work when we see the site in English, but it show when the site is in French. Seems to do that only on the Desktop version of the site, the mobile menu seems to work.

You can look at the site directly right now to see the problem.

hidden link
hidden link

February 21, 2024 at 11:55 pm #15330737

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

That is pretty weird, indeed.

1. I have noticed that your website’s WP Memory Limit is 40MB. The WP memory limit needs to be increased as the minimum requirement for WPML is 128Mb WP Memory Limit: https://wpml.org/home/minimum-requirements/

❌ Very important: please make a backup of your site (files & database) before following any of the upcoming steps ❌

Please add this to your wp-config.php file to increase WP memory:

/* WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Paste it just before:

/* That's all, stop editing! Happy blogging. */

These settings can be limited directly by your hosting provider, so, if that’s the case, I recommend you to contact and ask them to modify them directly. If you can get even higher values It would be great.

Please make sure you have updated the values successfully, You can verify them from WPML >> Support page.

2. If that doesn't fix this, can you please make sure that you clear all the caching from any of the caching plugins that you have active on the site + clear any server / cdn caching?

3. If that doesn't fix this, please go to WPML > Languages > Menu Language Switcher > Remove it and re-add it again and see if that fixes it.

Please let us know how things go.

Mihai Apetrei

February 22, 2024 at 12:09 am #15330744

francoisA-14

Thank you for your interest in my problem.

I did all the changes you asked now the support page is showing 250 MB of memory.

I removed the menu switcher cleared the cache and confirmed that the siwtcher was gone from my French site. Then added it again clearing cache again and the switcher came back on the French page, but still not showing on the English page. Also the design of the switch changedm before I would only see the other language (English on the French page and French on the English page) now I see a drop down for the language switcher, I don'T mind at all, it's just to show that I really did delete the menu switcher and re-added it.

February 22, 2024 at 12:25 am #15330791

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Thank you for the update.

Yes, the fact that it looks a bit different is due to the fact that you had set different settings on the one before. You can go on WPML > Languages > Menu Language Switcher > and turn the switcher into a "List style" instead of "Dropdown style", you can also uncheck multiple other boxes like NOT showing the current language etc.

Thank you for trying all those steps.

Then, I'm guessing that there might be a chance that this issue might be caused by either the active theme or (at least) one of the active plugins.

Can you please let me know if this issue happens even when only the WPML plugins are active and you are using a default WordPress theme?

Please try the following steps so that we can test for a compatibility-related issue:

- create a full website backup
- disable all plugins except WPML and its add-ons
- check if the issue is happening again

- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again so that you can understand which plugin is causing that issue

If the issue happens even with the non-WPML plugins disabled:
- leave all the non-WPML plugins deactivated

- switch to a default theme like TwentySeventeen

- try to recreate the issue now

If you have the chance, it would be best to do this in a staging (testing) environment.

Please let us know how that goes and if following any of these steps solved your issue or brought any change.

We will be waiting for your response.

Mihai

February 22, 2024 at 12:33 am #15330808

francoisA-14

I was expecting not having to do that, creating a staging site, restoring the site, disabling everything... when buying a news subscription to get to support. I could not find the original email that was used with the lifetime subscription we have with the "working" plugin in the site at the moment. And to create a ticker you need an account and to have an account you need to buy something... 😉

If I really need to do all this, I will it'll take some time to do though. I'll be back with the results later.

February 22, 2024 at 5:43 am #15331062

francoisA-14

Ok I did manage to have a staging site working and after disabling the template and playing around with the default menu to show the right menu the language switcher was shoiwing in both language.

I tried a lot of things on the staging site to try ond put backup the switcher in the secondary language with no success...

The template had a update and they were saying that it was suppose to solve a WPML compatibility problem, but it did not solve my problem.

The site is using Impreza.

Do you have a clue where I should look next? It's late here I'm going to bed, thank you in advance for your help.

February 22, 2024 at 10:35 pm #15335760

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Yes, I am definitely sorry that you had to go through all those steps but, in order to have me go through those steps, I would need a full website backup and your approval to duplicate the site on a local environment so I guessed it might be faster if I just share the steps.

So, from my understanding, you managed to get the language switcher show on both languages on the staging site but you are not sure what actually caused it to show up.

If that's correct:

1. Please let me know if you are ok with me duplicating your site on a local testing environment

2.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of the site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this: hidden link

I will be waiting for your response.

Mihai

February 26, 2024 at 8:54 am #15342776

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi and thank you for the credentials and the extra information.

I can confirm that I was able to log in successfully.

I am spending more time on this and I will get back to you as soon as I have more feedback.

I will leave the ticket assigned to myself for the moment.

Kind regards,
Mihai

February 27, 2024 at 7:37 pm #15351203

francoisA-14

Hi.

Any development regarding this case?

Regards,
François

February 27, 2024 at 8:32 pm #15351301

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi François.

I did not get back to you yet because I am still investigating this issue.

I will need your written approval to be able to duplicate your site using a plugin called "Duplicator" and test your site on a testing environment so can you please let me know if this is ok with you?

After we find a solution for this, the duplicated site will be deleted.

Also, please create a full website backup before answering.

Kind regards,
Mihai

February 27, 2024 at 9:05 pm #15351368

francoisA-14

You can go ahead and duplicate the site for your investigation.

As for backups; the site gets fully backed up every week and the database twice per day automatically.

February 27, 2024 at 9:34 pm #15351381

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Thank you for the approval!

I will continue with the investigation and, as soon as I have any updates, I will get back to you.

I'm leaving the ticket assigned to myself for now.

Mihai

March 4, 2024 at 3:27 pm #15370628

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Thank you for all your amazing patience, François.

That really helped me focus and take the time to properly investigate this matter while understanding how things were built on this site (one of the hardest things is to work on something someone else already worked on because you don't know the route they took to build that thing - eg: if you start from scratch on your own, you know exactly what you did).

After a lot of time being spent on testing and debugging things, both on the live site and on the local testing site that I duplicated your site to, I was able to find the difference between the desktop menu and the mobile menu.

The way the menus are built on this site is that they are made of a lot of "Custom Link" elements (as you will see in one of my screenshots).

You can understand how these types of menu buttons can be created by going over this article here:
hidden link

It seems that the person who built this site added "CUSTOM LINK" buttons for the mobile menu (called "Menu mobile") but there is just one button on the desktop menu (called "Menu principal") for English, but there is no button for "French".

You can in the URLs below the mobile menus for both EN and FR.

FR mobile menu:
hidden link

EN mobile menu:
hidden link

I added these buttons to the desktop version of the menu, too, and now they show up on the site correctly + you can also see them in the backend, in the menus area (at the very bottom), too.

FR desktop menu:
hidden link

EN desktop menu:
hidden link

I wish you great luck with the restaurant! The pictures make me hungry 😀

Mihai

Screenshot 2024-03-04 at 17.17.48.png
Screenshot 2024-03-04 at 17.17.32.png
Screenshot 2024-03-04 at 17.15.32.png
March 4, 2024 at 4:13 pm #15371159

francoisA-14

Wow, I'm genuinely impressed with your expertise! We were completely stumped by that issue, but you tackled it like a champ. Massive thanks for your help – you've made a huge difference to our site. Wishing you all the best. You rock! 🌟