EvanHahn / HumanizeDuration.js

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

Arabic has an issue with dual names #221

Closed 6km closed 5 months ago

6km commented 6 months ago

In Arabic, dual names like two weeks, two days, etc., are written without the amount of the unit. Arabic is unique among languages for having this grammatical dual form.

For example, two weeks is translated as أسبوعين, not 2 أسبوعين.

I can work on a fix for this.

\ Thanks for your efforts in humanize-duration!

rasa commented 5 months ago

@6km I am considering a PR or friendly fork that provides the time unit names as abbreviations, so "3h 2m", instead of "3 hours, 2 minutes". Is it possible to provide abbreviations in Arabic, if the digit itself is not included? /cc @tomasz1986

6km commented 5 months ago

@rasa I think it's really good to support time abbreviations in Arabic! Here's a list of them:

Using abbreviations for time units in Arabic is not as common as it is in English; however, it's possible to use them in contexts where the space is limited.

rasa commented 5 months ago

@6km Thank you for the help! I included your feedback in my fork here. It seems the values I had for Arabic were correct, but it's always helpful to have someone review it.

6km commented 5 months ago

@rasa Thanks for including my feedback! I'm so glad to hear that!

EvanHahn commented 5 months ago

This was fixed in humanize-duration@3.32.1.