From 156fb83e37acd8eb12a42030f04fc90f709e81ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 27 Jun 2021 10:15:39 +0300 Subject: [PATCH] language texts --- .../View/Components/TransactionShow.php | 103 +++++++++++++----- .../View/Components/TransactionTemplate.php | 77 +++++++++++-- resources/lang/en-GB/bills.php | 5 - resources/lang/en-GB/documents.php | 2 +- resources/lang/en-GB/general.php | 4 +- resources/lang/en-GB/invoices.php | 5 - resources/lang/en-GB/payments.php | 11 ++ resources/lang/en-GB/revenues.php | 11 ++ .../transactions/show/histories.blade.php | 4 +- 9 files changed, 171 insertions(+), 51 deletions(-) create mode 100644 resources/lang/en-GB/payments.php create mode 100644 resources/lang/en-GB/revenues.php diff --git a/app/Abstracts/View/Components/TransactionShow.php b/app/Abstracts/View/Components/TransactionShow.php index efb9bf8f8..a7ff60143 100644 --- a/app/Abstracts/View/Components/TransactionShow.php +++ b/app/Abstracts/View/Components/TransactionShow.php @@ -463,7 +463,7 @@ abstract class TransactionShow extends Base // Releated Information Text $this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction); $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->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount); $this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount); @@ -750,15 +750,13 @@ abstract class TransactionShow extends Base return $textHeaderAccount; } - $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2); - - $translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice'); + $translation = $this->getTextFromConfig($type, 'header_account', 'accounts', 'trans_choice'); if (!empty($translation)) { return $translation; } - return 'general.customers'; + return 'general.accounts'; } protected function getTextHeaderCategory($type, $textHeaderCategory) @@ -767,15 +765,13 @@ abstract class TransactionShow extends Base return $textHeaderCategory; } - $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2); - - $translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice'); + $translation = $this->getTextFromConfig($type, 'header_category', 'categories', 'trans_choice'); if (!empty($translation)) { return $translation; } - return 'general.customers'; + return 'general.categories'; } protected function getTextHeaderContact($type, $textHeaderContact) @@ -801,13 +797,13 @@ abstract class TransactionShow extends Base return $textHeaderAmount; } - $translation = $this->getTextFromConfig($type, 'header_amount', 'amount_due'); + $translation = $this->getTextFromConfig($type, 'header_amount', 'amount'); if (!empty($translation)) { return $translation; } - return 'general.amount_due'; + return 'general.amount'; } protected function getTextHeaderPaidAt($type, $textHeaderPaidAt) @@ -816,13 +812,13 @@ abstract class TransactionShow extends Base return $textHeaderPaidAt; } - $translation = $this->getTextFromConfig($type, 'header_due_at', 'due_on'); + $translation = $this->getTextFromConfig($type, 'header_paid_at', 'date'); if (!empty($translation)) { return $translation; } - return 'general.due_on'; + return 'general.date'; } protected function getClassHeaderAccount($type, $classHeaderAccount) @@ -831,7 +827,7 @@ abstract class TransactionShow extends Base return $classHeaderAccount; } - $class = $this->getClassFromConfig($type, 'header_status'); + $class = $this->getClassFromConfig($type, 'header_account'); if (!empty($class)) { return $class; @@ -861,7 +857,7 @@ abstract class TransactionShow extends Base return $classHeaderCategory; } - $class = $this->getClassFromConfig($type, 'header_contact'); + $class = $this->getClassFromConfig($type, 'header_category'); if (!empty($class)) { return $class; @@ -891,7 +887,7 @@ abstract class TransactionShow extends Base return $classHeaderPaidAt; } - $class = $this->getClassFromConfig($type, 'header_due_at'); + $class = $this->getClassFromConfig($type, 'header_paid_at'); if (!empty($class)) { return $class; @@ -906,7 +902,18 @@ abstract class TransactionShow extends Base 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)) { return $translation; @@ -1026,13 +1033,24 @@ abstract class TransactionShow extends Base 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)) { return $translation; } - return 'general.paid_by'; + return 'revenus.paid_by'; } protected function getTextReleatedTransansaction($type, $textReleatedTransansaction) @@ -1041,13 +1059,24 @@ abstract class TransactionShow extends Base 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)) { return $translation; } - return 'general.related_revenue'; + return 'revenues.related_invoice'; } protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber) @@ -1065,13 +1094,15 @@ abstract class TransactionShow extends Base return 'general.numbers'; } - protected function getTextReleatedConcat($type, $textReleatedContact) + protected function getTextReleatedContact($type, $textReleatedContact) { if (!empty($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)) { return $translation; @@ -1086,7 +1117,18 @@ abstract class TransactionShow extends Base 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)) { return $translation; @@ -1101,7 +1143,18 @@ abstract class TransactionShow extends Base 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)) { return $translation; diff --git a/app/Abstracts/View/Components/TransactionTemplate.php b/app/Abstracts/View/Components/TransactionTemplate.php index d9b329a39..aa04f84d6 100644 --- a/app/Abstracts/View/Components/TransactionTemplate.php +++ b/app/Abstracts/View/Components/TransactionTemplate.php @@ -240,7 +240,7 @@ abstract class TransactionTemplate extends Base // Releated Information Text $this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction); $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->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount); $this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount); @@ -306,7 +306,18 @@ abstract class TransactionTemplate extends Base 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)) { return $translation; @@ -426,13 +437,24 @@ abstract class TransactionTemplate extends Base 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)) { return $translation; } - return 'general.paid_by'; + return 'revenus.paid_by'; } protected function getTextReleatedTransansaction($type, $textReleatedTransansaction) @@ -441,13 +463,24 @@ abstract class TransactionTemplate extends Base 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)) { return $translation; } - return 'general.related_revenue'; + return 'revenues.related_invoice'; } protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber) @@ -465,13 +498,15 @@ abstract class TransactionTemplate extends Base return 'general.numbers'; } - protected function getTextReleatedConcat($type, $textReleatedContact) + protected function getTextReleatedContact($type, $textReleatedContact) { if (!empty($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)) { return $translation; @@ -486,7 +521,18 @@ abstract class TransactionTemplate extends Base 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)) { return $translation; @@ -501,7 +547,18 @@ abstract class TransactionTemplate extends Base 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)) { return $translation; diff --git a/resources/lang/en-GB/bills.php b/resources/lang/en-GB/bills.php index 4fa6ce887..0963c31af 100644 --- a/resources/lang/en-GB/bills.php +++ b/resources/lang/en-GB/bills.php @@ -37,11 +37,6 @@ return [ 'create_bill' => 'Create Bill', 'receive_bill' => 'Receive Bill', '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' => [ 'draft' => 'This is a DRAFT bill and will be reflected to charts after it gets received.', diff --git a/resources/lang/en-GB/documents.php b/resources/lang/en-GB/documents.php index 3de66089e..7aa44b7ba 100644 --- a/resources/lang/en-GB/documents.php +++ b/resources/lang/en-GB/documents.php @@ -3,7 +3,7 @@ return [ 'edit_columns' => 'Edit Columns', - 'empty_items' =>'You have not added any items.', + 'empty_items' => 'You have not added any items.', 'statuses' => [ 'draft' => 'Draft', diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 88458ebcc..08e9778d7 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -162,9 +162,7 @@ return [ 'due_on' => 'Due on', 'amount_due' => 'Amount due', 'financial_year' => 'Financial Year', - 'paid_to' => 'Paid To', - 'paid_by' => 'Paid By', - 'payment_date' => 'Payment Date', + 'created' => 'Created', 'card' => [ 'cards' => 'Card|Cards', diff --git a/resources/lang/en-GB/invoices.php b/resources/lang/en-GB/invoices.php index 594918872..c5daffdea 100644 --- a/resources/lang/en-GB/invoices.php +++ b/resources/lang/en-GB/invoices.php @@ -39,11 +39,6 @@ return [ 'send_invoice' => 'Send Invoice', 'get_paid' => 'Get Paid', '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' => [ 'email_required' => 'No email address for this customer!', diff --git a/resources/lang/en-GB/payments.php b/resources/lang/en-GB/payments.php new file mode 100644 index 000000000..a2db3f481 --- /dev/null +++ b/resources/lang/en-GB/payments.php @@ -0,0 +1,11 @@ + 'Payment Made', + 'paid_to' => 'Paid To', + 'related_bill' => 'Releated Bill', + + 'overdue_payment' => 'Overdue Payment', + +]; diff --git a/resources/lang/en-GB/revenues.php b/resources/lang/en-GB/revenues.php new file mode 100644 index 000000000..1366cf03e --- /dev/null +++ b/resources/lang/en-GB/revenues.php @@ -0,0 +1,11 @@ + 'Revenue Made', + 'paid_by' => 'Paid By', + 'related_invoice' => 'Releated Invoice', + + 'overdue_revenue' => 'Overdue Revenue', + +]; diff --git a/resources/views/components/transactions/show/histories.blade.php b/resources/views/components/transactions/show/histories.blade.php index 95b31c0d7..a7fec1bb9 100644 --- a/resources/views/components/transactions/show/histories.blade.php +++ b/resources/views/components/transactions/show/histories.blade.php @@ -16,7 +16,7 @@ - {{ trans('general.description') }} + {{ trans('general.created') }} @stack('row_footer_histories_head_end') @@ -33,7 +33,7 @@ - {{ $history->description }} + {{ $history->created->name }} @stack('row_footer_histories_body_td_end')