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

#632 Continued: Fuzzy month years logic for time span humanize extensions #633

Merged
merged 9 commits into from
May 4, 2017

Conversation

clairernovotny
Copy link
Member

@clairernovotny clairernovotny commented May 4, 2017

This is a continuation of #632 that @MaStr11 started. It's here to serve as a base branch for other languages to PR into.

Fixes #583
This change now allows calls to TimeSpanHumanizeExtensions.Humanize with the parameter maxUnit and minUnit set to TimeUnit.Month or maxUnit: TimeUnit.Year. The duration in month and years is approximated based on 365.2425 days a year (length of the gregorian calendar). Therefore the month are alternating between 30 and 31 days and the years are alternating between 365 and 366 days.

The existing default value for maxUnit=TimeUnit.Week is kept because weeks are precise while month and year are not.

Most of the changes are related to the translation of the month and year identifiers. All text were translated with google translator except:

  • German I'm a native German.
  • Russian Reviewed by a native speaker.
  • fi-FI Tests and translations for timespan were already missing.
  • el Tests and translations for timespan were already missing.

I marked the test related to translations with the [Trait("Translation", "Google")] attribute to make clear which translations are of poor quality.

Checklist for the Translation Reviews:

@clairernovotny clairernovotny added this to the v2.2 milestone May 4, 2017
@clairernovotny clairernovotny merged commit 3bbcab0 into dev May 4, 2017
@clairernovotny clairernovotny deleted the pr632 branch May 4, 2017 23:23
@@ -6,6 +6,29 @@ namespace Humanizer.Tests.Localisation.pt
[UseCulture("pt")]
public class TimeSpanHumanizeTests
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pt-BR and PT looks good

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

Successfully merging this pull request may close these issues.

4 participants