Middleware

class django_babel.middleware.LocaleMiddleware(get_response=None)[source]

Simple Django middleware that makes available a Babel Locale object via the request.locale attribute.

django_babel.middleware.get_current_locale()[source]

Get current locale data outside views.

See http://babel.pocoo.org/en/stable/api/core.html#babel.core.Locale for Locale objects documentation