mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for custom translations
This commit is contained in:
parent
f5380fbb52
commit
829b069063
@ -68,7 +68,7 @@ class CompanySettings extends BaseSettings
|
||||
public $inclusive_taxes = false; //@implemented
|
||||
public $quote_footer = ''; //@implmented
|
||||
|
||||
public $translations; //@TODO not used anywhere
|
||||
public $translations;
|
||||
|
||||
public $counter_number_applied = 'when_saved'; // when_saved , when_sent //@implemented
|
||||
public $quote_number_applied = 'when_saved'; // when_saved , when_sent //@implemented
|
||||
|
@ -15,6 +15,7 @@ use App\Events\Client\ClientWasCreated;
|
||||
use App\Events\Client\ClientWasUpdated;
|
||||
use App\Factory\ClientFactory;
|
||||
use App\Filters\ClientFilters;
|
||||
use App\Http\Requests\Client\AdjustClientLedgerRequest;
|
||||
use App\Http\Requests\Client\CreateClientRequest;
|
||||
use App\Http\Requests\Client\DestroyClientRequest;
|
||||
use App\Http\Requests\Client\EditClientRequest;
|
||||
@ -636,10 +637,13 @@ class ClientController extends BaseController
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
|
||||
public function adjustLedger(Request $request, Client $client)
|
||||
//@deprecated - not available
|
||||
public function adjustLedger(AdjustClientLedgerRequest $request, Client $client)
|
||||
{
|
||||
// $adjustment = $request->input('adjustment');
|
||||
// $notes = $request->input('notes');
|
||||
|
||||
// $client->service()->updateBalance
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -99,9 +99,10 @@ class PreviewController extends BaseController
|
||||
|
||||
$entity_obj->load('client');
|
||||
|
||||
App::setLocale($entity_obj->client->primary_contact()->preferredLocale());
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations($entity_obj->client->getMergedSettings()));
|
||||
$t = app('translator');
|
||||
App::setLocale($entity_obj->client->primary_contact()->preferredLocale());
|
||||
$t->replace(Ninja::transformTranslations($entity_obj->client->getMergedSettings()));
|
||||
|
||||
$html = new HtmlEngine($entity_obj->invitations()->first());
|
||||
|
||||
@ -151,7 +152,8 @@ class PreviewController extends BaseController
|
||||
private function blankEntity()
|
||||
{
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
|
@ -34,7 +34,9 @@ class PortalComposer
|
||||
$view->with($this->portalData());
|
||||
|
||||
if (auth()->user()) {
|
||||
Lang::replace(Ninja::transformTranslations(auth()->user()->client->getMergedSettings()));
|
||||
App::forgetInstance('translator');
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations(auth()->user()->client->getMergedSettings()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,17 +93,19 @@ 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 the locale*/
|
||||
App::setLocale($this->contact->preferredLocale());
|
||||
|
||||
// nlog($this->entity->client->getMergedSettings());
|
||||
|
||||
/* Set customized translations _NOW_ */
|
||||
Lang::replace(Ninja::transformTranslations($this->entity->client->getMergedSettings()));
|
||||
$t->replace(Ninja::transformTranslations($this->entity->client->getMergedSettings()));
|
||||
|
||||
$this->entity->service()->deletePdf();
|
||||
|
||||
|
@ -154,9 +154,9 @@ class NinjaMailerJob implements ShouldQueue
|
||||
App::forgetInstance('mail.manager'); //singletons must be destroyed!
|
||||
App::forgetInstance('mailer');
|
||||
App::forgetInstance('laravelgmail');
|
||||
|
||||
$t = app('translator');
|
||||
/* Inject custom translations if any exist */
|
||||
Lang::replace(Ninja::transformTranslations($this->nmo->settings));
|
||||
$t->replace(Ninja::transformTranslations($this->nmo->settings));
|
||||
|
||||
switch ($this->nmo->settings->email_sending_method) {
|
||||
case 'default':
|
||||
|
@ -44,7 +44,8 @@ class CreditEmailEngine extends BaseEmailEngine
|
||||
public function build()
|
||||
{
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
|
||||
if (is_array($this->template_data) && array_key_exists('body', $this->template_data) && strlen($this->template_data['body']) > 0) {
|
||||
$body_template = $this->template_data['body'];
|
||||
|
@ -47,7 +47,8 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
||||
{
|
||||
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
|
||||
if (is_array($this->template_data) && array_key_exists('body', $this->template_data) && strlen($this->template_data['body']) > 0) {
|
||||
$body_template = $this->template_data['body'];
|
||||
|
@ -45,7 +45,8 @@ class QuoteEmailEngine extends BaseEmailEngine
|
||||
public function build()
|
||||
{
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||
|
||||
if (is_array($this->template_data) && array_key_exists('body', $this->template_data) && strlen($this->template_data['body']) > 0) {
|
||||
$body_template = $this->template_data['body'];
|
||||
|
@ -106,7 +106,8 @@ class TemplateEngine
|
||||
}
|
||||
|
||||
App::forgetInstance('translator');
|
||||
Lang::replace(Ninja::transformTranslations($this->settings));
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->settings));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user