mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 11:44:34 -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 $inclusive_taxes = false; //@implemented
|
||||||
public $quote_footer = ''; //@implmented
|
public $quote_footer = ''; //@implmented
|
||||||
|
|
||||||
public $translations; //@TODO not used anywhere
|
public $translations;
|
||||||
|
|
||||||
public $counter_number_applied = 'when_saved'; // when_saved , when_sent //@implemented
|
public $counter_number_applied = 'when_saved'; // when_saved , when_sent //@implemented
|
||||||
public $quote_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\Events\Client\ClientWasUpdated;
|
||||||
use App\Factory\ClientFactory;
|
use App\Factory\ClientFactory;
|
||||||
use App\Filters\ClientFilters;
|
use App\Filters\ClientFilters;
|
||||||
|
use App\Http\Requests\Client\AdjustClientLedgerRequest;
|
||||||
use App\Http\Requests\Client\CreateClientRequest;
|
use App\Http\Requests\Client\CreateClientRequest;
|
||||||
use App\Http\Requests\Client\DestroyClientRequest;
|
use App\Http\Requests\Client\DestroyClientRequest;
|
||||||
use App\Http\Requests\Client\EditClientRequest;
|
use App\Http\Requests\Client\EditClientRequest;
|
||||||
@ -636,10 +637,13 @@ class ClientController extends BaseController
|
|||||||
* ),
|
* ),
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
|
//@deprecated - not available
|
||||||
public function adjustLedger(Request $request, Client $client)
|
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');
|
$entity_obj->load('client');
|
||||||
|
|
||||||
App::setLocale($entity_obj->client->primary_contact()->preferredLocale());
|
|
||||||
App::forgetInstance('translator');
|
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());
|
$html = new HtmlEngine($entity_obj->invitations()->first());
|
||||||
|
|
||||||
@ -151,7 +152,8 @@ class PreviewController extends BaseController
|
|||||||
private function blankEntity()
|
private function blankEntity()
|
||||||
{
|
{
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
Lang::replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
$t = app('translator');
|
||||||
|
$t->replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
||||||
|
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
|
|
||||||
|
@ -34,7 +34,9 @@ class PortalComposer
|
|||||||
$view->with($this->portalData());
|
$view->with($this->portalData());
|
||||||
|
|
||||||
if (auth()->user()) {
|
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()
|
public function handle()
|
||||||
{
|
{
|
||||||
/* Set the locale*/
|
|
||||||
App::setLocale($this->contact->preferredLocale());
|
|
||||||
|
|
||||||
/* Forget the singleton*/
|
/* Forget the singleton*/
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
|
|
||||||
/* Init a new copy of the translator*/
|
/* Init a new copy of the translator*/
|
||||||
$t = app('translator');
|
$t = app('translator');
|
||||||
|
/* Set the locale*/
|
||||||
|
App::setLocale($this->contact->preferredLocale());
|
||||||
|
|
||||||
|
// nlog($this->entity->client->getMergedSettings());
|
||||||
|
|
||||||
/* Set customized translations _NOW_ */
|
/* Set customized translations _NOW_ */
|
||||||
Lang::replace(Ninja::transformTranslations($this->entity->client->getMergedSettings()));
|
$t->replace(Ninja::transformTranslations($this->entity->client->getMergedSettings()));
|
||||||
|
|
||||||
$this->entity->service()->deletePdf();
|
$this->entity->service()->deletePdf();
|
||||||
|
|
||||||
|
@ -154,9 +154,9 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
App::forgetInstance('mail.manager'); //singletons must be destroyed!
|
App::forgetInstance('mail.manager'); //singletons must be destroyed!
|
||||||
App::forgetInstance('mailer');
|
App::forgetInstance('mailer');
|
||||||
App::forgetInstance('laravelgmail');
|
App::forgetInstance('laravelgmail');
|
||||||
|
$t = app('translator');
|
||||||
/* Inject custom translations if any exist */
|
/* 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) {
|
switch ($this->nmo->settings->email_sending_method) {
|
||||||
case 'default':
|
case 'default':
|
||||||
|
@ -44,7 +44,8 @@ class CreditEmailEngine extends BaseEmailEngine
|
|||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
App::forgetInstance('translator');
|
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) {
|
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'];
|
$body_template = $this->template_data['body'];
|
||||||
|
@ -47,7 +47,8 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
{
|
{
|
||||||
|
|
||||||
App::forgetInstance('translator');
|
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) {
|
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'];
|
$body_template = $this->template_data['body'];
|
||||||
|
@ -45,7 +45,8 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
App::forgetInstance('translator');
|
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) {
|
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'];
|
$body_template = $this->template_data['body'];
|
||||||
|
@ -106,7 +106,8 @@ class TemplateEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
Lang::replace(Ninja::transformTranslations($this->settings));
|
$t = app('translator');
|
||||||
|
$t->replace(Ninja::transformTranslations($this->settings));
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user