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

Domains, caching, etc. #23

Closed
wants to merge 27 commits into from
Closed

Domains, caching, etc. #23

wants to merge 27 commits into from

Conversation

mrjoes
Copy link
Contributor

@mrjoes mrjoes commented Apr 11, 2012

  • Implemented localization domain support
  • If babel is not initialized, gettext/format_date/etc won't crash
  • Localization caching - won't reload translations for each and every request
  • Updated tests
  • Updated docs

@mitsuhiko
Copy link
Member

The problem I see with this is that there is cached stuff stored in the default domain. That one however gets the translations from potentially different flask applications.

The cache really has to be per application for this to work.

@mrjoes
Copy link
Contributor Author

mrjoes commented Apr 14, 2012

Whoops, correct. Fixing it.

@mrjoes
Copy link
Contributor Author

mrjoes commented Apr 14, 2012

Related question - can one Flask application have more than one Babel instance?

I doubt it can, as localizations lookup app.extensions['babel'] and only latest instance of the Babel class will be used. So, I assume translations for default domain can be cached in the Babel instance.

@ivirabyan
Copy link

Want this feature to translate flask-admin

@eyvoro
Copy link

eyvoro commented Nov 2, 2012

+1

  babel is initialized for that app.
* Make it possible to change the default domain used within a request.
@ento
Copy link

ento commented Apr 26, 2013

+1

mrjoes and others added 4 commits March 28, 2014 09:06
Fix issue about Python 3 support
* Fixes a problem with lazy_gettext and lazy_pgettext evaluating the
  domain immediately instead of lazily evaluating the domain, causing
  e.g problem when you set a default domain.
Fix lazy gettext problem with domain evaluation
@TkTech
Copy link
Contributor

TkTech commented May 5, 2016

Unfortunately based off of your master branch, making the PR overbroad and unusable. Would gladly merge a PR that implemented caching off the current codebase.

@TkTech TkTech closed this May 5, 2016
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

10 participants