8000 Rebase of #4989 by weaverryan · Pull Request #5099 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Rebase of #4989 #5099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update translation.rst
Clarify that changing the locale in the controller would not affect template rendering as the translator reads the request locale during the kernel.request event.
  • Loading branch information
solazs authored and weaverryan committed Mar 20, 2015
commit af469236a27e314f8a77493bbab4b51f783f5701
8 changes: 8 additions & 0 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,14 @@ via the ``request`` object::

$request->setLocale('en_US');
}


.. note::

Setting the locale using ``$request->setLocale()`` won't affect rendering
in the same action as the translator reads the request locale during the
kernel.request event, so changing it here would be too late. To manually
change translation locale in the controller use ``$this->get('translator')->setLocale()``.

.. tip::

Expand Down
0