File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -425,13 +425,13 @@ via the ``request`` object::
425425 $request->setLocale('en_US');
426426 }
427427
428-
429428.. note ::
430429
431- Setting the locale using ``$request->setLocale() `` won't affect rendering
432- in the same action as the translator reads the request locale during the
433- kernel.request event, so changing it here would be too late. To manually
434- change translation locale in the controller use ``$this->get('translator')->setLocale() ``.
430+ Setting the locale using the ``$request->setLocale() `` method won't affect
431+ rendering in the same action. The translator locale is set during the
432+ kernel.request event. Either set the locale before the listener is called
433+ (e.g. in a custom listener) or use the ``setLocale() `` method of the
434+ ``translator `` service.
435435
436436.. tip ::
437437
You can’t perform that action at this time.
0 commit comments