You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -100,7 +101,7 @@ Once this route group is added to the routes file, a user can access all locales
100
101
101
102
If the locale is not present in the url or it is not defined in `supportedLocales`, the system will use the application default locale or the user's browser default locale (if defined in config file).
102
103
103
-
Once the locale is defined, the locale variable will be stored in a session, so it is not necessary to write the /lang/ section in the url after defining it once, using the last known locale for the user. If the user accesses to a different locale this session value would be changed, translating any other page he visits with the last chosen locale.
104
+
Once the locale is defined, the locale variable will be stored in a session (if the middleware is enabled), so it is not necessary to write the /lang/ section in the url after defining it once, using the last known locale for the user. If the user accesses to a different locale this session value would be changed, translating any other page he visits with the last chosen locale.
104
105
105
106
Template files and all locale files should follow the [Lang class](http://laravel.com/docs/5.0/localization).
106
107
@@ -165,6 +166,14 @@ If you want to hide the default locale but always show other locales in the url,
165
166
166
167
**IMPORTANT** - When `hideDefaultLocaleInURL` is set to true, the unlocalized root is treated as the applications default locale `app.locale`. Because of this language negotiation using the Accept-Language header will **NEVER** occur when `hideDefaultLocaleInURL` is true.
167
168
169
+
### Sessions
170
+
171
+
In version 1.0.7 a new middleware to control session storage has been added. I have created it because Laravel 5 changed the order for calls and you cannot access to the session from a function called from 'prefix'.
172
+
173
+
To use it just add `Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect` to the Middleware list, it will automatically store and redirect users to the locale stored in the session.
174
+
175
+
Just a reminder, old config values like `useSessionLocale` and `useCookieLocale` will be ignored.
176
+
168
177
## Helpers
169
178
170
179
This package comes with some useful functions, like:
@@ -490,10 +499,6 @@ For example, editing the default config service provider that Laravel loads when
0 commit comments