diff --git a/AUTHORS b/AUTHORS index 79e18d46d..920e6a4c7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,10 +9,10 @@ Babel is written and maintained by the Babel team and various contributors: - Felix Schwarz - Pedro Algarvio - Jeroen Ruigrok van der Werven +- Tomas R. - Philip Jenvey - benselme - Isaac Jurado -- Tomas R. - Tobias Bieniek - Erick Wilder - Jonah Lawrence @@ -29,12 +29,18 @@ Babel is written and maintained by the Babel team and various contributors: - Sachin Paliwal - Alex Willmer - Daniel Neuhäuser +- Maximilian Moser - Miro Hrončok - Cédric Krier - Luke Plant - Jennifer Wang - Lukas Balaga - sudheesh001 +- 陈志谦 +- Vineeth Sai Varikuntla +- Denys +- Harshit Gupta +- xmo-odoo - Jean Abou Samra - Niklas Hambüchen - Changaco @@ -50,6 +56,33 @@ Babel is written and maintained by the Babel team and various contributors: - Arturas Moskvinas - Leonardo Pistone - Hyunjun Kim +- 0718lol +- Vinodkumarreddy178 +- Parsnip37 +- Kayokoi +- Jay Hemnani +- Tanveer Singh +- Berkay Pehlivan +- agu2347 +- Bing Gao +- Christopher Krah +- Syrinx. +- Parijat Biswas +- Jeff +- Sai Asish Y +- Sreekant Baheti +- Kadir Can Ozden +- Apoorva Verma +- David Castro +- Adam Žurek +- Skytuhua +- nawaaaar +- Yushion Yang +- Himanshu Kumar +- theman6660 +- Gyanu Mayank +- Paul Bozin +- trillian - Bart Broere - Guillaume Gauvrit - clach04 @@ -123,7 +156,6 @@ Babel is written and maintained by the Babel team and various contributors: - Chris - Charly C - PTrottier -- xmo-odoo - StevenJ - Jungmo Ku - Simeon Visser diff --git a/CHANGES.rst b/CHANGES.rst index b09e184e8..df04d5a9c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,91 @@ Babel Changelog =============== +Version 2.19.0 +-------------- + +This release brings CLDR 49, new `pybabel concat` and `pybabel merge` commands, +command configuration via `pyproject.toml`, and a large number of bug fixes, +many of them from first-time contributors (and large language models). +Thank you all! + +Babel now requires Python 3.9 or newer, and is built with a PEP 517 process +using Hatch instead of the legacy setup.py. This in particular may be of interest +to downstream packagers. + +Features +~~~~~~~~ + +* Core: Accept `C` and `POSIX` in `Locale.parse` by @gyanu2507 in :gh:`1340` +* Core: Add support for other systemic aliases specified in CLDR `root.xml` by @akx in :gh:`1310` +* Core: Use CLDR 49 by @tomasr8 in :gh:`1427` (and CLDR 48.2 by @akx in :gh:`1302`) +* Dates: Add the Julian day (`g`) date pattern by @tomasr8 in :gh:`1445` +* Dates: Parse two-digit years relative to today in `parse_date` by @jayhemnani9910 in :gh:`1449` +* Dates: Support CLDR 48 relative date formats by @akx in :gh:`1306` +* Dates: Support a localized UTC alt in `get_timezone_gmt` by @tomasr8 in :gh:`1433` +* Messages: Add `pybabel concat` and `pybabel merge` commands by @soft-suroleb in :gh:`1161`, with follow-ups by @akx in :gh:`1316` +* Messages: Extract parametrized gettext calls from JavaScript files by @adaamz in :gh:`1221` +* Messages: Read default command configuration from `pyproject.toml` by @max-moser in :gh:`1290` +* Messages: Update plural rules from CLDR data by @akx in :gh:`1303` and :gh:`1309` +* Messages: Validate `msgid_plural` against `msgstr[0]` for languages with `nplurals=1` by @tomasr8 in :gh:`1198` +* Messages: Validate star width and precision arguments in Python format strings by @ice-pring in :gh:`1402` +* Messages: Warn when skipping an f-string with substitutions during extraction by @ColinHouse in :gh:`1350` +* Units: Implement long/narrow -> short fallback by @trillllian in :gh:`1225` + +Bugfixes +~~~~~~~~ + +* Core: Fix locale data corruption across locales by memoizing resolved data per instance by @akx in :gh:`1299` +* Core: Key time zone names by canonical IANA zone IDs by @akx in :gh:`1417` +* Dates: Fix `get_timezone_gmt` hour for negative fractional offsets by @vineethsaivs in :gh:`1291` +* Dates: Handle 12 AM and 12 PM correctly in `parse_time` by @simpleqt in :gh:`1366` +* Dates: Preserve fractional timedelta seconds until formatting by @nawaaaaaAaar in :gh:`1401` +* Dates: Preserve the original skeleton name in the `KeyError` raised by fuzzy `format_skeleton` by @SAY-5 in :gh:`1275` +* Dates: Raise `ParseError` instead of a bare `ValueError` from `parse_date` and `parse_time` by @binggao1230 in :gh:`1282` +* Dates: Return a location without a region when the locale has no name for it by @simpleqt in :gh:`1405` +* Dates: Truncate fractional seconds per UTS 35 instead of rounding by @vineethsaivs in :gh:`1292` +* Messages: Decode message context when reading MO files by @akx in :gh:`1305` +* Messages: Don't crash on blank `PO-Revision-Date` / `POT-Creation-Date` headers by @agu2347 in :gh:`1293` +* Messages: Fix `Catalog.is_identical` for context-specific messages by @akx in :gh:`1428` +* Messages: Fix comparisons between messages and other types by @wozhenbang2004 in :gh:`1483` +* Messages: Fix several JavaScript extraction issues: line numbers on CRLF files (@apoorva-01 in :gh:`1288`), Unicode code point escapes (@theman6660 in :gh:`1394`), vertical-tab escapes (@Dcastroro in :gh:`1409`) and source encoding in template strings (@tanveerchana in :gh:`1443`) +* Messages: Fix Python extraction of byte strings (@bysiber in :gh:`1259`) and calls within square brackets (@denyshon in :gh:`1336`) +* Messages: Keep explicitly declared plural forms without a locale by @akx in :gh:`1318` +* Messages: Preserve nonconsecutive repeated comment lines in PO files by @berkay-byte in :gh:`1348` +* Messages: Unescape the C escapes GNU gettext writes in PO files by @chrikrah in :gh:`1425` +* Numbers: Select compact decimal patterns (@Sreekant13 in :gh:`1301`) and plural forms (@0718lol in :gh:`1430`) from the rounded value +* Plural: Normalize negative inputs in generated JavaScript plural rules by @parijat1222q in :gh:`1414` +* Units: Resolve deprecated short unit identifiers through their replacements by @jdotc1 in :gh:`1408` + +Other improvements +~~~~~~~~~~~~~~~~~~ + +* Core: Cache validity of locale names by @xmo-odoo in :gh:`1254` +* Messages: Speed up MO file writing and PO location lookups by @harshitgupta31415 in :gh:`1376` and :gh:`1389` + +Deprecation and compatibility +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* General: Drop support for Python 3.8 by @akx in :gh:`1435` +* Messages: Deprecate the public functions of `babel.messages.jslexer` by @akx in :gh:`1459` + +Infrastructure and documentation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* CI: Add a benchmark suite and CodSpeed by @akx in :gh:`1300` +* CI: Add artifact attestations and GitHub draft release creation to the publish workflow by @akx in :gh:`1393` +* CI: Pin all GitHub Actions tools, including first-party ones, by @akx in :gh:`1265` +* CI: Update OS runners and PyPy versions by @tomasr8 in :gh:`1456`, :gh:`1457` and :gh:`1462` +* Docs: Document locale identifier casing and parsing by @himanshu748 in :gh:`1372` +* Docs: Extend the security policy by @akx in :gh:`1349` +* Docs: Improve documentation by @akx in :gh:`1256` +* Docs: Link, markup and typo fixes by @Skytuhua in :gh:`1412`, @tomasr8 in :gh:`1431` and :gh:`1432`, @Vinodkumarreddy178 in :gh:`1477` and @Parsnip37 in :gh:`1481` +* General: Code cleanups by @akx in :gh:`1304` and :gh:`1319` +* General: Remove the License trove classifier by @akx in :gh:`1332` +* General: Switch to PEP 517 build with Hatch by @akx in :gh:`1226` +* General: Test on and declare support for Python 3.15 by @akx in :gh:`1296` +* Tests: Test suite cleanups and fixes by @akx in :gh:`1257`, :gh:`1320` and :gh:`1322`, @denyshon in :gh:`1353` and @tomasr8 in :gh:`1455` + Version 2.18.0 -------------- diff --git a/babel/__init__.py b/babel/__init__.py index 2fd88befa..3874129bb 100644 --- a/babel/__init__.py +++ b/babel/__init__.py @@ -25,7 +25,7 @@ parse_locale, ) -__version__ = '2.18.0' +__version__ = '2.19.0' __all__ = [ 'Locale', diff --git a/scripts/dump_data.py b/scripts/dump_data.py index f054dfab8..3b3a7ccb4 100755 --- a/scripts/dump_data.py +++ b/scripts/dump_data.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/scripts/dump_global.py b/scripts/dump_global.py index 54f8de1a9..1d7573f5d 100755 --- a/scripts/dump_global.py +++ b/scripts/dump_global.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index 331b312de..c4dae2fc4 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_cli.py b/tests/messages/frontend/test_cli.py index bda034368..22d7dfcc4 100644 --- a/tests/messages/frontend/test_cli.py +++ b/tests/messages/frontend/test_cli.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_compile.py b/tests/messages/frontend/test_compile.py index 3db413dac..ccc565e14 100644 --- a/tests/messages/frontend/test_compile.py +++ b/tests/messages/frontend/test_compile.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_concat.py b/tests/messages/frontend/test_concat.py index b49fa792c..e55fbc175 100644 --- a/tests/messages/frontend/test_concat.py +++ b/tests/messages/frontend/test_concat.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_extract.py b/tests/messages/frontend/test_extract.py index 09b8d99b0..a6dfe33bf 100644 --- a/tests/messages/frontend/test_extract.py +++ b/tests/messages/frontend/test_extract.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_frontend.py b/tests/messages/frontend/test_frontend.py index 366357741..733986d8b 100644 --- a/tests/messages/frontend/test_frontend.py +++ b/tests/messages/frontend/test_frontend.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_init.py b/tests/messages/frontend/test_init.py index 2d9c2d069..c76754528 100644 --- a/tests/messages/frontend/test_init.py +++ b/tests/messages/frontend/test_init.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/frontend/test_merge.py b/tests/messages/frontend/test_merge.py index dcea0a2b6..61c98f150 100644 --- a/tests/messages/frontend/test_merge.py +++ b/tests/messages/frontend/test_merge.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_catalog.py b/tests/messages/test_catalog.py index 16a307ab6..af3e5d0cc 100644 --- a/tests/messages/test_catalog.py +++ b/tests/messages/test_catalog.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_checkers.py b/tests/messages/test_checkers.py index 01194e467..ce3ef8473 100644 --- a/tests/messages/test_checkers.py +++ b/tests/messages/test_checkers.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_extract.py b/tests/messages/test_extract.py index 4a1f8cc15..e4e63544f 100644 --- a/tests/messages/test_extract.py +++ b/tests/messages/test_extract.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_extract_python.py b/tests/messages/test_extract_python.py index be1cf970f..85c5fe861 100644 --- a/tests/messages/test_extract_python.py +++ b/tests/messages/test_extract_python.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_mofile.py b/tests/messages/test_mofile.py index e572931c2..c8f8c4de9 100644 --- a/tests/messages/test_mofile.py +++ b/tests/messages/test_mofile.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_plurals.py b/tests/messages/test_plurals.py index 8c071f8ca..ac1b60667 100644 --- a/tests/messages/test_plurals.py +++ b/tests/messages/test_plurals.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_pofile.py b/tests/messages/test_pofile.py index 00e439b7c..fdc70b36f 100644 --- a/tests/messages/test_pofile.py +++ b/tests/messages/test_pofile.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_pofile_read.py b/tests/messages/test_pofile_read.py index e1d996065..a890ac27d 100644 --- a/tests/messages/test_pofile_read.py +++ b/tests/messages/test_pofile_read.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/messages/test_pofile_write.py b/tests/messages/test_pofile_write.py index 0b6fe6ade..30b1ca3e8 100644 --- a/tests/messages/test_pofile_write.py +++ b/tests/messages/test_pofile_write.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_core.py b/tests/test_core.py index 856c5a7b8..2595d1f27 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_dates.py b/tests/test_dates.py index 76a002bc3..f8e9603c8 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_localedata.py b/tests/test_localedata.py index ab2d114bc..1cac30093 100644 --- a/tests/test_localedata.py +++ b/tests/test_localedata.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_numbers.py b/tests/test_numbers.py index c8808af01..c7fef8563 100644 --- a/tests/test_numbers.py +++ b/tests/test_numbers.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_numbers_format_decimal.py b/tests/test_numbers_format_decimal.py index b9e6387c6..a615d88fd 100644 --- a/tests/test_numbers_format_decimal.py +++ b/tests/test_numbers_format_decimal.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_numbers_parsing.py b/tests/test_numbers_parsing.py index 16eae65aa..3e7b13f62 100644 --- a/tests/test_numbers_parsing.py +++ b/tests/test_numbers_parsing.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_plural.py b/tests/test_plural.py index 94cebf6d8..0c4f91fd7 100644 --- a/tests/test_plural.py +++ b/tests/test_plural.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_plural_rule_parser.py b/tests/test_plural_rule_parser.py index 32a690148..4d64a2a22 100644 --- a/tests/test_plural_rule_parser.py +++ b/tests/test_plural_rule_parser.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which diff --git a/tests/test_util.py b/tests/test_util.py index f51626e25..3655f423a 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 Edgewall Software, 2013-2025 the Babel team +# Copyright (C) 2007-2011 Edgewall Software, 2013-2026 the Babel team # All rights reserved. # # This software is licensed as described in the file LICENSE, which