Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make times ending `:00` accessible (e.g. 14:00)

Voice over reads the following NSStrings like so


14:15

"Fourteen fifteen."

This is clearly a time


14:00

"Fourteen."

This is ambiguous.


If the time 14:00 appears in the status bar it correctly reads it as

"Fourteen hundred hours"

How do I achieve this in a localised way?

iOS reading out correct time

like image 744
Robert Avatar asked May 02 '16 15:05

Robert


2 Answers

How do I achieve this in a localised way?

Overriding the accessibilityLabel with the result of NSDateFormatter::localizedStringFromDate() will be the best thing to do because you can only rely upon iOS's own algorithm to handle any language.

The problem of doing it in a localised way is that it will depend on the language you want.

In French, for instance, you will never pronounce the :00, "14:00" will be read as quatorze heures ("fourteen hours"). "14:12" is "quatorze heures douze" (fourteen hours twelve, not "fourteen twelve")

In Spanish, even if reading 24 hours format, you will always read it on a 12 hours basis: "14:00" will be read as las dos de la tarde ("two in the afternoon") not talking about the distinction between "de la tarde" and "de la noche".

In both French or Spanish, you will never say hundred.

like image 172
Adam Avatar answered Nov 20 '22 06:11

Adam


IMHO it's very easy ;-)

14:00 = Fourteen o'clock

like image 43
NetVicious Avatar answered Nov 20 '22 06:11

NetVicious