summaryrefslogtreecommitdiff
path: root/babel
Commit message (Collapse)AuthorAgeFilesLines
* Improve type annotation for `babel.support.Translations.load` (#983)Aarni Koskela2023-03-021-7/+21
| | | | | | Fixes #982 Co-authored-by: Jonah Lawrence <jonah@freshidea.com>
* babel.messages.catalog: deduplicate _to_fuzzy_match_key logic (#980)Aarni Koskela2023-03-021-10/+15
|
* Merge pull request #981 from python-babel/mypy-misc-fixAarni Koskela2023-03-014-22/+27
|\ | | | | Misc. mypy-discovered fixes
| * babel.units: Fix some mypy-discovered issuesmypy-misc-fixAarni Koskela2023-03-011-9/+14
| |
| * babel.numbers: Fix some mypy-discovered issuesAarni Koskela2023-03-011-8/+6
| |
| * babel.core: Fix some mypy-discovered issuesAarni Koskela2023-03-011-4/+6
| |
| * babel.messages.jslexer: Placate mypyAarni Koskela2023-03-011-1/+1
| |
* | Note that `Locale.parse()` does not accept `None`Aarni Koskela2023-03-011-0/+9
|/ | | | Refs #977
* Add meta_zones global keyAarni Koskela2023-03-011-0/+1
|
* Become 2.12.1v2.12.1Aarni Koskela2023-02-281-1/+1
|
* Update copyright year to 2023Aarni Koskela2023-02-2819-19/+19
|
* Become 2.12.0v2.12.0Aarni Koskela2023-02-281-1/+1
|
* Renovate CI tools a bit (#972)Aarni Koskela2023-02-201-4/+4
| | | | | * Update GitHub Actions versions * Update pre-commit tools
* Turn off difflib "autojunk" heuristic in fuzzy matchingJean Abou Samra2023-02-121-1/+27
| | | | | | | | | difflib has a heuristic that used to make fuzzy matching unreliable for >200char strings. See https://github.com/python/cpython/issues/90825 Fixes #969
* In fuzzy matching, also .lower().strip() fuzzy candidatesJean Abou Samra2023-02-121-6/+9
| | | | | | | This seems intended at easing fuzzy matching with trivial edits in the msgstr (changing case and adding whitespace), but it was only done on the new msgstr, not on the old mgstr candidates, so it was possible for merging catalogs to miss messages.
* Replace babel.localedata.locale_identifiers cache with LRU cacheAarni Koskela2023-02-071-13/+10
|
* Replace babel.dates._pattern_cache with an LRU cacheAarni Koskela2023-02-071-8/+6
| | | | Fixes #962
* Type fixes from 961Jonah Lawrence2023-02-031-2/+2
|
* Numbers and core type fixesJonah Lawrence2023-02-032-42/+34
|
* Keep @modifiers when parsing locales (#947)martin f. krafft2023-01-261-31/+84
| | | | | | | | | | | | | | | | | Locale modifiers ("@variants") are described in the GNU gettext documentation like this: > The ‘@variant’ can denote any kind of characteristics that is not > already implied by the language ll and the country CC. […] It can also > denote a dialect of the language, … Wherein Babel previously would discard these, this patch stores the modifier information in the `Locale` objects, handling string representation accordingly. Resolves: #946 Signed-off-by: martin f. krafft <madduck@madduck.net> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Modernize some string formattingAarni Koskela2023-01-252-11/+7
|
* Apply some simplification fixes courtesy of RuffAarni Koskela2023-01-2510-80/+36
|
* Finally remove get_next_timezone_transition (#958)Aarni Koskela2023-01-251-116/+0
|
* Fix unbound `exc` in babel.dates (#959)Aarni Koskela2023-01-251-5/+4
| | | See https://stackoverflow.com/a/24271786/51685
* Use standard library UTC (#957)Aarni Koskela2023-01-251-5/+1
|
* Clean up babel.localtime (#952)Aarni Koskela2023-01-253-40/+57
| | | | * Remove vestigial babel.localtime cache bits * Give _FallbackLocalTimezone its own module
* Support for formatting NaN, Infinity (#955)Jonah Lawrence2023-01-251-2/+22
|
* Remove redundant tests for babel.support (#954)Aarni Koskela2023-01-201-0/+5
| | | The doctests test the exact same things.
* Adjust tests for CLDR 42Aarni Koskela2023-01-204-15/+15
| | | | | | | The space changes around English seem to be on purpose, see: * https://unicode-org.atlassian.net/browse/CLDR-14032 * https://github.com/unicode-org/cldr/commit/a83026ab8c8fa6ed88f1047c4d0c6089f88b7e5d
* Enable E741 (ambiguous variable name) lintAarni Koskela2023-01-182-4/+4
|
* Apply some small miscellaneous formatting fixesAarni Koskela2023-01-1812-19/+26
|
* Apply ruff UP (Pyupgrade) fixesAarni Koskela2023-01-181-1/+0
|
* Apply ruff UP025 (unicode literal prefix) fixAarni Koskela2023-01-186-38/+38
|
* Apply ruff I category fixesAarni Koskela2023-01-1814-39/+57
|
* Apply ruff F category fixesAarni Koskela2023-01-184-7/+7
|
* Apply ruff C category fixesAarni Koskela2023-01-181-1/+1
|
* Apply ruff B category fixesAarni Koskela2023-01-189-20/+23
|
* Ensure `path` is correctly bound for extract callback (flake8 B023)Aarni Koskela2023-01-181-19/+22
|
* Minor cleanups (#948)Aarni Koskela2023-01-1810-16/+40
| | | | | * Add __all__s to be cleaner about re-exports * Move timezone_getter to conftest * Apply spelling corrections suggested by codespell
* Unify datetime imports (#945)Aarni Koskela2023-01-189-150/+223
| | | Co-authored-by: Jonah Lawrence <jonah@freshidea.com>
* Implement zoneinfo support and make pytz optional (#940)DS/Charlie2023-01-117-96/+198
|
* Add type annotations (#934)Jonah Lawrence2023-01-1121-504/+957
| | | | | | | Refs e.g. https://github.com/python/typeshed/pull/9455 Co-authored-by: Spencer Brown <spencerb21@live.com> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Enable pre-commit (#943)Aarni Koskela2023-01-111-1/+1
| | | | | | | * Update pre-commit config syntax * CI: run pre-commit * CI: set up pip caching
* fix typo (#941)lilinjie2023-01-091-1/+1
| | | Signed-off-by: lilinjie <lilinjie@uniontech.com>
* Fix compact singular formats and patterns with no numbers (#932)Jonah Lawrence2023-01-061-6/+13
|
* Improved javascript template string expression extracting (#939)Johannes Wilm2023-01-062-8/+55
| | | | Co-authored-by: Rik <gitaarik@posteo.net> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Replace %/.format/concatenation with f-strings where feasible (#927)Aarni Koskela2022-11-2315-178/+133
| | | Original conversion suggestions via flynt, edited by hand.
* Cast number to Decimal in _get_compact_format (#930)Jonah Lawrence2022-11-231-2/+4
| | | | * fix rounding modes by using Decimal instead of float
* feat: Support for short compact currency formats (#926)Jonah Lawrence2022-11-043-6/+68
| | | | Co-authored-by: Jun Omae (大前 潤) <42682+jun66j5@users.noreply.github.com>
* Remove vestigial Python 2 `long` check (#925)Aarni Koskela2022-11-021-8/+1
|