1

I'm working on making a screen reader read a "-" as the word "dash" in a sentence since it skips over it. I've been looking up ways to do this without actually changing the sentence itself. I'd love some advice since I'm new to accessibility.

This is the jsx I need to change

return <span dangerouslySetInnerHTML={{ __html: textChunk }} />;

I was thinking of aria-labelledby, but i'm not sure how to add it here

rioV8
  • 24,506
  • 3
  • 32
  • 49
ericoder
  • 17
  • 1
  • 2
    Have you tried using an actual dash? That's a hyphen. – isherwood Oct 07 '22 at 14:02
  • I'm genuinely interested – do blind people know what a dash even means? A dash is purely a visual part of the sentence and is supposed to let you – pause between words. Can't the reader just put that pause in instead of exclaiming there is a "dash"? – Peter Krebs Oct 07 '22 at 14:49
  • After thinking about it I would want to replace "-" to a "to" but it would only change for the screen reader and not the visual audience – ericoder Oct 07 '22 at 15:11
  • 1
    @PeterKrebs I would assume that most of them do. In spoken language one doesn’t need to make a difference, but in written one does. [Braille does include punctation characters](https://en.m.wikipedia.org/wiki/Braille#Punctuation). I don’t know which are practically used today. – Andy Oct 08 '22 at 08:47
  • @ericoder do you have any particular reason to change what screen reader users are used to? Even in specialised applications like [in chemistry it is recommended to stick to the screen readers pronunciation](https://stackoverflow.com/questions/73460122/marking-signs-denoting-chemical-bonds-for-assistive-technologies/73465751#73465751). I guess I wanna ask you to add more context to your question. – Andy Oct 08 '22 at 08:52

1 Answers1

3

The true answer is, don't do it.

Saying nothing when a dash is encountered alone isn't universal at all. It depends on the screen reader, the voice used, the context, and user settings. It may be the case, for example, that a speech engine decide to say "dash" when it's alone on a line, but ignore it or make a small pause when not alone. Some screen readers also allow to change the name of punctuation characters like dash. It can be common in some languages where these characters can have several names. For example, you can call the character \ either "backslash" or "antislash", & can be "commercial and", simply "and" or "ampersand", etc.

Forcing some label like "dash" just to avoid a potentially unpronounced "-" is bad because it goes against user settings. It's also bad for braille users, who might not well understand what do you mean by writing "dash" literally rather than just "-".

If by "-" you mean nothing, empty, the absence of any other value, you'd better keep a natural "-". You can reasonably expect a natural "-" to be understood as such by most people, including screen reader users.

If the dash is used as a separation character, some people prefer having it pronounced in all cases while some other don't want it ever, combined or not with a more or less short or long pause.

So to wrap up, the best thing to do is actually to leave it as it is. While you may improve accessibility for some users, you may also degrade it potentially for more users than you are going to help.

Andy
  • 4,783
  • 2
  • 26
  • 51
QuentinC
  • 12,311
  • 4
  • 24
  • 37
  • I see, even if it is in the context of a range of numbers. For instance the "-" is separating 30 and 1,500 as a range between. So normally I would want it read as " 30 to 1500", instead the screen reader reads it as "30 1500" ignoring the dash indicating a range. – ericoder Oct 10 '22 at 17:29