Question

I have a very specific localization problem that I have not had any luck finding specific information about in my research.

I have an app that I'm localizing that shows elapsed minutes(M), seconds(S), milliseconds(X) in the following format:

MM:SS:XX

I've been told by a friend that this will work fine in all European countries, however I have no idea what to expect for other languages.

Are there any languages that don't use the 0-9 character set?

Would formatting be different? I.E. left to right, right to left..

Would the delimiter of ":" make sense for every language?

Any information about language specific discrepancies would be very appreciated! Extra points for tips on doing this in Apple's Swift language.

Apple's 40 supported languages list is here: https://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html

Was it helpful?

Solution

The format you have adopted is confusing: it uses the same format than HH:MM:SS but with a different meaning.

The appropriate time format in many countries is ISO 8601. It foresees a decimal separator (dot or comma) for the sub-second part. So it should be MM:SS.xxx .

Since it's an international standard, it should be understood in most countries around the world.

Additional thoughts

Time formatting may be different for duration (elapsed time) and for a point in time.

Since you're representing a duration, you have fortunately no issue related to 12/24 hour representation, nor timezone.

But, some locales use letters as separator, like 34m25s230, with or without spaces. And some local usages recommend to use explicits units for elapsed time (e.g. Switzerland).

If you try to cope with all these subtililies, you'll end up very quickly in a very expensive localisation. From my own experience, the ISO time representation is widely accepted and well understood even if it differs slightly from the local usages. So I'm not sure it's worth to over-engineer this feature.

Practical info

Unicode, which is a valuable source for localisation doesn't have anything about elapsed time.

You can find more about formatting dates with milliseconds in Swift here on SO.

OTHER TIPS

All European countries? Don't be too optimistic!

You don't have the hours part, nor the floating point, which makes the case a bit simpler than the average. However, you shouldn't assume that every culture specifies minutes, seconds and milliseconds as yours. This includes:

  • Separators. For instance, according to MomentJS, Malay, Indonesian, Javanese or Finnish cultures use dots instead of colons:

    Example: 21.12.24

  • Digits. Some Arabic cultures (according to the same source) use characters which look a bit... well, different from Arabic numerals:

    Example: ٢١:٠٧:٣٦

Formatting time, date or numbers according to the culture is not an easy task. Never do it yourself, and rely for that on the framework or the third-party libraries.

Licensed under: CC-BY-SA with attribution
scroll top