diff --git a/app/Helpers/TemplateHelper.php b/app/Helpers/TemplateHelper.php index b2e19d76..101d3e03 100644 --- a/app/Helpers/TemplateHelper.php +++ b/app/Helpers/TemplateHelper.php @@ -4,10 +4,10 @@ class TemplateHelper { - public static function getTitleContent(string $header, string $title): string + public static function getTitleContent(string $header): string { $nameProject = __('layout.title.name_SICP'); - return "{$title} {$header} - {$nameProject}"; + return "{$header} - {$nameProject}"; } public static function getBookLink(string $locale): string diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index b6e660c9..610d1b51 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -9,9 +9,9 @@ use Illuminate\Support\Collection; if (!function_exists('getTitleContent')) { - function getTitleContent(string $header, string $title = ''): string + function getTitleContent(string $header): string { - return TemplateHelper::getTitleContent($header, $title); + return TemplateHelper::getTitleContent($header); } } diff --git a/resources/lang/en/chapter.php b/resources/lang/en/chapter.php index 2215be1c..9ca8d3dc 100644 --- a/resources/lang/en/chapter.php +++ b/resources/lang/en/chapter.php @@ -1,7 +1,7 @@ 'Chapter', + 'chapter' => 'Chapter :chapter', 'index' => [ 'description' => 'Contents of the book Structure and Interpretation of Computer Programs', ], diff --git a/resources/lang/en/exercise.php b/resources/lang/en/exercise.php index a768a5b3..d73b88de 100644 --- a/resources/lang/en/exercise.php +++ b/resources/lang/en/exercise.php @@ -1,7 +1,7 @@ 'Exercise', + 'exercise' => 'Exercise :exercise', 'index' => [ 'description' => 'List of exercises in the book Structure and Interpretation of Computer Programs', ], diff --git a/resources/lang/en/solution.php b/resources/lang/en/solution.php index f1a511fc..7e2aacbe 100644 --- a/resources/lang/en/solution.php +++ b/resources/lang/en/solution.php @@ -10,4 +10,5 @@ 'exercise' => 'Exercise', 'code_review' => 'Code Review', 'sub_title' => 'Compare your solutions', + 'solution_for_title' => 'Solution for Exercise :exercise', ]; diff --git a/resources/lang/ru/chapter.php b/resources/lang/ru/chapter.php index 6ca09b6c..861b81bc 100644 --- a/resources/lang/ru/chapter.php +++ b/resources/lang/ru/chapter.php @@ -1,7 +1,7 @@ 'Глава', + 'chapter' => 'Глава :chapter', 'index' => [ 'description' => 'Оглавление книги Структура и интерпретация компьютерных программ', ], diff --git a/resources/lang/ru/exercise.php b/resources/lang/ru/exercise.php index 70ab60a7..8e74190a 100644 --- a/resources/lang/ru/exercise.php +++ b/resources/lang/ru/exercise.php @@ -1,7 +1,7 @@ 'Упражнение', + 'exercise' => 'Упражнение :exercise', 'index' => [ 'description' => 'Cписок упражнений книги Структура и интерпретация компьютерных программ', ], diff --git a/resources/lang/ru/solution.php b/resources/lang/ru/solution.php index e5a4bec5..738a1a75 100644 --- a/resources/lang/ru/solution.php +++ b/resources/lang/ru/solution.php @@ -10,5 +10,5 @@ 'exercise' => 'Упражнение', 'code_review' => 'Код Ревью', 'sub_title' => 'Сравни свои решения', - 'solution_for_title' => 'Решение для упражнения', + 'solution_for_title' => 'Решение для упражнения :exercise', ]; diff --git a/resources/views/chapter/show.blade.php b/resources/views/chapter/show.blade.php index f31a1420..8bfd7112 100644 --- a/resources/views/chapter/show.blade.php +++ b/resources/views/chapter/show.blade.php @@ -10,7 +10,7 @@ */ @endphp @section('title') - {{ getTitleContent($chapter->getFullTitle(), __('chapter.chapter')) }} + {{ getTitleContent(__('chapter.chapter', ['chapter' => $chapter->getFullTitle()])) }} @endsection @section('description') @foreach (Breadcrumbs::generate('chapter', $chapter) as $breadcrumb) diff --git a/resources/views/exercise/show.blade.php b/resources/views/exercise/show.blade.php index 8f904384..a34fa30b 100644 --- a/resources/views/exercise/show.blade.php +++ b/resources/views/exercise/show.blade.php @@ -7,7 +7,7 @@ */ @endphp @section('title') - {{ getTitleContent($exercise->getFullTitle(), __('exercise.exercise')) }} + {{ getTitleContent(__('exercise.exercise', ['exercise' => $exercise->getFullTitle()])) }} @endsection @section('description') {{ __('exercise.exercise') }} {{ $exercise->path }} {{ $exercise->getTitle() }} {{ __('exercise.show.description') }} diff --git a/resources/views/solution/show.blade.php b/resources/views/solution/show.blade.php index 553b0b2a..82527843 100644 --- a/resources/views/solution/show.blade.php +++ b/resources/views/solution/show.blade.php @@ -2,7 +2,7 @@ @section('meta-robots', 'nofollow, noindex') @section('title') - {{ getTitleContent($currentExercise->getFullTitle(), __('solution.solution_for_title')) }} + {{ getTitleContent(__('solution.solution_for_title', ['exercise' => $currentExercise->getFullTitle()])) }} @endsection @section('description'){{ $user->id }} - {{ __('solution.code_review') }} - {{ $user->name }} - {{ __('solution.exercise') }} {{ $currentExercise->getFullTitle() }}@endsection