Skip to content

Add configurable language support, implement portuguese language

Hello!

I wanted to use this great lib with a project that would be in Portuguese, so I decided to go ahead and implement it.

As there was no configurable language option, here's my attempt at it.

Should not be a breaking change for most uses (I've added more tests in a separate commit, the changes do pass the previous tests without any changes to them), except for implementors of the Humanize trait (as there's now a required humanize_in method).

The language preference is stored inside HumanTime, so that fmt::Display and others can have access to it. The language (that defaults to English) can also be set using a .language() method.

Thanks!

Merge request reports

Loading