Files
ABSDEV/Modules/Localization/Resources/views/admin/translate.blade.php
T
2026-07-24 11:18:03 +01:00

2 lines
1.5 KiB
PHP

<x-layouts.app :title="__('Translate content')"><main class="p-6 space-y-6"><div><flux:heading size="xl">Translate: {{ $record->title ?? ('#'.$record->id) }}</flux:heading><flux:text>{{ $config['label'] }} · source language values are shown for reference.</flux:text></div><form method="POST" action="{{ route('administration.localization.translations.update',[$subject,$record->id]) }}" class="space-y-6">@csrf @method('PUT')@foreach($locales as $locale)<section class="rounded-xl border p-5 space-y-4"><div class="flex items-center justify-between"><flux:heading>{{ $locale->native_name }}</flux:heading><span class="text-sm text-zinc-500">{{ $locale->code }}</span></div>@foreach($config['fields'] as $field)@php($existing=$record->translations->first(fn($item)=>$item->locale_id===$locale->id&&$item->field===$field)?->value)<div><div class="mb-1 text-sm font-medium">{{ str($field)->headline() }}</div><div class="mb-2 text-xs text-zinc-500">Source: {{ str(strip_tags((string)$record->getAttribute($field)))->limit(180) }}</div>@if(in_array($field,['content','summary','excerpt','meta_description']))<flux:textarea name="translations[{{ $locale->code }}][{{ $field }}]" rows="6">{{ $existing }}</flux:textarea>@else<flux:input name="translations[{{ $locale->code }}][{{ $field }}]" :value="$existing"/>@endif</div>@endforeach</section>@endforeach<div class="flex justify-end"><flux:button type="submit" variant="primary">Save translations</flux:button></div></form></main></x-layouts.app>