Merge pull request #5637 from turbo124/v5-develop

Fixes for custom translation strings.
This commit is contained in:
David Bomba 2021-05-07 14:29:01 +10:00 committed by GitHub
commit 2109b8be52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -91,8 +91,16 @@ class CreateEntityPdf implements ShouldQueue
public function handle()
{
/* Set the locale*/
App::setLocale($this->contact->preferredLocale());
/* Forget the singleton*/
App::forgetInstance('translator');
/* Init a new copy of the translator*/
$t = app('translator');
/* Set customized translations _NOW_ */
Lang::replace(Ninja::transformTranslations($this->entity->client->getMergedSettings()));
$this->entity->service()->deletePdf();

View File

@ -23,6 +23,8 @@ class SchedulerCheck implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 1;
public function __construct()
{
}
@ -45,14 +47,18 @@ class SchedulerCheck implements ShouldQueue
Artisan::call('migrate', ['--force' => true]);
} catch (\Exception $e) {
nlog("I wasn't able to migrate the data.");
nlog($e->getMessage());
}
try {
Artisan::call('optimize');
Artisan::call('clear-compiled');
Artisan::call('cache:clear');
Artisan::call('route:clear');
Artisan::call('config:cache');
} catch (\Exception $e) {
nlog($e->getMessage());
nlog("I wasn't able to optimize.");
nlog($e->getMessage());
}
@ -60,6 +66,7 @@ class SchedulerCheck implements ShouldQueue
Artisan::call('view:clear');
} catch (\Exception $e) {
nlog("I wasn't able to clear the views.");
nlog($e->getMessage());
}