arrow icon indicating copy to clipboard operation
arrow copied to clipboard

i18n issue with noun suffixes for .humanize(only_distance=True)

Open 0xallie opened this issue 7 years ago • 2 comments

The current i18n implementation doesn't allow enough granularity for languages with noun suffixes like Hungarian. In Hungarian, "17 years" would be translated as "17 év". However, "17 years ago" is translated as "17 évvel ezelőtt", and calling .humanize() with only_distance=True returns a construct that makes no sense by itself:

>>> arrow.get('2000-01-01').humanize(locale='hu_HU', only_distance=True)
'17 évvel'

0xallie avatar May 31 '17 13:05 0xallie

I get this when building from master.

>>> arrow.get('2000-01-01').humanize(locale='hu_HU', only_distance=True)
'18 évvel'

Looks like the problem still exists, @nyuszika7h interested in fixing this?

systemcatch avatar Dec 14 '18 11:12 systemcatch

@systemcatch is this similar to https://github.com/crsmithdev/arrow/pull/576? If so, we may need to add a few more keys to the locale dictionary to allow translations of only_distance cases.

jadchaar avatar May 26 '19 18:05 jadchaar