Skip to content

[Translation] Clarifying LocaleSwitcher's behavior #20981

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

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
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
7 changes: 7 additions & 0 deletions translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,13 @@ just to run some code. Imagine a console command that renders Twig templates
of emails in different languages. You need to change the locale only to
render those templates.

.. note::

The LocaleSwitcher will apply the locale at a request level
this means that it will be available only for that request. A
redirect, for example, will cancel the LocaleSwitcher's effect.
For a permanent locale switch between requests see https://symfony.com/doc/current/session.html#making-the-locale-sticky-during-a-user-s-session.
Comment on lines +1115 to +1118
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The LocaleSwitcher will apply the locale at a request level
this means that it will be available only for that request. A
redirect, for example, will cancel the LocaleSwitcher's effect.
For a permanent locale switch between requests see https://symfony.com/doc/current/session.html#making-the-locale-sticky-during-a-user-s-session.
The LocaleSwitcher will apply the locale at a request level.
This means that it will be available only for that request.
A redirect, for example, will cancel the LocaleSwitcher's effect.
For a permanent locale switch between requests see https://symfony.com/doc/current/session.html#making-the-locale-sticky-during-a-user-s-session.

About the URL, can you follow the RST format for links please? (see https://github.com/symfony/symfony-docs/pull/20981/files#diff-9ee808b36fb9f3ce98827e47f96d7bf1d53c039fed97fb8364087cd629be779cR1095)


The ``LocaleSwitcher`` class allows you to change at once the locale
of:

Expand Down