Merge branch 'master' of /home/administrator/utils/gitea/git/repositories/willaengine-project/willaengine

pull/87/head
Farid Saravi 4 years ago
commit cec26c3f9f

@ -19,6 +19,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\TrimStrings::class, \App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class, \App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\FindLanguage::class,
]; ];
/** /**

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Closure;
use WM\Core\Infrastructures\Enumerations\Language;
class FindLanguage
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($language = $request->header('accept-language')) {
app()->setLocale($language);
}
return $next($request);
}
}

@ -41,10 +41,13 @@ export default class extends chart {
setOptions() { setOptions() {
switch (this.type) { switch (this.type) {
case 'weekly': case 'weekly':
case 'cost-weekly':
return this.setWeekly(); return this.setWeekly();
case 'monthly': case 'monthly':
case 'cost-monthly':
return this.setMonthly(); return this.setMonthly();
case 'daily': case 'daily':
case 'cost-daily':
return this.setDaily(); return this.setDaily();
} }
} }

Loading…
Cancel
Save