]> git.ipfire.org Git - thirdparty/babel.git/log
thirdparty/babel.git
4 weeks agoOptimizations for read_po (#1200) master
Aarni Koskela [Sat, 5 Apr 2025 15:21:04 +0000 (18:21 +0300)] 
Optimizations for read_po (#1200)

* Avoid extra casts (`Message()` takes care of those)

* Optimize empty normalized strings

* Don't sort translations unless plural

* Optimize unescape()

* Optimize line processing

* Optimize keyword parsing

* Optimize comment parsing

* Avoid hot `isinstance`ing in PO file parse loop

* Add fast paths in `python_format` and `python_brace_format`

* Inline distincting in `catalog.py`

7 weeks agoUse standard library `timezone` instead of `FixedOffsetTimezone` (#1203)
Aarni Koskela [Fri, 21 Mar 2025 06:18:16 +0000 (08:18 +0200)] 
Use standard library `timezone` instead of `FixedOffsetTimezone` (#1203)

7 weeks agoImprove handling of no-inheritance-marker in timezone data (#1194)
Aarni Koskela [Mon, 17 Mar 2025 13:05:00 +0000 (15:05 +0200)] 
Improve handling of no-inheritance-marker in timezone data (#1194)

* Add icu4c-tools

* Improve handling of no-inheritance-marker in timezone data

Fixes #1192 (but uncovers another bug)

2 months agoCheck all plurals in python format checker (#1188)
Tomas R. [Fri, 7 Mar 2025 14:53:51 +0000 (15:53 +0100)] 
Check all plurals in python format checker (#1188)

2 months agoMark PyPy test failing in CI as xfail (#1197)
Aarni Koskela [Wed, 5 Mar 2025 07:18:05 +0000 (09:18 +0200)] 
Mark PyPy test failing in CI as xfail (#1197)

2 months agoUpdate dates.rst with current unicode.org tr35 link (#1189)
clach04 [Wed, 5 Mar 2025 07:17:06 +0000 (23:17 -0800)] 
Update dates.rst with current unicode.org tr35 link (#1189)

2 months agoTry to fix PyPy CI flake
Aarni Koskela [Wed, 5 Mar 2025 06:56:51 +0000 (08:56 +0200)] 
Try to fix PyPy CI flake

3 months agoMove pytest config to pyproject.toml (#1187)
Tomas R. [Wed, 5 Feb 2025 09:33:01 +0000 (10:33 +0100)] 
Move pytest config to pyproject.toml (#1187)

3 months agoAdd more classifiers (#1186)
Tomas R. [Wed, 5 Feb 2025 09:31:58 +0000 (10:31 +0100)] 
Add more classifiers (#1186)

3 months agoAvoid unnecessary uses of `map()` (#1180)
Aarni Koskela [Wed, 5 Feb 2025 08:41:58 +0000 (10:41 +0200)] 
Avoid unnecessary uses of `map()` (#1180)

3 months agoFix formatting for "Empty locale identifier" exception added in #1164 (#1184)
Aarni Koskela [Mon, 3 Feb 2025 09:06:48 +0000 (11:06 +0200)] 
Fix formatting for "Empty locale identifier" exception added in #1164 (#1184)

3 months agoPrepare for 2.17.0 (#1182) v2.17.0
Aarni Koskela [Sat, 1 Feb 2025 15:13:46 +0000 (17:13 +0200)] 
Prepare for 2.17.0 (#1182)

* Update authors
* Update changelog
* Update copyright dates
* Update version

3 months agoIncrease test coverage of the `python_format` checker (#1176)
Tomas R. [Fri, 31 Jan 2025 13:23:34 +0000 (14:23 +0100)] 
Increase test coverage of the `python_format` checker (#1176)

3 months agoFix dates formatting `Y`, `w` and `W` symbols for week-numbering (#1179)
Jun Omae (大前 潤) [Fri, 31 Jan 2025 13:22:06 +0000 (22:22 +0900)] 
Fix dates formatting `Y`, `w` and `W` symbols for week-numbering (#1179)

3 months agoMerge pull request #1173 from python-babel/lc-monetary-2
Aarni Koskela [Wed, 29 Jan 2025 08:06:34 +0000 (10:06 +0200)] 
Merge pull request #1173 from python-babel/lc-monetary-2

Prefer LC_MONETARY when formatting currencies

3 months agoPrefer LC_MONETARY when formatting currency lc-monetary-2 1173/head
Aarni Koskela [Thu, 21 Dec 2023 23:42:55 +0000 (00:42 +0100)] 
Prefer LC_MONETARY when formatting currency

Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
3 months ago`default_locale`: support multiple keys
Aarni Koskela [Tue, 14 Jan 2025 14:32:22 +0000 (16:32 +0200)] 
`default_locale`: support multiple keys

Also ignore falsy values in `default_locale` args.

3 months agoImport `Literal` & `TypedDict` from the typing module (#1175)
Tomas R. [Sat, 25 Jan 2025 08:48:00 +0000 (09:48 +0100)] 
Import `Literal` & `TypedDict` from the typing module (#1175)

* Import 'Literal' from the typing module
* Import 'TypedDict' from the typing module

3 months agoAdd basic support for `Message.python_brace_format` (#1169)
Tomas R. [Thu, 16 Jan 2025 11:09:32 +0000 (12:09 +0100)] 
Add basic support for `Message.python_brace_format` (#1169)

3 months agoSmall test cleanup (#1172)
Aarni Koskela [Wed, 15 Jan 2025 13:01:58 +0000 (15:01 +0200)] 
Small test cleanup (#1172)

* Configure Ruff formatter to preserve quotes for now
* Split support functionality tests to a separate modules
* Use standard `monkeypatch` fixture for `os.environ` patching
* Use even more `monkeypatch` for patching

---------

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
3 months agoMerge pull request #1170 from python-babel/small-cleanup
Aarni Koskela [Tue, 14 Jan 2025 13:56:19 +0000 (15:56 +0200)] 
Merge pull request #1170 from python-babel/small-cleanup

Small cleanups

3 months agoAdd test to cover `force_text` fully small-cleanup 1170/head
Aarni Koskela [Tue, 14 Jan 2025 07:52:14 +0000 (09:52 +0200)] 
Add test to cover `force_text` fully

3 months agoRefresh docs for extraction method registration
Aarni Koskela [Mon, 13 Jan 2025 11:49:30 +0000 (13:49 +0200)] 
Refresh docs for extraction method registration

3 months agoReplace dead or insecure links
Aarni Koskela [Mon, 13 Jan 2025 11:40:23 +0000 (13:40 +0200)] 
Replace dead or insecure links

3 months agoUn-shadow types in `support`
Aarni Koskela [Mon, 13 Jan 2025 11:38:46 +0000 (13:38 +0200)] 
Un-shadow types in `support`

3 months agoApply minor simplifications
Aarni Koskela [Mon, 13 Jan 2025 11:54:56 +0000 (13:54 +0200)] 
Apply minor simplifications

3 months agoFix minor pep8 complaints
Aarni Koskela [Mon, 13 Jan 2025 11:28:58 +0000 (13:28 +0200)] 
Fix minor pep8 complaints

3 months agoSimplify `Catalog._get_mime_headers()`
Aarni Koskela [Mon, 13 Jan 2025 11:25:41 +0000 (13:25 +0200)] 
Simplify `Catalog._get_mime_headers()`

3 months agoMake `_force_text` a free function
Aarni Koskela [Mon, 13 Jan 2025 11:20:52 +0000 (13:20 +0200)] 
Make `_force_text` a free function

3 months agoBe less fancy in `_PluralTuple`
Aarni Koskela [Mon, 13 Jan 2025 11:18:34 +0000 (13:18 +0200)] 
Be less fancy in `_PluralTuple`

3 months agoFix up some docstrings
Aarni Koskela [Mon, 13 Jan 2025 11:16:18 +0000 (13:16 +0200)] 
Fix up some docstrings

3 months agoEnsure imported names are in __all__; sort __all__s
Aarni Koskela [Mon, 13 Jan 2025 11:10:48 +0000 (13:10 +0200)] 
Ensure imported names are in __all__; sort __all__s

3 months agoUpgrade Ruff
Aarni Koskela [Mon, 13 Jan 2025 11:10:02 +0000 (13:10 +0200)] 
Upgrade Ruff

3 months agoRemove redundant assignment (#1167)
Tomas R. [Mon, 13 Jan 2025 11:50:16 +0000 (12:50 +0100)] 
Remove redundant assignment (#1167)

3 months agoStrip extra leading slashes in `/etc/localtime` (#1165)
Aarni Koskela [Fri, 10 Jan 2025 06:17:02 +0000 (08:17 +0200)] 
Strip extra leading slashes in `/etc/localtime` (#1165)

* Strip extra leading slashes in `/etc/localtime`

Fixes #990

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
3 months agoUse `pytest.raises(match=...)` (#1166)
Aarni Koskela [Thu, 9 Jan 2025 12:44:36 +0000 (14:44 +0200)] 
Use `pytest.raises(match=...)` (#1166)

3 months agoMerge pull request #1164 from python-babel/locale-none
Aarni Koskela [Thu, 9 Jan 2025 12:41:38 +0000 (14:41 +0200)] 
Merge pull request #1164 from python-babel/locale-none

Improve handling for `locale=None`

3 months agoMark `babel.lists.DEFAULT_LOCALE` as deprecated 1164/head
Aarni Koskela [Thu, 9 Jan 2025 08:30:09 +0000 (10:30 +0200)] 
Mark `babel.lists.DEFAULT_LOCALE` as deprecated

3 months agoUnify `str | Locale | None` to `Locale | str | None`
Aarni Koskela [Wed, 8 Jan 2025 14:23:08 +0000 (16:23 +0200)] 
Unify `str | Locale | None` to `Locale | str | None`

3 months agoRaise a more specific error if `Locale.parse()` is passed an empty value
Aarni Koskela [Wed, 8 Jan 2025 13:37:19 +0000 (15:37 +0200)] 
Raise a more specific error if `Locale.parse()` is passed an empty value

3 months agoDefer lookups of default locale values
Aarni Koskela [Wed, 8 Jan 2025 13:52:53 +0000 (15:52 +0200)] 
Defer lookups of default locale values

3 months agoRemove defaults from internal `_format_currency_long_name`'s args; remove unused arg
Aarni Koskela [Wed, 8 Jan 2025 13:57:55 +0000 (15:57 +0200)] 
Remove defaults from internal `_format_currency_long_name`'s args; remove unused arg

3 months agoSupport short and narrow formats for format_timedelta(..., add_direction=True) (...
Aarni Koskela [Wed, 8 Jan 2025 13:16:10 +0000 (15:16 +0200)] 
Support short and narrow formats for format_timedelta(..., add_direction=True) (#1163)

Fixes #1162

4 months agoAdd tzdata as dev dependency; move dev deps to pyproject.toml (#1159)
wandrew004 [Wed, 8 Jan 2025 12:37:54 +0000 (07:37 -0500)] 
Add tzdata as dev dependency; move dev deps to pyproject.toml (#1159)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
4 months agoPrevent wrapping file locations containing white space (#1120)
Tomas R. [Tue, 10 Dec 2024 06:50:13 +0000 (07:50 +0100)] 
Prevent wrapping file locations containing white space (#1120)

Co-authored-by: Aarni Koskela <akx@iki.fi>
4 months agofix(extract): use the first matching method and options (#1121)
James McKinney [Mon, 9 Dec 2024 14:39:49 +0000 (09:39 -0500)] 
fix(extract): use the first matching method and options (#1121)

... instead of the first matching method and last matching options.

Co-authored-by: Aarni Koskela <akx@iki.fi>
4 months agoBump CI/tool versions (#1160)
Aarni Koskela [Mon, 9 Dec 2024 13:47:43 +0000 (15:47 +0200)] 
Bump CI/tool versions (#1160)

* CI: use Ubuntu 24.04 and macOS 14 for tests
* CI: update codecov-action version
* Update lint tools; fix issues

4 months agoSimplify read_mo logic (#1148)
Tomas R. [Mon, 9 Dec 2024 12:35:24 +0000 (13:35 +0100)] 
Simplify read_mo logic (#1148)

4 months agoAllow specifying an explicit format in parse_date/parse_time (#1131)
Tomas R. [Mon, 9 Dec 2024 12:11:12 +0000 (13:11 +0100)] 
Allow specifying an explicit format in parse_date/parse_time (#1131)

* Allow specifying an explicit format in parse_date/parse_time

* Improve docstring

4 months agoAdjust docs/conf.py to add compatibility with sphinx 8 (#1155)
Tomáš Hrnčiar [Mon, 9 Dec 2024 12:05:34 +0000 (13:05 +0100)] 
Adjust docs/conf.py to add compatibility with sphinx 8 (#1155)

Fixes: #1143
4 months agoUpdate CI to use Python 3.13 and Ubuntu 24.04 (#1153)
Tomas R. [Mon, 9 Dec 2024 12:03:12 +0000 (13:03 +0100)] 
Update CI to use Python 3.13 and Ubuntu 24.04 (#1153)

5 months agoUse CLDR 46 (#1145)
Tomas R. [Fri, 15 Nov 2024 12:23:05 +0000 (13:23 +0100)] 
Use CLDR 46 (#1145)

* Use CLDR 46

* Update checksum

* Add tests for units

* Add a test for alt='official'

* Fix formatting

5 months agoReplace OrderedDict with just dict (#1149)
Tomas R. [Sun, 10 Nov 2024 20:39:04 +0000 (21:39 +0100)] 
Replace OrderedDict with just dict (#1149)

6 months agoFix the way obsolete messages are stored (#1132)
Tomas R. [Sun, 20 Oct 2024 06:54:27 +0000 (08:54 +0200)] 
Fix the way obsolete messages are stored (#1132)

6 months agoMark `wraptext` deprecated; use `TextWrapper` directly in `write_po` (#1140)
Aarni Koskela [Sun, 20 Oct 2024 06:52:07 +0000 (09:52 +0300)] 
Mark `wraptext` deprecated; use `TextWrapper` directly in `write_po` (#1140)

* Mark `wraptext` deprecated; use `TextWrapper` directly in `write_po`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
6 months agoMake seconds optional in `parse_time` time formats (#1141)
Tomas R. [Sun, 20 Oct 2024 06:50:36 +0000 (08:50 +0200)] 
Make seconds optional in `parse_time` time formats (#1141)

6 months agoPO files: Consider a message without a translation to have an empty translation ...
Gabe Sherman [Sat, 19 Oct 2024 12:33:39 +0000 (06:33 -0600)] 
PO files: Consider a message without a translation to have an empty translation (#1135)

Fixes an index out of bounds error in add_message.

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
6 months agoDelete duplicate code in test (#1138)
mattdiaz007 [Sat, 19 Oct 2024 12:21:51 +0000 (08:21 -0400)] 
Delete duplicate code in test (#1138)

6 months agoFix extracted lineno with nested calls (#1126)
Dylan Kiss [Sat, 19 Oct 2024 12:17:36 +0000 (14:17 +0200)] 
Fix extracted lineno with nested calls (#1126)

When a gettext call had a nested function call on a new line, the
extract function would use that nested call's line number when
extracting the terms for the gettext call.

The reason is that we set the line number on any encounter of an opening
parenthesis after a gettext keyword. This does not work if either we
have a nested call, or our first term starts on a new line.

This commit fixes that by only setting the line number when we encounter
the first argument inside a gettext call.

Existing tests were adapted to work according to `xgettext` with regards
to the line numbers.

Fixes https://github.com/python-babel/babel/issues/1123

6 months agoReplace more alternate characters in format_skeleton (#1122)
Tomas R. [Sat, 19 Oct 2024 12:12:50 +0000 (14:12 +0200)] 
Replace more alternate characters in format_skeleton (#1122)

Replaces some additional characters which never appear in resource files before matching the skeleton. This replicates the behaviour of ICU.

6 months agoBugfix: Replace str.index with str.find (#1130)
Tomas R. [Sat, 19 Oct 2024 12:01:58 +0000 (14:01 +0200)] 
Bugfix: Replace str.index with str.find (#1130)

8 months agoEnclose white spaces in references (#1105) 1062/head
Daniel Roschka [Wed, 4 Sep 2024 15:58:12 +0000 (17:58 +0200)] 
Enclose white spaces in references (#1105)

Since version 0.22 gettext encloses file names in references which
contain white spaces or tabs within First Strong Isolate (U+2068) and
Pop Directional Isolate (U+2069). This commit adds the same behavior for
Babel.

8 months agoFix deprecation warnings for datetime.utcnow() (#1119)
Tomas R [Wed, 28 Aug 2024 09:39:46 +0000 (11:39 +0200)] 
Fix deprecation warnings for datetime.utcnow() (#1119)

9 months agoPrepare for 2.16.0 release (#1116) v2.16.0
Aarni Koskela [Thu, 8 Aug 2024 12:45:14 +0000 (15:45 +0300)] 
Prepare for 2.16.0 release (#1116)

9 months agoInitial support for reading mapping configuration as TOML (#1108)
Aarni Koskela [Wed, 7 Aug 2024 09:46:55 +0000 (12:46 +0300)] 
Initial support for reading mapping configuration as TOML (#1108)

* Rename parse_mapping to parse_mapping_cfg and remove duplicated test
* Add initial support for TOML mapping configuration (prefer tomllib to tomli)

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
9 months agoTwo hyperlinks (to CLDR) and some typos (#1115)
buhtz [Wed, 7 Aug 2024 08:20:28 +0000 (10:20 +0200)] 
Two hyperlinks (to CLDR) and some typos (#1115)

9 months agoDo not allow substituting alternates or drafts in derived locales (#1113)
Aarni Koskela [Wed, 7 Aug 2024 08:14:34 +0000 (11:14 +0300)] 
Do not allow substituting alternates or drafts in derived locales (#1113)

* download_import_cldr.py: pass remaining arguments through to import_cldr

* Do not allow substituting alternates or drafts in derived locales

For more coverage, we've allowed using alternate or draft values
when no officially accepted values have been present.

However, non-global (i.e. e.g. `de_CH` locales) may have an alternate
spelling for what would be an alternate in the parent locale (and
that alternate hasn't been imported into the parent), and the import
would have then accepted the alternate from the child locale as a
non-alternate.

Refs #1112

9 months agoNormalize package name to lower-case in setup.py (#1110)
Aarni Koskela [Mon, 5 Aug 2024 15:11:10 +0000 (18:11 +0300)] 
Normalize package name to lower-case in setup.py (#1110)

Fixes #1109.

9 months agoTest on Python 3.13 beta releases (#1107)
Aarni Koskela [Thu, 25 Jul 2024 11:25:02 +0000 (14:25 +0300)] 
Test on Python 3.13 beta releases (#1107)

* Test on Python 3.13 beta releases

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
9 months agoAllow use of importlib.metadata for finding entrypoints (#1102)
Aarni Koskela [Thu, 25 Jul 2024 09:51:43 +0000 (12:51 +0300)] 
Allow use of importlib.metadata for finding entrypoints (#1102)

* Support importlib.metadata for finding entrypoints
* Add a basic interoperability test for Jinja2 extraction
* Only use importlib.metadata on Python 3.10+

Co-authored-by: podgorniy94 <podgorniy.inc@gmail.com>
9 months agoAllow falling back to modifier-less locale data when modified data is missing (#1104)
Aarni Koskela [Thu, 25 Jul 2024 09:38:57 +0000 (12:38 +0300)] 
Allow falling back to modifier-less locale data when modified data is missing (#1104)

IOW, e.g. the data loaded by `ja_JP@mod` is `ja_JP` in the absence of data that would have the modifier present.

Fixes #1089

9 months agoImprove docs for `format_skeleton` (#1106)
Tomas R [Thu, 25 Jul 2024 09:34:35 +0000 (11:34 +0200)] 
Improve docs for `format_skeleton` (#1106)

Makes it explicit that even when using fuzzy=True, the function can still raise if there are no suitable formats that match the skeleton.

9 months agoAllow parsing .po files that have an extant but empty Language header (#1101)
Aarni Koskela [Tue, 23 Jul 2024 16:28:59 +0000 (19:28 +0300)] 
Allow parsing .po files that have an extant but empty Language header (#1101)

Fixes #1087

9 months agoAvoid crashing on importing `babel.localtime` when TZ envvar is malformed (#1100)
Aarni Koskela [Tue, 23 Jul 2024 07:10:08 +0000 (10:10 +0300)] 
Avoid crashing on importing `babel.localtime` when TZ envvar is malformed (#1100)

When `pytz` is _not_ installed, importing `babel.localtime` could fail
(repeatedly) when the `TZ` environment variable is malformed enough to be
caught by `_validate_tzfile_path`, which might throw a certain `ValueError`.

(When `pytz` is installed, it would raise an `UnknownTimeZoneError` we
already catch and ignore for the same sort of input.)

Fixes #1092

9 months agoImprove Codecov configuration (#1103)
Aarni Koskela [Thu, 18 Jul 2024 09:07:02 +0000 (12:07 +0300)] 
Improve Codecov configuration (#1103)

9 months agoMerge pull request #1099 from python-babel/issue-1098
Aarni Koskela [Mon, 15 Jul 2024 12:05:41 +0000 (15:05 +0300)] 
Merge pull request #1099 from python-babel/issue-1098

Support list format fallbacks

9 months agoSupport list format fallbacks issue-1098 1099/head
Aarni Koskela [Thu, 11 Jul 2024 11:54:16 +0000 (14:54 +0300)] 
Support list format fallbacks

9 months agoDo not import list patterns that have no parts
Aarni Koskela [Thu, 11 Jul 2024 11:06:02 +0000 (14:06 +0300)] 
Do not import list patterns that have no parts

9 months agoUse conventional parametrize in list tests
Aarni Koskela [Thu, 11 Jul 2024 10:43:22 +0000 (13:43 +0300)] 
Use conventional parametrize in list tests

9 months agoImprove test for ignore_dirs (#1052)
Bohdan Malomuzh [Thu, 11 Jul 2024 06:30:06 +0000 (09:30 +0300)] 
Improve test for ignore_dirs (#1052)

Adds multiple value for proper test.

Follows up on #832

9 months agoMake pgettext search plurals when translation is not found (#1085)
Tomas R [Thu, 11 Jul 2024 06:11:04 +0000 (08:11 +0200)] 
Make pgettext search plurals when translation is not found (#1085)

pgettext can now find the following translation
when using `pgettext("ctx", "foo")`:
```
msgctxt "ctx"
msgid "foo"
msgid_plural "foos"
msgstr[0] "foo translated"
```

The upstream CPython PR is  https://github.com/python/cpython/pull/107118

9 months agoUpgrade to CLDR 45 (#1077)
Tomas R [Thu, 11 Jul 2024 06:10:19 +0000 (08:10 +0200)] 
Upgrade to CLDR 45 (#1077)

* Upgrade to CLDR 45

* Handle 'localeRules="nonlikelyScript"' for parent locales

Locales of the form 'lang_Script' where 'Script' is not the
likely script for 'lang' should have 'root' as their parent
locale. For example, the parent of 'az_Arab' should not be
computed as 'az' by truncating from the end, but should be
'root' instead as 'Arab' is not the likely script for 'az'.

The list of such languages was previously specified using
an explicit 'locales' attribute. It is now handled dynamically
using the new 'localeRules' attribute.

9 months agoUpgrade pre-commit tools, fix ruff issues
Aarni Koskela [Thu, 11 Jul 2024 05:53:43 +0000 (08:53 +0300)] 
Upgrade pre-commit tools, fix ruff issues

9 months agoCI: use macos-12, not macos-11 (which is gone)
Aarni Koskela [Thu, 11 Jul 2024 05:49:37 +0000 (08:49 +0300)] 
CI: use macos-12, not macos-11 (which is gone)

9 months agoFix ignore-dirs issue (#1094) (#1095)
Leonid [Wed, 10 Jul 2024 15:07:14 +0000 (18:07 +0300)] 
Fix ignore-dirs issue (#1094) (#1095)

11 months agoReplace deprecated 'ast.Str' with 'ast.Constant' (#1083)
Tomas R [Mon, 13 May 2024 13:40:32 +0000 (15:40 +0200)] 
Replace deprecated 'ast.Str' with 'ast.Constant' (#1083)

12 months agoUpgrade GitHub Actions versions to avoid deprecation warnings (#1080)
Aarni Koskela [Sun, 5 May 2024 14:13:26 +0000 (17:13 +0300)] 
Upgrade GitHub Actions versions to avoid deprecation warnings (#1080)

12 months agoPrepare for 2.15.0 release (#1079) v2.15.0
Aarni Koskela [Sun, 5 May 2024 13:48:29 +0000 (16:48 +0300)] 
Prepare for 2.15.0 release (#1079)

12 months agoEncode support for the "fall back to short format" logic for time delta formatting...
Aarni Koskela [Thu, 25 Apr 2024 18:23:10 +0000 (21:23 +0300)] 
Encode support for the "fall back to short format" logic for time delta formatting (#1075)

Fixes #892

12 months agoInclude Unicode license in `locale-data` and in documentation (#1074)
Aarni Koskela [Mon, 22 Apr 2024 06:54:14 +0000 (09:54 +0300)] 
Include Unicode license in `locale-data` and in documentation (#1074)

Fixes #1072

12 months agoAllow alternative space characters as group separator when parsing numbers (#1007)
Ronan Amicel [Mon, 22 Apr 2024 06:53:54 +0000 (08:53 +0200)] 
Allow alternative space characters as group separator when parsing numbers (#1007)

The French group separator is `"\u202f"` (narrow non-breaking space),
but when parsing numbers in the real world, you will most often encounter
either a regular space character (`" "`) or a non-breaking space character
(`"\xa0"`).

The issue was partially adressed earlier in https://github.com/python-babel/babel/issues/637,
but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in
`parse_decimal`.

This commit goes further by changing both `parse_number` and `parse_decimal`
to allow certain other space characters when the group character is itself a space character,
but is not present in the string to parse.

Unit tests are included.

12 months agoUse CLDR 44 and adjust tests to match new data (#1071)
Aarni Koskela [Tue, 16 Apr 2024 06:23:55 +0000 (09:23 +0300)] 
Use CLDR 44 and adjust tests to match new data (#1071)

13 months agoImprove .po IO (#1068)
Aarni Koskela [Wed, 27 Mar 2024 15:46:53 +0000 (17:46 +0200)] 
Improve .po IO (#1068)

* read_po: note interface also supports iterable-of-strings, not a filelike

* write_po: refactor into generate_po

16 months agoUpgrade GitHub Actions (#1054)
Christian Clauss [Tue, 26 Dec 2023 19:50:18 +0000 (20:50 +0100)] 
Upgrade GitHub Actions (#1054)

16 months agoDrop support for Python 3.7 (EOL since June 2023) (#1048)
Aarni Koskela [Wed, 13 Dec 2023 11:28:43 +0000 (13:28 +0200)] 
Drop support for Python 3.7 (EOL since June 2023) (#1048)

16 months agoPrepare for 2.14.0 release (#1047) v2.14.0
Aarni Koskela [Tue, 12 Dec 2023 13:19:43 +0000 (15:19 +0200)] 
Prepare for 2.14.0 release (#1047)

17 months agoImprove parsing of malformed decimals (#1042)
Best Olunusi [Tue, 28 Nov 2023 09:44:05 +0000 (04:44 -0500)] 
Improve parsing of malformed decimals (#1042)

Signed-off-by: Olunusi Best <olunusibest@gmail.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
17 months agoAdd support for non-Latin numbering systems for number symbols (#1036)
Teo [Tue, 28 Nov 2023 09:18:50 +0000 (11:18 +0200)] 
Add support for non-Latin numbering systems for number symbols (#1036)

- Import number symbols for available numbering systems from cldr data
- Add default_numbering_system  and other_numbering_systems properties for Locale
- Add numbering_system argument to relevant number formatting fuctions and use number symbols based on the given numbering system

Refs https://github.com/python-babel/babel/issues/446

Co-authored-by: Aarni Koskela <akx@iki.fi>
17 months agoAllow last_translator to be passed as an option to extract_message (#1044)
Ivan Koldakov [Tue, 28 Nov 2023 08:45:14 +0000 (09:45 +0100)] 
Allow last_translator to be passed as an option to extract_message (#1044)

Co-authored-by: Ivan Koldakov <ivan@koldakov.com>
17 months agoCI: use GitHub output formats (#1046)
Aarni Koskela [Mon, 27 Nov 2023 14:37:36 +0000 (16:37 +0200)] 
CI: use GitHub output formats (#1046)

* CI: use GitHub output format for Ruff

* CI: use pytest-github-actions-annotate-failures too