How to get the _locale variable inside in a Symfony layout?

---UPDATED FROM THE COMMENTS---

As Symfony 2.1, you must use

{{ app.request.locale }}

or

{{ app.request.getLocale() }}

which returns app.request.locale if available and app.request.defaultLocale if app.request.locale is not set.


As Symfony 2.1 stores the "locale" in the Request instead of the session you have to use this:

{{ app.request.getLocale() }}

instead of app.session.locale