Configuration#
To get started all you need to do is to instanciate a Babel
object after configuring the application:
.. code-block:: python
from quart import Quart from quart_babel import Babel
app = Quart(__name__) app.config.from_pyfile(‘mysettings.cfg’) babel = Babel(app)
You can also use the factory method of initializing extensions:
babel.init_app(app)
The Babel object iteself can be used to to change some internal defaults.
Variable |
Type |
Default |
Description |
---|---|---|---|
BABEL_DEFAULT_LOCALE |
|
|
The default locale to use if no locale selector is registered. |
BABEL_DEFAULT_TIMEZONE |
|
|
The timezone to use for user facing dates. |
BABEL_CONFIGURE_JINJA |
|
|
If set to |
BABEL_DOMAIN |
|
|
The default translation domain. |