From 3ba29262be179b8f0a4cf3740def4dabce90ddcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 27 Jun 2021 17:54:05 +0300 Subject: [PATCH] Fixed document title issue.. --- .../View/Components/DocumentShow.php | 26 +++++++++---------- .../View/Components/DocumentTemplate.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/Abstracts/View/Components/DocumentShow.php b/app/Abstracts/View/Components/DocumentShow.php index fddbede90..e366076ec 100644 --- a/app/Abstracts/View/Components/DocumentShow.php +++ b/app/Abstracts/View/Components/DocumentShow.php @@ -1151,16 +1151,16 @@ abstract class DocumentShow extends Base return $textDocumentTitle; } - $translation = $this->getTextFromConfig($type, 'document_title', 'title'); - - if (!empty($translation)) { - return $translation; - } - if (!empty(setting($type . '.title'))) { return setting($type . '.title'); } + $translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type), 'trans_choice'); + + if (!empty($translation)) { + return trans_choice($translation, 1); + } + return setting('invoice.title'); } @@ -1170,17 +1170,17 @@ abstract class DocumentShow extends Base return $textDocumentSubheading; } - $translation = $this->getTextFromConfig($type, 'document_subheading', 'subheading'); - - if (!empty($translation)) { - return $translation; - } - if (!empty(setting($type . '.subheading'))) { return setting($type . '.subheading'); } - return setting('invoice.subheading'); + $translation = $this->getTextFromConfig($type, 'document_subheading', 'subheading'); + + if (!empty($translation)) { + return trans($translation); + } + + return false; } protected function getTextTimelineCreateTitle($type, $textTimelineCreateTitle) diff --git a/app/Abstracts/View/Components/DocumentTemplate.php b/app/Abstracts/View/Components/DocumentTemplate.php index a89609664..7a7430755 100644 --- a/app/Abstracts/View/Components/DocumentTemplate.php +++ b/app/Abstracts/View/Components/DocumentTemplate.php @@ -279,7 +279,7 @@ abstract class DocumentTemplate extends Base return setting($type . '.title'); } - $translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type)); + $translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type), 'trans_choice'); if (!empty($translation)) { return trans_choice($translation, 1);