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 @@ -425,13 +425,13 @@ via the ``request`` object::
425
425
$request->setLocale('en_US');
426
426
}
427
427
428
-
429
428
.. note ::
430
429
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.
435
435
436
436
.. tip ::
437
437
You can’t perform that action at this time.
0 commit comments