Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Middleware/Locale.php
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | public function handle(Request $request, Closure $next) | ||||
if (!$lang) { | if (!$lang) { | ||||
$lang = $default; | $lang = $default; | ||||
} | } | ||||
if (!app()->isLocale($lang)) { | if (!app()->isLocale($lang)) { | ||||
app()->setLocale($lang); | app()->setLocale($lang); | ||||
} | } | ||||
// Allow skins to define/overwrite some localization | |||||
$theme = \config('app.theme'); | |||||
\app('translator')->addNamespace('theme', \resource_path("themes/{$theme}/lang")); | |||||
return $next($request); | return $next($request); | ||||
} | } | ||||
} | } |