4 ms·
> It even pronounced ⅯⅭⅯⅩⅭⅥ as "nineteen ninety six". No, it pronounced it “one thousand, nine hundred and ninety-six”—a number rather than a year. I’m mildly
by chrismorgan 4y ago
> It even pronounced ⅯⅭⅯⅩⅭⅥ as "nineteen ninety six".
No, it pronounced it “one thousand, nine hundred and ninety-six”—a number rather than a year. I’m mildly curious which it would have pronounced “1996” as.
I think this shows pretty neatly that even numerals are ambiguous as to pronunciation: depending on the situation, I might pronounce the number as “one thousand, nine hundred and ninety-six” or “nineteen hundred and ninety-six” (when it’s a number; which will depend on factors like what other numbers are around, and my mood) or “nineteen ninety-six” (a year; or very occasionally but riskily a number—as that text could suggest “$19.96”!).
One possible solution in all these cases is to annotate the desired pronunciation so that that is what a screen reader will encounter. Unfortunately, I don’t think you can do this without negative side-effects that are typically worse than the problem. Ideally it’d be a simple attribute like <img>’s alt or interactive elements’ aria-label, but you can’t use either of these on a simple span, and this won’t work:
<span aria-label="nineteen ninety-six">1996</span>
So instead you’d have to mess around with CSS to visually hide things and end up with markup like this:
<span class="sr-only">nineteen ninety-six</span><span aria-hidden="true">1996</span>
… and that damages copy and paste and anything that doesn’t use the CSS. Also screen readers aren’t the only accessibility tech out there, and you may want some to see “1996” rather than “nineteen ninety-six”. Braille printers will very probably fall into one of these two damaged categories, though I’m not actually sure which. (I would quite like to know, actually.)
I’ve been dealing with CSS Counter Styles recently (in my own lightweight markup language, powered by that plus parsing), now I have the crazy idea of adapting its @counter-style rule’s speak-as property (… which I will also admit doesn’t actually permit anonymous counter style values, but hey ho):
<span style="speak-as:symbols('nineteen ninety-six')">1996</span>
Hmm. Could actually be mildly fun in a “nooooooooooo!” kind of a way.
For years specifically, I’m curious if wrapping them in <time> changes any screen reader’s understanding:
<time>1996</time>
(Yes, this is valid. <https://html.spec.whatwg.org/multipage/text-level-semantics.html#datetime-value https://html.spec.whatwg.org/multipage/text-level-semantics....>, ninth case.)
I’ve picked on numbers here, but it applies to a variety of other things too. https://news.ycombinator.com/item?id=35168439 https://news.ycombinator.com/item?id=35168439 elsewhere in this thread shows half a dozen different pronunciations of “X”.
I really hope there’s something I’ve missed, but I don’t think there is. Perhaps we should make one. I think I’ve also demonstrated that it needs to be speech-specific, not just something like aria-label.
- rjmunro 4y ago> ... this won’t work: > <span aria-label="nineteen ninety-six">1996</span> Why won't that work? Is that a bug in screen readers or not allowed by the specifications?
- chrismorgan 4y agoaria-label is for interactive elements only. It won’t do anything on non-interactive elements.