language texts

This commit is contained in:
Cüneyt Şentürk 2021-06-27 10:15:39 +03:00
parent b18012e7cd
commit 156fb83e37
9 changed files with 171 additions and 51 deletions

View File

@ -463,7 +463,7 @@ abstract class TransactionShow extends Base
// Releated Information Text // Releated Information Text
$this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction); $this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction);
$this->textReleatedDocumentNumber = $this->getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber); $this->textReleatedDocumentNumber = $this->getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber);
$this->textReleatedContact = $this->getTextReleatedConcat($type, $textReleatedContact); $this->textReleatedContact = $this->getTextReleatedContact($type, $textReleatedContact);
$this->textReleatedDocumentDate = $this->getTextReleatedDocumentDate($type, $textReleatedDocumentDate); $this->textReleatedDocumentDate = $this->getTextReleatedDocumentDate($type, $textReleatedDocumentDate);
$this->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount); $this->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount);
$this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount); $this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount);
@ -750,15 +750,13 @@ abstract class TransactionShow extends Base
return $textHeaderAccount; return $textHeaderAccount;
} }
$default_key = Str::plural(config('type.' . $type . '.contact_type'), 2); $translation = $this->getTextFromConfig($type, 'header_account', 'accounts', 'trans_choice');
$translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.customers'; return 'general.accounts';
} }
protected function getTextHeaderCategory($type, $textHeaderCategory) protected function getTextHeaderCategory($type, $textHeaderCategory)
@ -767,15 +765,13 @@ abstract class TransactionShow extends Base
return $textHeaderCategory; return $textHeaderCategory;
} }
$default_key = Str::plural(config('type.' . $type . '.contact_type'), 2); $translation = $this->getTextFromConfig($type, 'header_category', 'categories', 'trans_choice');
$translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.customers'; return 'general.categories';
} }
protected function getTextHeaderContact($type, $textHeaderContact) protected function getTextHeaderContact($type, $textHeaderContact)
@ -801,13 +797,13 @@ abstract class TransactionShow extends Base
return $textHeaderAmount; return $textHeaderAmount;
} }
$translation = $this->getTextFromConfig($type, 'header_amount', 'amount_due'); $translation = $this->getTextFromConfig($type, 'header_amount', 'amount');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.amount_due'; return 'general.amount';
} }
protected function getTextHeaderPaidAt($type, $textHeaderPaidAt) protected function getTextHeaderPaidAt($type, $textHeaderPaidAt)
@ -816,13 +812,13 @@ abstract class TransactionShow extends Base
return $textHeaderPaidAt; return $textHeaderPaidAt;
} }
$translation = $this->getTextFromConfig($type, 'header_due_at', 'due_on'); $translation = $this->getTextFromConfig($type, 'header_paid_at', 'date');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.due_on'; return 'general.date';
} }
protected function getClassHeaderAccount($type, $classHeaderAccount) protected function getClassHeaderAccount($type, $classHeaderAccount)
@ -831,7 +827,7 @@ abstract class TransactionShow extends Base
return $classHeaderAccount; return $classHeaderAccount;
} }
$class = $this->getClassFromConfig($type, 'header_status'); $class = $this->getClassFromConfig($type, 'header_account');
if (!empty($class)) { if (!empty($class)) {
return $class; return $class;
@ -861,7 +857,7 @@ abstract class TransactionShow extends Base
return $classHeaderCategory; return $classHeaderCategory;
} }
$class = $this->getClassFromConfig($type, 'header_contact'); $class = $this->getClassFromConfig($type, 'header_category');
if (!empty($class)) { if (!empty($class)) {
return $class; return $class;
@ -891,7 +887,7 @@ abstract class TransactionShow extends Base
return $classHeaderPaidAt; return $classHeaderPaidAt;
} }
$class = $this->getClassFromConfig($type, 'header_due_at'); $class = $this->getClassFromConfig($type, 'header_paid_at');
if (!empty($class)) { if (!empty($class)) {
return $class; return $class;
@ -906,7 +902,18 @@ abstract class TransactionShow extends Base
return $textContentTitle; return $textContentTitle;
} }
$translation = $this->getTextFromConfig($type, $type . '_made', 'revenue_made'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'payment_made';
break;
default:
$default_key = 'revenue_made';
break;
}
$translation = $this->getTextFromConfig($type, $type . '_made', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -1026,13 +1033,24 @@ abstract class TransactionShow extends Base
return $textPaidBy; return $textPaidBy;
} }
$translation = $this->getTextFromConfig($type, 'paid_by', 'paid_by'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'paid_to';
break;
default:
$default_key = 'paid_by';
break;
}
$translation = $this->getTextFromConfig($type, 'paid_to_by', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.paid_by'; return 'revenus.paid_by';
} }
protected function getTextReleatedTransansaction($type, $textReleatedTransansaction) protected function getTextReleatedTransansaction($type, $textReleatedTransansaction)
@ -1041,13 +1059,24 @@ abstract class TransactionShow extends Base
return $textReleatedTransansaction; return $textReleatedTransansaction;
} }
$translation = $this->getTextFromConfig($type, 'related_revenue', 'related_revenue'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'related_bill';
break;
default:
$default_key = 'related_invoice';
break;
}
$translation = $this->getTextFromConfig($type, 'related_type', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.related_revenue'; return 'revenues.related_invoice';
} }
protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber) protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber)
@ -1065,13 +1094,15 @@ abstract class TransactionShow extends Base
return 'general.numbers'; return 'general.numbers';
} }
protected function getTextReleatedConcat($type, $textReleatedContact) protected function getTextReleatedContact($type, $textReleatedContact)
{ {
if (!empty($textReleatedContact)) { if (!empty($textReleatedContact)) {
return $textReleatedContact; return $textReleatedContact;
} }
$translation = $this->getTextFromConfig($type, 'related_contact', 'contact'); $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
$translation = $this->getTextFromConfig($type, 'related_contact', $default_key, 'trans_choice');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -1086,7 +1117,18 @@ abstract class TransactionShow extends Base
return $textReleatedDocumentDate; return $textReleatedDocumentDate;
} }
$translation = $this->getTextFromConfig($type, 'related_document_date', 'due_date'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_date';
break;
default:
$default_key = 'invoice_date';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_date', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -1101,7 +1143,18 @@ abstract class TransactionShow extends Base
return $textReleatedDocumentAmount; return $textReleatedDocumentAmount;
} }
$translation = $this->getTextFromConfig($type, 'related_document_amount', 'amount'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_amount';
break;
default:
$default_key = 'invoice_amount';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_amount', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;

View File

@ -240,7 +240,7 @@ abstract class TransactionTemplate extends Base
// Releated Information Text // Releated Information Text
$this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction); $this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction);
$this->textReleatedDocumentNumber = $this->getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber); $this->textReleatedDocumentNumber = $this->getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber);
$this->textReleatedContact = $this->getTextReleatedConcat($type, $textReleatedContact); $this->textReleatedContact = $this->getTextReleatedContact($type, $textReleatedContact);
$this->textReleatedDocumentDate = $this->getTextReleatedDocumentDate($type, $textReleatedDocumentDate); $this->textReleatedDocumentDate = $this->getTextReleatedDocumentDate($type, $textReleatedDocumentDate);
$this->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount); $this->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount);
$this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount); $this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount);
@ -306,7 +306,18 @@ abstract class TransactionTemplate extends Base
return $textContentTitle; return $textContentTitle;
} }
$translation = $this->getTextFromConfig($type, $type . '_made', 'revenue_made'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'payment_made';
break;
default:
$default_key = 'revenue_made';
break;
}
$translation = $this->getTextFromConfig($type, $type . '_made', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -426,13 +437,24 @@ abstract class TransactionTemplate extends Base
return $textPaidBy; return $textPaidBy;
} }
$translation = $this->getTextFromConfig($type, 'paid_by', 'paid_by'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'paid_to';
break;
default:
$default_key = 'paid_by';
break;
}
$translation = $this->getTextFromConfig($type, 'paid_to_by', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.paid_by'; return 'revenus.paid_by';
} }
protected function getTextReleatedTransansaction($type, $textReleatedTransansaction) protected function getTextReleatedTransansaction($type, $textReleatedTransansaction)
@ -441,13 +463,24 @@ abstract class TransactionTemplate extends Base
return $textReleatedTransansaction; return $textReleatedTransansaction;
} }
$translation = $this->getTextFromConfig($type, 'related_revenue', 'related_revenue'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'related_bill';
break;
default:
$default_key = 'related_invoice';
break;
}
$translation = $this->getTextFromConfig($type, 'related_type', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
} }
return 'general.related_revenue'; return 'revenues.related_invoice';
} }
protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber) protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber)
@ -465,13 +498,15 @@ abstract class TransactionTemplate extends Base
return 'general.numbers'; return 'general.numbers';
} }
protected function getTextReleatedConcat($type, $textReleatedContact) protected function getTextReleatedContact($type, $textReleatedContact)
{ {
if (!empty($textReleatedContact)) { if (!empty($textReleatedContact)) {
return $textReleatedContact; return $textReleatedContact;
} }
$translation = $this->getTextFromConfig($type, 'related_contact', 'contact'); $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
$translation = $this->getTextFromConfig($type, 'related_contact', $default_key, 'trans_choice');
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -486,7 +521,18 @@ abstract class TransactionTemplate extends Base
return $textReleatedDocumentDate; return $textReleatedDocumentDate;
} }
$translation = $this->getTextFromConfig($type, 'related_document_date', 'due_date'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_date';
break;
default:
$default_key = 'invoice_date';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_date', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;
@ -501,7 +547,18 @@ abstract class TransactionTemplate extends Base
return $textReleatedDocumentAmount; return $textReleatedDocumentAmount;
} }
$translation = $this->getTextFromConfig($type, 'related_document_amount', 'amount'); switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_amount';
break;
default:
$default_key = 'invoice_amount';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_amount', $default_key);
if (!empty($translation)) { if (!empty($translation)) {
return $translation; return $translation;

View File

@ -37,11 +37,6 @@ return [
'create_bill' => 'Create Bill', 'create_bill' => 'Create Bill',
'receive_bill' => 'Receive Bill', 'receive_bill' => 'Receive Bill',
'make_payment' => 'Make Payment', 'make_payment' => 'Make Payment',
'payment_history' => 'Payment History',
'payment_made' => 'Payment Made',
'overdue_payment' => 'Overdue Payment',
'payment_date' => 'Payment Date',
'related_bill' => 'Related Bill',
'messages' => [ 'messages' => [
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts after it gets received.', 'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts after it gets received.',

View File

@ -3,7 +3,7 @@
return [ return [
'edit_columns' => 'Edit Columns', 'edit_columns' => 'Edit Columns',
'empty_items' =>'You have not added any items.', 'empty_items' => 'You have not added any items.',
'statuses' => [ 'statuses' => [
'draft' => 'Draft', 'draft' => 'Draft',

View File

@ -162,9 +162,7 @@ return [
'due_on' => 'Due on', 'due_on' => 'Due on',
'amount_due' => 'Amount due', 'amount_due' => 'Amount due',
'financial_year' => 'Financial Year', 'financial_year' => 'Financial Year',
'paid_to' => 'Paid To', 'created' => 'Created',
'paid_by' => 'Paid By',
'payment_date' => 'Payment Date',
'card' => [ 'card' => [
'cards' => 'Card|Cards', 'cards' => 'Card|Cards',

View File

@ -39,11 +39,6 @@ return [
'send_invoice' => 'Send Invoice', 'send_invoice' => 'Send Invoice',
'get_paid' => 'Get Paid', 'get_paid' => 'Get Paid',
'accept_payments' => 'Accept Online Payments', 'accept_payments' => 'Accept Online Payments',
'revenue_date' => 'Revenue Date',
'overdue_revenue' => 'Overdue Revenue',
'revenue_made' => 'Revenue Made',
'revenue_history' => 'Revenue History',
'related_revenue' => 'Related Revenue',
'messages' => [ 'messages' => [
'email_required' => 'No email address for this customer!', 'email_required' => 'No email address for this customer!',

View File

@ -0,0 +1,11 @@
<?php
return [
'payment_made' => 'Payment Made',
'paid_to' => 'Paid To',
'related_bill' => 'Releated Bill',
'overdue_payment' => 'Overdue Payment',
];

View File

@ -0,0 +1,11 @@
<?php
return [
'revenue_made' => 'Revenue Made',
'paid_by' => 'Paid By',
'related_invoice' => 'Releated Invoice',
'overdue_revenue' => 'Overdue Revenue',
];

View File

@ -16,7 +16,7 @@
</th> </th>
<th class="col-xs-8 col-sm-9 text-left long-texts"> <th class="col-xs-8 col-sm-9 text-left long-texts">
{{ trans('general.description') }} {{ trans('general.created') }}
</th> </th>
@stack('row_footer_histories_head_end') @stack('row_footer_histories_head_end')
</tr> </tr>
@ -33,7 +33,7 @@
</td> </td>
<td class="col-xs-4 col-sm-6 text-left long-texts"> <td class="col-xs-4 col-sm-6 text-left long-texts">
{{ $history->description }} {{ $history->created->name }}
</td> </td>
@stack('row_footer_histories_body_td_end') @stack('row_footer_histories_body_td_end')
</tr> </tr>