|
@@ -845,6 +845,24 @@ class Request
|
|
|
$this->format = $format;
|
|
|
}
|
|
|
|
|
|
+ public function setLocale($locale)
|
|
|
+ {
|
|
|
+ if (!$this->hasSession()) {
|
|
|
+ throw new \LogicException('Forward compatibility for Request::setLocale() requires the session to be set.');
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->session->setLocale($locale);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getLocale()
|
|
|
+ {
|
|
|
+ if (!$this->hasSession()) {
|
|
|
+ throw new \LogicException('Forward compatibility for Request::getLocale() requires the session to be set.');
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->session->getLocale();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Checks whether the method is safe or not.
|
|
|
*
|