Skip to content

Commit 66726a7

Browse files
committed
[Routing] Initialize router.request_context's _locale parameter to %kernel.default_locale%
1 parent 0146da1 commit 66726a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

routing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,6 +2833,18 @@ Now you'll get the expected results when generating URLs in your commands::
28332833
value, but you can change it with the ``asset.request_context.base_path``
28342834
and ``asset.request_context.secure`` container parameters.
28352835

2836+
.. note::
2837+
2838+
By default, routes generated outside the HTTP context use the
2839+
:ref:`default locale <config-framework-default_locale>` as the value of the
2840+
``_locale`` parameter. You can override this by providing a different value
2841+
for the ``_locale`` parameter when generating each route.
2842+
2843+
.. versionadded:: 7.4
2844+
2845+
The default locale is used as the value of the ``_locale`` parameter
2846+
starting from Symfony 7.4.
2847+
28362848
Checking if a Route Exists
28372849
~~~~~~~~~~~~~~~~~~~~~~~~~~
28382850

0 commit comments

Comments
 (0)