Skip to content

Commit 38c015c

Browse files
ktheragejaviereguiluz
authored andcommitted
Clarifying LocaleSwitcher's behavior
1 parent 6556d97 commit 38c015c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

translation.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,13 @@ just to run some code. Imagine a console command that renders Twig templates
11101110
of emails in different languages. You need to change the locale only to
11111111
render those templates.
11121112

1113+
.. note::
1114+
1115+
The LocaleSwitcher will apply the locale at a request level
1116+
this means that it will be available only for that request. A
1117+
redirect, for example, will cancel the LocaleSwitcher's effect.
1118+
For a permanent locale switch between requests see https://symfony.com/doc/current/session.html#making-the-locale-sticky-during-a-user-s-session.
1119+
11131120
The ``LocaleSwitcher`` class allows you to change at once the locale
11141121
of:
11151122

0 commit comments

Comments
 (0)