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

Lazy_gettext in i18nMiddleware have enable_cache=False by default #203

Merged
merged 1 commit into from Oct 2, 2019
Merged

Lazy_gettext in i18nMiddleware have enable_cache=False by default #203

merged 1 commit into from Oct 2, 2019

Conversation

Birdi7
Copy link
Contributor

@Birdi7 Birdi7 commented Aug 31, 2019

Description

It fixes the issue when different invocations of the same LazyProxy object generated by lazy_gettext("some_msg") results in different text for different locales, as when enable_cache=True, the first text will be cached in the state of the object, so it will be returned on every next invocation. The behavior isn't intuitive and can be considered as a bug.
Here is the links which provide more information: 1, 2

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@JrooTJunior JrooTJunior merged commit d92a77d into aiogram:dev-2.x Oct 2, 2019
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.

None yet

2 participants