langswitch
This commit is contained in:
parent
ad42e73126
commit
8d91d0e7a8
14 changed files with 792 additions and 76 deletions
42
app/Http/Controllers/Frontend/LocalizationController.php
Normal file
42
app/Http/Controllers/Frontend/LocalizationController.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Frontend;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Session;
|
||||
use App;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class LocalizationController extends Controller
|
||||
{
|
||||
|
||||
// public function index(Request $request,$locale){
|
||||
// //set’s application’s locale
|
||||
// app()->setLocale($locale);
|
||||
|
||||
// //Gets the translated message and displays it
|
||||
// echo trans('lang.msg');
|
||||
// }
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('localization.index');
|
||||
}
|
||||
|
||||
public function setLocale($lang)
|
||||
{
|
||||
//if action is post method:
|
||||
//$lang = Input::get('language');
|
||||
|
||||
|
||||
//Session::put('locale', $lang);
|
||||
Session::put(['locale' => $lang]);
|
||||
// Session::save();
|
||||
|
||||
//return redirect(url(URL::previous()));
|
||||
return Redirect::back();
|
||||
// echo trans('document.msg');
|
||||
}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue