@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale)
@php
$translation = $product->translations->where('locale', $localeCode)->first();
@endphp
{{ $locale['native'] }}
@if($translation)
@else
@endif
@endforeach
@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale)
@php
$translation = $product->translations->where('locale', $localeCode)->first();
@endphp
@if($translation)
@if($translation->short_description)
{{ __('Short Description') }}
{{ $translation->short_description }}
@endif
@if($translation->description)
{{ __('Description') }}
{!! nl2br(e($translation->description)) !!}
@endif
@if($translation->features)
{{ __('Features') }}
@foreach(explode("\n", $translation->features) as $feature)
@if(trim($feature))
- {{ trim(str_replace(['•', '-', '*'], '', $feature)) }}
@endif
@endforeach
@endif
@if($translation->specifications)
{{ __('Specifications') }}
@foreach(explode("\n", $translation->specifications) as $spec)
@if(trim($spec) && strpos($spec, ':') !== false)
@php
[$key, $value] = explode(':', $spec, 2);
@endphp
-
{{ trim($key) }}:
{{ trim($value) }}
@endif
@endforeach
@endif
@if($translation->meta_title || $translation->meta_description)
{{ __('SEO Preview') }}
{{ $translation->meta_title ?: $translation->name }}
{{ url('/products/' . $translation->slug) }}
{{ $translation->meta_description ?: ($translation->short_description ?: Str::limit(strip_tags($translation->description), 160)) }}
@if($translation->meta_keywords)
{{ __('Keywords') }}:
@foreach(explode(',', $translation->meta_keywords) as $keyword)
{{ trim($keyword) }}
@endforeach
@endif
@endif
@else
{{ __('Translation Not Available') }}
{{ __('This product has not been translated to') }} {{ $locale['native'] }}
{{ __('Add Translation') }}
@endif