11

In my HTML document I am using roman numbers (e.g.: MMXV = 2015).

Is there a way to inform screen readers to interpret certain text in another way (e.g.: roman numerals as "Two thousand and fifteen" instead of M-M-X-V)?

My guess was that there would be an ARIA attribute, but I cannot seem to find one. E.g.:

<time datetime="2015" aria-?="Two thousand and fifteen">MMXV</time>
bashaus
  • 1,614
  • 1
  • 17
  • 33

2 Answers2

12

Use the aria-label tag to give the element a meaningful description.

Then, hide the roman numerals from screen readers by wrapping them in a span element that has the aria-hidden property set to true to hide the element from screen readers.

<time datetime="2015" aria-label="Two thousand and fifteen">
    <span aria-hidden="true">MMXV</span>
</time>
Alexander
  • 2,320
  • 2
  • 25
  • 33
unobf
  • 7,158
  • 1
  • 23
  • 36
  • Thanks @unobf. I tried this HTML: . VoiceOver on Mac pronounces both the word "two thousand and fifteen" and the letters "MMXV". Is there a way that you can force it to only say the text in the label? – bashaus Mar 01 '15 at 00:29
0

Ok with unobf answer, but you have also to consider that if using aria-label improves accessibility for people using screen readers, it won't increase accessibility for everyone.

You should read point 3.1.4 about abbreviations of the WCAG.

My feeling about this is that roman numbers is a difficult thing to deal with if you really want to be accessible, and not only for blind people. Using an ABBR tag for instance can help people without screenreaders, but ABBR tag aren't focusable element with keyboard (see point 2.1.1) so there isn't an unique problem free solution.

Adam
  • 17,838
  • 32
  • 54
  • abbr tag is not recognized by screen readers at this time. I wish it was and I also wish that all the browsers would a) make it focusable, b) make a mouseover show the full term, and c) make the full term appear on focus... – unobf Mar 03 '15 at 18:36
  • right, my own conclusion is that abbr should be used only to mark an abbreviation and has better usage without using title attribute. An abbreviation which require an explanation should be made visible. For latin numbers, I would avoid their usage when possible except if the kind of publication require it (scientific publication for intance) and is not intended to be read by population not aware of... althoug dyslexic people would still be concerned, for instance. – Adam Mar 03 '15 at 20:40