Update menu component localization: Enhanced the menu blade template to utilize the translation feature for item titles, ensuring proper localization support for both English and Turkish languages. This change improves the user experience by dynamically displaying translated titles when available.

This commit is contained in:
Ümit Tunç
2025-11-04 15:24:13 -03:00
parent 236fad201c
commit 7da35f79bb
@@ -30,7 +30,7 @@ $menuItems = \App\Models\Page::with(['children' => function ($query) {
<a class="nav-link dropdown-toggle font-bold !tracking-[normal] hover:!text-[#e31e24] !text-[.85rem]"
href="{{ route('page.show', $item->slug) }}"
data-bs-toggle="dropdown">
{{ $item->title }}
{{ $item->translate('title') ?: $item->title }}
</a>
<ul class="dropdown-menu">
@foreach($item->children as $child)
@@ -42,14 +42,14 @@ $menuItems = \App\Models\Page::with(['children' => function ($query) {
<a class="dropdown-item hover:!text-[#e31e24] dropdown-toggle"
href="{{ route('page.show', $child->slug) }}"
data-bs-toggle="dropdown">
{{ $child->title }}
{{ $child->translate('title') ?: $child->title }}
</a>
<ul class="dropdown-menu">
@foreach($child->children as $grandChild)
<li class="nav-item">
<a class="dropdown-item hover:!text-[#e31e24]"
href="{{ route('page.show', $grandChild->slug) }}">
{{ $grandChild->title }}
{{ $grandChild->translate('title') ?: $grandChild->title }}
</a>
</li>
@endforeach
@@ -59,7 +59,7 @@ $menuItems = \App\Models\Page::with(['children' => function ($query) {
<li class="nav-item">
<a class="dropdown-item hover:!text-[#e31e24]"
href="{{ route('page.show', $child->slug) }}">
{{ $child->title }}
{{ $child->translate('title') ?: $child->title }}
</a>
</li>
@endif
@@ -68,7 +68,7 @@ $menuItems = \App\Models\Page::with(['children' => function ($query) {
@else
<a class="nav-link font-bold !tracking-[normal] hover:!text-[#e31e24] !text-[.85rem]"
href="{{ route('page.show', $item->slug) }}">
{{ $item->title }}
{{ $item->translate('title') ?: $item->title }}
</a>
@endif
</li>