a Symfony Product

The PHP micro-framework
based on the Symfony Components

Silex is in maintenance mode. Ends of life is set to June 2018.
Use Symfony 4 instead. Read more on Symfony's blog.
You are reading the documentation for Silex 2.0. Switch to the documentation for Silex 1.3.

Questions & Feedback


Creative Commons License Silex documentation is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.


The LocaleServiceProvider manages the locale of an application.


  • locale: The locale of the user. When set before any request handling, it defines the default locale (en by default). When a request is being handled, it is automatically set according to the _locale request attribute of the current route.


  • n/a


$app->register(new Silex\Provider\LocaleServiceProvider());
Website powered by Symfony and Twig, deployed on
The Silex logo is © 2010-2019 Symfony