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

Appearance settings

Commit 9db055c

Browse filesBrowse files
committed
minor #6472 Avoid confusion (gerryvdm)
This PR was submitted for the 3.0 branch but it was merged into the 2.3 branch instead (closes #6472). Discussion ---------- 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. Commits ------- 6818b8e Avoid confusion
2 parents 34c48f1 + 6818b8e commit 9db055c
Copy full SHA for 9db055c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎book/translation.rst

Copy file name to clipboardExpand all lines: book/translation.rst
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.