This thread is resolved. Here is a description of the problem and solution.
Problem:
The client needed a way to customize the ALT text for flag images in the WPML language switcher to improve accessibility and comply with WCAG 1.1.1, without modifying WPML core files.
Solution:
We advised the client that currently, the best approach to achieve the desired ALT text customization is to follow the workaround provided in our errata, which involves modifying the 'class-wpml-ls-model-build.php' file.
https://wpml.org/errata/missing-alt-tag-for-flag-image-in-a-language-switcher/
Unfortunately, there are no suitable hooks or filters available for this customization, and implementing custom code would be complex. We also informed the client that there is no ETA for a permanent fix but have taken their feedback as a feature request. We recommended trying the workaround after ensuring a site backup.
Please note that this solution might be outdated or not applicable to your specific case. 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. If this does not resolve your issue, please open a new support ticket at 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.