Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6818b8e

Browse files
Gerry Vandermaesenweaverryan
Gerry Vandermaesen
authored andcommitted
Avoid confusion
To me it was a bit confusing why the locale was set on the session and not the request. Further more, reading the linked article shows extra code is needed to make this work at all.Since the linked article explains in more detail how to make the locale sticky, I suggest just setting it on the request in this code sample.
1 parent34c48f1 commit6818b8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎book/translation.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ need it::
432432
$request = $event->getRequest();
433433

434434
// some logic to determine the $locale
435-
$request->getSession()->set('_locale',$locale);
435+
$request->setLocale($locale);
436436
}
437437

438438
Read:doc:`/cookbook/session/locale_sticky_session` for more on the topic.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp