User tests: Successful: Unsuccessful:
Issue Summary
The Languages module (mod_languages) was rendering language flag images without required accessibility attributes.
What was wrong earlier
alt attribute (accessibility issue)
width and height attributes (performance / PageSpeed issue)
Even when the full_name parameter was enabled, the alt text was either:
empty, or
not rendered at all
This caused:
PageSpeed Insights warnings
Accessibility (WCAG) violations
Layout shift risk due to missing image dimensions
What has been fixed
Added proper alt text using the native language title
Added title, width, and height attributes to the image output
Ensured accessibility compliance and better performance by default
No override is required anymore to fix PageSpeed or accessibility errors
Updated code implementation
image . '.gif', $language->title_native, [ 'title' => $language->title_native, 'width' => '18', 'height' => '12' ], true ); ?>Result
Expected output is now correctly rendered as:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Modules Front End |
I have tested this item ✅ successfully on 700e7f9
Not the most charming solution but good for now I guess.
| Status | Pending | ⇒ | Ready to Commit |
RTC
Sorry but this PR is completely wrong. In the dropdown mode of the language selector the flags are purely decorative and the current code is correct. Adding an alt attribute serves no purpose and should not be used on decorative images. Additionally setting a title on the image so that the language name is displayed on hover serves no purpose as the language name is displayed already.
Please remove the RTC as it should not be merged in its current form
I have tested this item ✅ successfully on 700e7f9
I have tested this item ✅ successfully on 5.4-dev
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46792.