arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.7k stars 673 forks source link

No support for quarter granularity in Russian (locale: ru_RU) #1062

Closed manlix closed 2 years ago

manlix commented 2 years ago

Issue Description

No support for quarter granularity in Russian (locale: ru_RU).

Actual result

>>> import arrow
>>> arrow.now().shift(months=4).humanize(granularity="quarter", locale="ru_RU")
Traceback (most recent call last):
  File "/home/manlix/git/arrow/arrow/arrow.py", line 1263, in humanize
    return locale.describe(granularity, delta, only_distance=only_distance)
  File "/home/manlix/git/arrow/arrow/locales.py", line 149, in describe
    humanized = self._format_timeframe(timeframe, trunc(delta))
  File "/home/manlix/git/arrow/arrow/locales.py", line 1297, in _format_timeframe
    form = self.timeframes[timeframe]
KeyError: 'quarter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/manlix/git/arrow/arrow/arrow.py", line 1310, in humanize
    raise ValueError(
ValueError: Humanization of the 'quarter' granularity is not currently translated in the 'ru_RU' locale. Please consider making a contribution to this locale.

Expected result

>>> import arrow
>>> arrow.now().shift(months=4).humanize(granularity="quarter", locale="ru_RU")
'через квартал'
>>> 

System Info