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

Fix gettext return type, re-extract Babel strings #456

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Fix gettext return type, re-extract Babel strings #456

merged 1 commit into from
Dec 14, 2023

Conversation

jace
Copy link
Member

@jace jace commented Dec 14, 2023

lazy_gettext (aliased as __) returns LazyString, which is not compatible with str and causes downstream type errors. Since it's meant to ducktype a string and works in almost all situations (notable exception: json.dumps), we re-cast __ to claim it returns str.

Baseframe was also incorrectly exporting _ and __ bound to the Baseframe translation domain.

`lazy_gettext` (aliased as `__`) returns `LazyString`, which is not compatible with `str` and causes downstream type errors. Since it's meant to ducktype a string and works in _almost_ all situations (notable exception: `json.dumps`), we re-cast `__` to claim it returns a `str`.
@jace jace merged commit 2270008 into main Dec 14, 2023
35 checks passed
@jace jace deleted the babel branch December 14, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant