Skip to content

Commit 5fdca73

Browse files
committed
minor #21504 [Routing] Initialize router.request_context's _locale parameter to %kernel.default_locale% (javiereguiluz)
This PR was merged into the 7.4 branch. Discussion ---------- [Routing] Initialize router.request_context's _locale parameter to %kernel.default_locale% Fixes #21492 Commits ------- 66726a7 [Routing] Initialize router.request_context's _locale parameter to %kernel.default_locale%
2 parents 4e9720f + 66726a7 commit 5fdca73

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)