Apps get multi languages

This commit is contained in:
cuneytsenturk 2018-12-19 15:36:40 +03:00
parent f3986734fc
commit c9f75cd3d7
5 changed files with 6 additions and 5 deletions

View File

@ -36,5 +36,4 @@ class ApiCompany
return $next($request);
}
}
}

View File

@ -20,7 +20,7 @@ class Modules
public function compose(View $view)
{
if (setting('general.api_token')) {
$categories = Cache::remember('modules.categories', Date::now()->addHour(6), function () {
$categories = Cache::remember('modules.categories.' . language()->getShortCode(), Date::now()->addHour(6), function () {
return collect($this->getCategories())->pluck('name', 'slug')
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
});

View File

@ -528,6 +528,7 @@ trait Modules
'Accept' => 'application/json',
'Referer' => env('APP_URL'),
'Akaunting' => version('short'),
'Language' => language()->getShortCode()
];
$data['http_errors'] = false;

View File

@ -18,7 +18,8 @@ trait SiteApi
'Authorization' => 'Bearer ' . setting('general.api_token'),
'Accept' => 'application/json',
'Referer' => env('APP_URL'),
'Akaunting' => version('short')
'Akaunting' => version('short'),
'Language' => language()->getShortCode()
);
$data['http_errors'] = false;

View File

@ -1,6 +1,6 @@
<?php
namespace Modules\PaypalStandard\Events\Handlers;
namespace Modules\PaypalStandard\Listeners;
use App\Events\PaymentGatewayListing;