Skip to content

Instantly share code, notes, and snippets.

@sineld
Created May 15, 2013 11:23
Show Gist options
  • Save sineld/5583318 to your computer and use it in GitHub Desktop.
Save sineld/5583318 to your computer and use it in GitHub Desktop.
multiLanguageL4.php
<?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