@props(['fields', 'values' => []]) {{-- One tab per translatable language with inputs named translations[{locale}][{field}]; fields are field => [label, text|textarea|rich]. --}} @php($languages = \App\Models\Language::translatable()->get(['code', 'name', 'direction'])) @if ($languages->isEmpty())

{{ __('Activate more languages to translate this content.') }}

@else @php($firstWithError = $languages->first(fn ($language) => $errors->has("translations.{$language->code}.*")))
@foreach ($languages as $language) @endforeach
@foreach ($languages as $language)
@foreach ($fields as $field => [$label, $type]) @php($inputName = "translations[{$language->code}][{$field}]") @php($inputValue = data_get($values, "{$language->code}.{$field}")) @if ($type === 'rich') @elseif ($type === 'textarea') @else @endif @endforeach
@endforeach

{{ __('Leave a translation empty to show the original text in that language.') }}

@endif