8

I'm writing some code that turns duration into human-readable text. And I wish to do it correctly. Below are example cases, please point out the mistakes in French one. (I don't have any French knowledge)

English:

Long Mid Short
a second 1 sec 1s
2 seconds 2 sec 2s
a minute 1 min 1m
6 minutes 6 min 6m
an hour 1 hr 1h
9 hours 9 hr 9h
a day 1 day 1d
6 days 6 day 6d
a week 1 wk 1wk
2 weeks 2 wk 2wk
a month 1 mo 1mo
3 months 3 mo 3mo
a year 1 yr 1y
7 years 7 yr 7y

French:

Please

Long Mid Short
une seconde 1 sec 1 s
8 secondes 8 sec 8 s
une minute 1 min 1 min
9 minutes 9 min 9 min
une heure 1 hr 1 h
10 heures 10 hr 10 h
un jour 1 jour 1 j
11 jours 11 jours 11 j
une semaine 1 sem 1 sem
4 semaines 4 sem 4 sem
un mois 1 mois 1 mo
2 mois 2 mois 2 mo
un an 1 an 1 an
9 ans 9 ans 9 ans

Merci beaucoup!

jlliagre
  • 148,505
  • 9
  • 106
  • 237
  • Related: https://italian.stackexchange.com/questions/14068/year-month-week-day-hour-minute-second-abbreviation-in-italian – jlliagre Aug 22 '22 at 15:38
  • 2
    The right way to do it is not to re-invent the wheel but to use existing work. The CLDR contains all sorts of data like units etc. translated in 400+ languages and actively maintained by the Unicode consortium. https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-units-modern/main/fr/units.json#L363 has the translations of time duration units for French. But the best way is probably to use an existing library. If you tell us which (programming) language you use, we can probably point you to the relevant library. – jcaron Aug 22 '22 at 16:12
  • Wow, it's really helpful. But does it feature abbreviations? I'm really looking for abbreviations. – Мэндээ Aug 24 '22 at 01:41

1 Answers1

15

1 sec is non standard, you use either 1 s or 1 sec., the latter with an ending dot because it's an abbreviation.

1 hr is not (or no more) a French abbreviation or unit, use 1 h, no ending dot for official unit symbols.

1 j should theoretically be 1 d if we stick to international units but that wouldn't be very localized and risk to be misunderstood. 1 j. would be the correct abbreviation but 1 j would likely be accepted too.

1 sem should be 1 sem., ending dot required too.

I'm not aware of a well known abbreviation for mois. You should either keep 1 mois for the short form or use 1 m. if the context makes clear it's a month, and never use 1 m which means "1 meter"!

If you write une seconde, you probably want to write huit secondes for consistency. Same for all other units, either you only use digits or you use numbers in words up to seize (16).

Note from the International System of Units document:

Unit symbols are mathematical entities and not abbreviations. Therefore, they are not followed by a period except at the end of a sentence, and one must neither use the plural nor mix unit symbols and unit names within one expression, since names are not mathematical entities.

See also: How should I abbreviate "10 jours - 3 heures"?

jlliagre
  • 148,505
  • 9
  • 106
  • 237
  • "1 sem should be 1 sem." isn't very clear. – Eric Duminil Aug 21 '22 at 19:02
  • @EricDuminil "1 sem" should be "1 sem." with an ending dot. – jlliagre Aug 21 '22 at 19:58
  • Yes, it took me a while to understand, because every sentence should end with a dot anyway, so it looks like nothing changes between the two words. I don't know how to write it more clearly, though. Possibly spell out "ending dot", like you did in the comment. – Eric Duminil Aug 21 '22 at 20:25
  • @EricDuminil I usually end my sentences with a dot (or a period, a full stop whatever it's called) but I didn't do it for the first three sentences of this reply because it would have been confusing. I hesitated to state the dot was required for sem. because I thought that was clear from the first sentence where it is explicit (sec.). – jlliagre Aug 21 '22 at 20:34
  • I think "mn" is less ambiguous to not mistake minimal values for minutes. Else it would also be better to use "min." with a dot. – Puck Aug 22 '22 at 13:13
  • 3
    @Puck mn used to be valid but is no more accepted by the standard. Official units are symbols so must not have an ending dot. International System of Units: Unit symbols are mathematical entities and not abbreviations. Therefore, they are not followed by a period except at the end of a sentence, and one must neither use the plural nor mix unit symbols and unit names within one expression, since names are not mathematical entities. – jlliagre Aug 22 '22 at 13:23
  • RE:SI in comments, I think that could be part of the answer, that units and abbreviations obey to different rules. – AmiralPatate Aug 22 '22 at 14:04
  • 2
    On a separate-but-not-really note, the one SI unit for time is seconds (symbol: s), but the SI accepts use of non-SI units, specifically minutes, hours and days, which symbols, respectively, are: min, h, d. Unit symbols are universal and language-independent, so that makes "j" an abbreviation rather than a unit symbol. So it should get a dot (although the vast majority of people would probably not give it one). – AmiralPatate Aug 22 '22 at 14:26