Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting a time delta of 30 minutes in polish does not work anymore #764

Closed
xoraxax opened this issue Dec 4, 2020 · 1 comment
Closed
Assignees

Comments

@xoraxax
Copy link

xoraxax commented Dec 4, 2020

With 2.5.3:

>>> import babel.dates
>>> import datetime
>>> babel.dates.format_timedelta(datetime.timedelta(minutes=30), locale="pl", format='short')
'30 min'

With newer versions:

>>> import babel.dates
>>> import datetime
>>> babel.dates.format_timedelta(datetime.timedelta(minutes=30), locale="pl", format='short')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/babel/dates.py", line 944, in format_timedelta
    pattern = patterns[plural_form]
  File "/usr/local/lib/python3.7/site-packages/babel/localedata.py", line 218, in __getitem__
    orig = val = self._data[key]
KeyError: 'many'
>>> import pdb; pdb.pm()
[2] > /usr/local/lib/python3.7/site-packages/babel/localedata.py(218)__getitem__()
-> orig = val = self._data[key]
(Pdb++) self._data
{'other': '{0} min', 'per': '{0}/min'}

@akx akx self-assigned this Jan 25, 2022
@akx
Copy link
Member

akx commented Jan 25, 2022

This was fixed by #827 :)

@akx akx closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants