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
Conversation
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
…ants to use gettext.
…-Babel was not initialized.
… data, as it is being cached by pytz.
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. |
Whoops, correct. Fixing it. |
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. |
Want this feature to translate flask-admin |
+1 |
babel is initialized for that app. * Make it possible to change the default domain used within a request.
+1 |
Allow init_app to be called after package load.
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
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. |