Hi guys, I have a problem, I am making website which has several languages, the URLs of the same action are differend depending on app language selected. I have made route to change app locale and after that I want to redirect user to previuos page, but I cannot do this using Redirect::back(), since after user changed locale, the url's also changed, so I am thinking about passing additional parameter of previuos URL and before I change app locale I want to find out which action/route name represents that URL and redirect using Redirect::route() or Redirect::action(). So is there a way to know what action is behind the URL?
You don't need separate routes for multilingual sites. Suppose they change the language in a dropdown, just use some Javascript and redirect to location.pathname + '?lang=' + lang
Then perhaps at the top of the routes or in a service provider:
if (Input::get('lang') {
App::setLocale(Input::get('lang'));
});
Then use the Language files so you show the correct text.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community