Answer the question
In order to leave comments, you need to log in
How to do localization?
I do according to the guide .
If the route is like this:
Route::get('setlocale/{locale}', function ($locale) {
if (in_array($locale, \Config::get('app.locales'))) {
Session::put('locale', $locale);
}
return redirect()->back();
});
<a href="setlocale/ru">ru</a>
var_dump
, the link "mysite/setlocale/ru"
does not change the current localization to ru if (in_array($locale, Config::get('app.locales'))) {
Session::put('locale', $locale);
var_dump($locale);die;
}
returns the required localization prefixif (in_array($locale, Config::get('app.locales'))) {
Session::put('locale', $locale);
var_dump(Session::put('locale', $locale));die;
}
returns NULL Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question