Created
August 26, 2014 05:38
-
-
Save RimonEkjon/7639a6b6f2337c07b7ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://stackoverflow.com/questions/16559421/t-can-not-switch-language-in-laravel4?utm_source=laravel | |
// app/routes.php | |
Route::get('lang/{lang}', function($lang) | |
{ | |
Session::put('my.locale', $lang); | |
return Redirect::to('/'); | |
}); | |
// app/start/global.php | |
App::setLocale(Session::get('my.locale', Config::get('app.locale'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment