Relying on aria-label prevents localisation
Neui opened this issue · 1 comments
Neui commented
From what I understand, the aria-label
is used to label graphical stuff, that'll get read by an screen reader.
However, lets assume I want to translate the page into german. For that, I would also translate the aria-label
s, so for example, instead of using aria-label="Close"
, I would use aria-label="Schließen"
.
However, doing that breaks the visual: The close button won't be rendered.
I see 2 ways to fix this:
- Add all possible combinations to the stylesheet. I don't think this is a good idea, since it would make the stylesheet unreasonably larger, and still prevent flexibility (for example, new languages, or any other custom text)
- Don't rely on
aria-label
, but use css classes, such as.title-bar-controls button.close
orbutton.title-bar-controls-close
.
jdan commented
Appreciate you calling this out, this is definitely a misstep on my part. I'm very much in favor of your second choice as long as we keep the aria-label
for backwards compatibility.