babel
babel copied to clipboard
The official repository for Babel, the Python Internationalization Library
the `babel.dates.format_time` and `format_date` functions support a custom `format` using LDML syntax. it would be nice if the `parse_time` and `parse_date` functions supported it too. my use case is that...
## Overview Description Formatting a negative number with the rounding mode decimal.ROUND_CEILING yields a wrong result. ## Steps to Reproduce ``` python from babel.numbers import decimal, format_decimal with decimal.localcontext(decimal.Context(rounding=decimal.ROUND_CEILING)): x...
Currently the Python extractor does not support deeply nested gettext calls (deeper than as a direct argument to the top-level gettext call). e.g. ```py _("Hello %s", _("Person")) _("Hello %s", random_function(",...
Line 55 in test_numbers.py appeared to be a duplicate of the line before it
Proof of concept fix for #774. I did this quickly using `peekable()` from the more-itertools package, but if adding a new dependency just for this is (understandably) undesirable, it could...
Addresses https://github.com/python-babel/babel/issues/1134 Previously, the `add_message` function would try to access the PoFileParser object's translations list without any checks. However, when an invalid po file is provided, this can lead to...
The below code triggers a list index out of range error when provided a malformed input. This occurs in _add_message at line 235 in babel/messages/pofile.py. ``` import sys import io...
## Overview Description When I use the en_AU locale, the date format for 2023-12-31 places it into W1 of 2023. I would expect this to be W53 of 2023 or...
Closes #1124 Previously, the `Catalog.obsolete` dictionary would use the `msgid` as a key to store messages. When there are two messages with the same id but a different context, the...
## Overview Description `parse_time` raises a `ValueError` when the given time format doesn't contain seconds e.g. `H:mm`. ## Steps to Reproduce ```python >>> from babel.dates import parse_time >>> parse_time('9:30', 'cs_CZ',...