@extends('layouts.app') @php $localeName = \App\Models\WebsiteContent::LOCALES[$locale] ?? $locale; $sectionTitles = [ 'homepage' => 'Homepage', 'about' => 'About Page', 'contact' => 'Contact', 'seo' => 'SEO / Meta', 'booking' => 'Booking Messages', 'promo' => 'Announcement Bar', 'payment' => 'How to Pay', 'policies' => 'Policies', ]; $totalFields = collect($groups)->flatten(1)->count(); $translated = collect($groups)->flatten(1)->filter(fn ($f) => trim($f['value'] ?? '') !== '')->count(); @endphp @section('title', 'Translate — ' . $localeName) @section('nav_website', 'bg-teal-50 text-teal-700 font-semibold') @section('content')
{{-- Header --}}

Translate to {{ $localeName }}

Fill the {{ $localeName }} version beside each English field. Blank fields fall back to English on the site. {{ $translated }}/{{ $totalFields }} translated.

{{-- Locale switch --}}
English @foreach(\App\Models\WebsiteContent::LOCALES as $code => $name) @if($code !== 'en') {{ $name }} @endif @endforeach
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif @if(empty($groups))
There is no English content to translate yet. Add content in English first.
@else
@csrf @foreach($groups as $section => $fields)

{{ $sectionTitles[$section] ?? ucfirst($section) }}

@foreach($fields as $field) @php $rows = strlen($field['en']) > 120 ? 4 : 2; @endphp
{{ $field['label'] }}
English
{{ $localeName }}
@endforeach
@endforeach
Cancel
@endif
@endsection