EvanHahn / HumanizeDuration.js

361000 becomes "6 minutes, 1 second"
https://evanhahn.github.io/HumanizeDuration.js/
The Unlicense
1.65k stars 175 forks source link

Feature: Add option to interchange the humanized words from right to left/ Swahili Language optimization #207

Closed BossBele closed 2 years ago

BossBele commented 2 years ago

As a native Swahili language speaker, I expect the humanized duration to start with words before the count. Eg: "1 day" in Swahili is "siku 1".

Currently, the format does not adhere to the Swahili language; ie. "1 day" = "1 siku".

To solve this, an option to exchange the position of the word would help. Otherwise, an extended formatting function for Swahili would suffice.

BossBele commented 2 years ago

Caveats for implementing an extended formatting function for Swahili means that adding a customized Swahili language humanizer would be impossible:

const humanizer = humanizeDuration.humanizer()

humanizer.languages.shortSW = {
  y: () => 'mw',
  // ...
EvanHahn commented 2 years ago

This has been fixed in aff718e23022163a2d1369a81b84642d29c7a4b4 and deployed in humanize-duration@3.27.3. Thanks for your report!