Background of the issue:
I am trying to set up WPML on my website. I've configured my WPML selector as I wished. When I try to switch between my translations (EN -> FR), the wp-wpml_current_language is not updated, or updated to the wrong language. Link to a page where the issue can be seen: hidden link. But, the translation is good (meaning, EN -> FR, the text turn french, but the Cookie and Class says it's en the current language).
Symptoms:
The current language is not updated (Cookie and CSS class). I've tried in private navigation and to clear my cache.
Questions:
Why is the wp-wpml_current_language not updating correctly?
How can I ensure the language switcher updates the current language as expected?
While one of my teammates addresses your ticket, I will provide you with some initial debugging steps.
Does the same issue occur if you temporarily deactivate all plugins except for WPML?
When using your custom language switcher, I am unable to switch between languages. The language switcher only works once, and this does not show the issue. I recommend temporarily activating the default language in the footer (in WPML → Languages) to check if it resolves the problem.
I've desactivated almost all of my plugins (only sitekit and elementor kept). And it doesn't solve the problem.
Also, I added the default switcher in the footer, but it suffers of the same problem : when I click to French, the page is translated, but the switch doesn't update the current language correctly.
When viewing the EN version I can see the language switcher at the bottom which then allows me to switch to FR or AR but then I cannot switch back to EN.
The source is showing OK in the EN, however, take a look at the FR source.
view-source:hidden link
it's not updating correctly, which is why the option to switch to EN is not showing.
I can see you are using a custom theme, Is it possible to test with the parent theme of Hello Elementor or a theme such as Twenty25? this will help us understand if the issue is originating from the theme's code or something else.
"When viewing the EN version I can see the language switcher at the bottom which then allows me to switch to FR or AR but then I cannot switch back to EN."
=> It's because the current_language item has a CSS on it that makes it white so it not visible (white on white), but it's there. The problem is that the current_language does not switch to french so the 'English' selector stays not visible.
The hrelfang is also showing in hidden link on my side (I don't what you mean by it's not updating correctly).
I tested with HelloElementor not custom, and it acted the same (I can't let it with that theme unfortunately).
I also used the troubleshooting page to try and clear the cache and all, but it didn't solve the problem.
This behavior is not expected and will need to be further investigated. At the moment there is no known issue that is affecting other users or has been reported, therefore my guess is that we are dealing with something that is environment related.
I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)
**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **
I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.
NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.
Thank you,
Bobby
The topic ‘[Closed] The wp-wpml_current_language is not updated, or updated to the wrong language.’ is closed to new replies.