Search code examples
accessibilitywai-aria

Accessible values, 0:00 as a duration not a time, 1/12/2023 as a date, etc


I have some html text which the NVDA screen reader (via the speech viewer) shows as the below text

row 9  Tue 28/11/23
First Hours 6:00
Second Hours 0:00
Third Hours 0:00  column 7

and reads aloud like so

row 9  Tue 28 slash 11 slash 23
First Hours six
Second Hours zero o'clock
Third Hours zero o'clock
 column 7

i.e. it thinks 6:00 is a duration, 0:00 is a time (it's not), and it doesn't recognise the date

I can't find any aria markers to indicate to the screen reader what the values actually mean?


Solution

  • The best solution is . . . to leave it as it is and do nothing.

    You may be tempted to replace the text that you feel incorrectly read with a correction in full, using the visually-hidden+aria-hidden technique:

    <span aria-hidden="true">Text that was incorrectly read</span>
    <span class="visually-hidden">Replacement visible only by screen readers</span>
    

    However, it's a very bad idea, especially for numbers, dates, times, etc. for several reasons, among the following:

    • For a braille user, it's much longer, and a lot less understandable, to read "0 minutes, 0 seconds" in full text rather than "0:00"
    • Everything isn't read exactly the same by all people, and you shouldn't impose your way. Some people prefer to have the text read as it is without any interpretation for example. By imposing your way, you are very likely to create more problems than solve.
    • Screen reader users are used to pronounciation quirks and understand them well, so you don't need to care specially. Once again, by imposing your way, you are very likely to create more problems than solve.
    • Different screen readers and even different voices threat numbers, dates and times differently, so maybe it's a problem for you, but not for other people. For example, I have no problem with Jaws with Eloquence synthesizer, which says "zero hours" for "0:00".
    • Blind users aren't stupid, and can understand even if what is read don't match exactly what was meant. For example, "3:12" is read as "3 hours 12", but it's in principle obvious from the context if it means in fact 3 minutes and 12 seconds and not 3 hours and 12 minutes.

    In general, replacing some text by another alternative text is a bad idea and is likely to create more problems than solve.