Background of the issue:
I am trying to ensure high accessibility standards (WCAG 2.2 AAA + Best practice) on our website, convera.com, where we use a WPML Language switcher called from a custom plugin. The language switcher can be seen on the page next to the text 'Choose your language' at the URL hidden link. The code used is: do_action('wpml_add_language_selector');
Symptoms:
There are accessibility issues reported in the WPML language switcher menu. Specifically, WCAG errors include: 1. Certain ARIA roles must contain particular children. 2. Certain ARIA roles must be contained by particular parents.
To resolve above, the expected behavior is for <LI> elements to have the role 'group' instead of 'none', and for the <SPAN> element to not have a 'role' attribute.
Questions:
Need WPML team to review my suggestion and implement if found helpful in the WPML language switcher menu template.
We need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our second-tier supporters. To achieve this, I created a test website with a clean WordPress installation. You can access it through this link:
hidden link
With this link, you'll be directly logged in.
Could you please install your custom plugin that adds the Language Switcher in the menu and see if the issue is replicable on a clean WordPress installation?
I've configured WPML to have English as the default language and French as the second language.
When everything is finished and you can replicate the problem, please let us know.
Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.
Kindly update on the status. We are widely using this plugin on our website i.e. numerous pages and hence the number of errors is increasing day by day.
First of all, I cant access the link you shared.
Second, in our plugin what we are doing is just calling WPML menu via code below
do_action('wpml_add_language_selector');
You can implement the menu using the code above and test. One menu is available on page you can install RAMP chrome extension and perform a test on page with menu by right clicking on page and perform the top most level test i.e. WCAG 2.2 AAA + Best practice and view the results to find recommendations for accessibility.
hidden link
What I have suggested previously are minor changes to HTML attributes of your plugin which resolve the issue.
Please let me know if you need more info or have questions. We want to resolve this issue quickly.
Hi, and thanks for the information you have provided.
I replicated this problem on a sandbox site and escalated it to our second-tier supporters. I'll keep you updated here on any news regarding this issue.
This issue has been escalated to our developers.
They will check it and include a fix to it in future versions of WPML.
We will update you when a fix for this issue is released.
I can see that our developers are already looking into this. However, I'm not in a position to tell when it will be released. We will keep you updated here.