File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -380,12 +380,18 @@ gives you access to these variables:
380380``app.current_route_parameters ``
381381 An array with the parameters passed to the route of the current request or an
382382 empty array if no request is available (equivalent to ``app.request.attributes.get('_route_params') ``)
383+ ``app.locale ``
384+ The locale used in the current :ref: `locale switcher <locale-switcher >` context.
383385
384386.. versionadded :: 6.2
385387
386388 The ``app.current_route `` and ``app.current_route_parameters `` variables
387389 were introduced in Symfony 6.2.
388390
391+ .. versionadded :: 6.3
392+
393+ The ``app.locale `` variable was introduced in Symfony 6.3.
394+
389395In addition to the global ``app `` variable injected by Symfony, you can also
390396inject variables automatically to all Twig templates as explained in the next
391397section.
Original file line number Diff line number Diff line change @@ -988,6 +988,8 @@ checks translation resources for several locales:
988988 add the missing translation to the log file. For details,
989989 see :ref: `reference-framework-translator-logging `.
990990
991+ .. _locale-switcher :
992+
991993Switch Locale Programmatically
992994------------------------------
993995
You can’t perform that action at this time.
0 commit comments