diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 0e5dff8..1dbc060 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -35,6 +35,7 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, + \App\Http\Middleware\Locale::class, ], 'api' => [ diff --git a/app/Http/Middleware/Locale.php b/app/Http/Middleware/Locale.php new file mode 100644 index 0000000..b60c229 --- /dev/null +++ b/app/Http/Middleware/Locale.php @@ -0,0 +1,21 @@ + 'There are no items shared with you yet.', + 'share_item' => 'Share an item!', + 'return' => 'Return It', + 'cancel_alert' => 'Cancel Alert', + 'alert_me' => 'Alert me', + 'take' => 'Take It' +]; \ No newline at end of file diff --git a/resources/lang/pt-br/home.php b/resources/lang/pt-br/home.php new file mode 100644 index 0000000..0c0c3cf --- /dev/null +++ b/resources/lang/pt-br/home.php @@ -0,0 +1,12 @@ + 'Ainda não há itens compartilhados com você.', + 'share_item' => 'Compartilhe um item!', + 'return' => 'Retornar', + 'cancel_alert' => 'Cancelar alerta', + 'alert_me' => 'Alertar', + 'take' => 'Pegar' +]; \ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 6bfd47d..4d419e0 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -33,7 +33,7 @@ @empty -
There are no items shared with you yet. Share an item!
+@lang('home.no_messages')@lang('home.share_item')
@endforelse diff --git a/resources/views/home/unusedItem.blade.php b/resources/views/home/unusedItem.blade.php index 3aefc6e..8d91be4 100644 --- a/resources/views/home/unusedItem.blade.php +++ b/resources/views/home/unusedItem.blade.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/resources/views/home/usedItem.blade.php b/resources/views/home/usedItem.blade.php index dcfe35f..d4f7c9e 100644 --- a/resources/views/home/usedItem.blade.php +++ b/resources/views/home/usedItem.blade.php @@ -5,7 +5,7 @@ {{ csrf_field() }} @method('DELETE') - + @@ -23,9 +23,9 @@ @if ($item->waiting_user_id == \Auth::id()) @method('DELETE') - + @elseif (!$item->waiting_user_id) - + @endif @endif \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 5df9f98..7c582d2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,6 +15,12 @@ Route::get('/', function () { return view('welcome'); }); +Route::get('/lang/{locale}', function ($locale) { + session(['lang' => $locale]); + session()->save(); + return back(); +}); + Route::get('/product', 'ProductController@index')->middleware('verified'); Route::get('/product/{product}', 'ProductController@show')->middleware('verified'); Route::post('/product', 'ProductController@store')->middleware('verified');