Humanizr / Humanizer

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities
Other
8.53k stars 949 forks source link

TimeSpan Humanize ignored toWords: false parameter #1444

Closed BloodShadow174 closed 4 months ago

BloodShadow174 commented 4 months ago

When executing the code:

var oneDay = TimeSpan.FromDays(1);

oneDay.Humanize(
    culture: CultureInfo.GetCultureInfo("ru"),
    toWords: false
);

Result: "один день" Instead of the expected result: "1 день"

This result is not only in Russian localization, but also in many others! I think that you still need to take into account the toWords parameter with a single value, most likely you can fix it here: https://github.com/Humanizr/Humanizer/blob/c915898b9ebf5b0ddde2384b284f02896cd29e11/src/Humanizer/Localisation/ResourceKeys.TimeSpanHumanize.cs#L27

P.S. Congratulations to everyone on the fact that the library has begun to be updated again 🥰

SimonCropp commented 4 months ago

can you submit a pull request to fix the issue?

BloodShadow174 commented 4 months ago

can you submit a pull request to fix the issue?

I think I can