Skip Navigation

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

Problem:
The client was experiencing issues with the WPML language switcher. When the site was in English, the switcher displayed 'English' instead of 'Arabic', and vice versa. Additionally, activating WPML plugins caused a critical error for logged-in users, while guest users did not encounter this error.

Solution:
Firstly, we advised the client to uncheck the "current language" checkbox in the WPML > Languages > Menu Language Switcher settings to hide the current language from the switcher. However, the issue persisted because the language switcher was not being served by WPML but by the Woodmart theme or another active plugin.

We requested temporary access to the client's site to investigate further. After reviewing the site, we identified that the language switcher was indeed coming from the Woodmart theme and not WPML. We removed the theme's language switcher and added a custom language switcher shortcode from WPML's documentation: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/adding-language-switchers-using-php-and-shortcodes/. This resolved the issue, displaying the correct languages in the switcher.

Regarding the critical error, we advised the client to activate WordPress debug to gather more information and open a new ticket for this separate issue, providing as much detail as possible.

If you're experiencing similar issues, we recommend trying the steps mentioned 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 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. Should you need further assistance, please open a new support ticket at the WPML support forum.

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

Last updated by Mihai Apetrei 1 year, 2 months ago.

Assisted by: Mihai Apetrei.

Author Posts
April 6, 2024 at 12:22 am #15490098

murshedul-islamC

Tell us what you are trying to do? about language switcher

Is there any documentation that you are following? no

Is there a similar example that we can see? no

What is the link to your site? hidden link

Hi

I tried to use wpml language swticher but when the language in english it's showing English written in switcher i want when english it should show arabic so if user enters the website in english when he click in arabic it will bring arabic and when in arabic it should show english

April 6, 2024 at 8:54 pm #15490972

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

Inside WPML > Languages, there's a "Menu Language Switcher" section where you can edit the current language switcher and select specific settings for it.

You can UNCHECK the "current language" checkbox; that way, only the other language will show in the language switcher. The current language will always be hidden.

Please let me know if that helped you accomplish what you wanted.

Mihai Apetrei

April 10, 2024 at 11:57 pm #15506654

murshedul-islamC

I tried but it didn't work

April 11, 2024 at 12:06 pm #15509002

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there and thank you for the update.

I looked at the code and this is not the language switcher that is being served by WPML.

This is coming from either the theme or from one of the active plugins.

From what I can see, you are using the Woodmart theme so I think this has its own settings to handle the language switcher.

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

Screenshot 2024-04-11 at 14.56.42.png
April 11, 2024 at 7:41 pm #15510890

murshedul-islamC

My friend I am seeing that your plugins are having very big bugs

When WPM plugin are activated it's showing wordpress critical error
I am sharing my staging site admin with you

Please let me know

cause in main site i deactivated all wpml plugins for this issue

Screenshot_72.png
April 11, 2024 at 7:44 pm #15510907

murshedul-islamC

Please share the private area again to send you access
thank you

April 11, 2024 at 11:08 pm #15511043

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

I am sharing the private fields once again with you below.

In regards to the fatal error that you experienced now, you can activate WordPress debug to find out more about what is actually happening when you receive that error (because the message that you see now is generic):
https://wpml.org/documentation/support/debugging-wpml/

Also, please note that, per our Support Policy, we can handle only one issue per ticket.

Continuing with one issue per ticket helps not only supporters to focus on one issue at once, but also enables other users to find solutions to their questions faster.

So, I recommend that you open a new ticket when you have more info about that error. The WordPress log should give you more details on what exactly caused that fatal error. Also, please share with our colleagues WHEN you see that error: if you are doing a specific action that causes that error to show up. The more information you can share upfront, in the new ticket, the better and faster we can move with it.

Thank you for your understanding and cooperation.

I will be waiting for the credentials so that we can try to focus on the language switcher issue which was the initial issue reported in this ticket.

Mihai

April 12, 2024 at 4:46 pm #15513628

murshedul-islamC

Hi, is there any update?

April 12, 2024 at 8:17 pm #15513947

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

WPML was already active and I did NOT encounter any critical error.

As I mentioned initially, it seems that the language switcher was coming from Woodmart (the active theme) - it was not the one that comes from the WPML > Languages > Menu Language settings.

It was set here by the person who built the site:
hidden link

You can see the proof in the screenshot.

So I removed that language switcher that was coming from Woodmart and I added our own custom language switcher shortcode, as it shows in our documentation below:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/adding-language-switchers-using-php-and-shortcodes/

I will attach screenshots below for all the areas.

Now, things work as you wanted: it shows English when you are in Arabic, and it shows Arabic when you are in English.

If you will still encounter fatal errors, please follow the steps that I shared in my other reply here (https://wpml.org/forums/topic/language-switcher-19/#post-15511043) and open a new ticket with all the helpful information that you can find about that so that we know how we can help you best.

Thank you for your understanding and cooperation!

Screenshot 2024-04-12 at 23.04.51.png
Screenshot 2024-04-12 at 23.09.01.png
Screenshot 2024-04-12 at 23.09.14.png
Screenshot 2024-04-12 at 23.07.14.png
Screenshot 2024-04-12 at 23.07.08.png
Screenshot 2024-04-12 at 23.04.12.png
April 13, 2024 at 8:14 am #15514540
murshedul-islamC

Perfect language swticher works nicely now as my goal

Thank you very much

As I am new for using WPML

I want to reset my credits please
cause by mistake a lot of dummy content got translated which totally i don't need

New threads created by Mihai Apetrei and linked to this one are listed below:

https://wpml.org/forums/topic/split-can-i-get-a-credit-refund/

April 13, 2024 at 7:32 pm #15515157

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there and welcome back!

From my understanding, the initial issue reported here was resolved. I'm happy to hear that! 🙂

Per our Support Policy, we can handle only one issue/request per ticket.

Continuing with one per ticket helps not only supporters to focus on one issue at once, but also enables other users to find solutions to their questions faster.

I created a new ticket for you in regard to the new question here:
https://wpml.org/forums/topic/split-can-i-get-a-credit-refund/

You will be notified via email when there's an answer to that ticket, too.

Also, can you please mark this current ticket as resolved?

Thank you.

Mihai