GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.03k stars 9.32k forks source link

Utilize localized failure messages from axe #15889

Closed connorjclark closed 2 months ago

connorjclark commented 3 months ago

Axe now has 16 locales: https://github.com/dequelabs/axe-core/tree/develop/locales

Just pass the locale object (node_modules/axe-core/locales/*.json) to axe.configure({locale}).

We should discuss the possibility of using these in Lighthouse. Besides working out how to map our locale to theirs, this seems straightforward to implement.

These are community contributions, so may become stale or have gaps. For the gaps, we should implement a fallback thing to grab from english strings when a locale is missing its own translation. For the staleness, we need to discuss if worth the tradeoffs.

An expensive option is we could run these strings through our i18n ourselves (and potentially upstream?)

connorjclark commented 3 months ago

this would be the explanation field of each axe audit node result, which currently does not appear in the report. so we would need to show that first. But how useful are these?