@if (isset($currentLanguage) && $showFlags)
@php try { echo svg('flag-1x1-'.$currentLanguage['flag'], '')->toHtml(); $flagFound = true; } catch (Exception) { $flagFound = false; } @endphp @unless ($flagFound) @endunless
@else @endif
@foreach ($otherLanguages as $language) @php $isCurrent = false; if (isset($currentLanguage)) { $isCurrent = $currentLanguage['code'] === $language['code']; } @endphp @if ($showFlags)
@php try { echo svg('flag-4x3-'.$language['flag'], '')->toHtml(); $itemFlagFound = true; } catch (Exception) { $itemFlagFound = false; } @endphp @unless ($itemFlagFound) @endunless
{{ $language['name'] }} @else {{ $language['name'] }} @endif
@endforeach
@if(session('filament-locale-changed')) @php $localeEvent = session('filament-locale-changed'); @endphp @endif