Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeSpan-related humanization with French culture is inconsistent #973

Closed
louis-z opened this issue Sep 6, 2020 · 0 comments · Fixed by #974
Closed

TimeSpan-related humanization with French culture is inconsistent #973

louis-z opened this issue Sep 6, 2020 · 0 comments · Fixed by #974

Comments

@louis-z
Copy link
Contributor

louis-z commented Sep 6, 2020

Inconsistency between "1 année" and "2 ans"

In French, there are 2 words for "year": "an" and "année". Their meanings are slightly different (see here), but each one has singular and plural forms.

Currently if one calls TimeSpan.FromDays(days).Humanize(maxUnit: TimeUnit.Year) using French culture, they'll get

  • "1 année" if days = 366
  • "2 ans" if days = 731

Nothing justifies that discrepancy. I suggest we replace (in Resources.fr.resx) "1 année" with "1 an", to make it consistent with the plural form.

In French, "0 <time unit>" should use the singular form

Unlike English, where you would write "0 milliseconds", in French you would write "0 milliseconde" (no 's' at the end).
Currently if you call TimeSpan.Zero.Humanize() you will get "0 millisecondes".

TimeSpan.Zero.Humanize(toWords: true) yields "pas de temps"

This may be more subjective, but to me "pas de temps" does not sound natural. I recommend "temps nul" or "durée nulle" instead.


I already have made the necessary changes. A PR will ensue shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant