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