@php
$supportedLocales = Language::getSupportedLocales();
if (empty($options)) {
$options = [
'before' => '',
'lang_flag' => true,
'lang_name' => true,
'class' => '',
'after' => '',
];
}
@endphp
@if ($supportedLocales && count($supportedLocales) > 1)
@php
$languageDisplay = setting('language_display', 'all');
@endphp
@if (setting('language_switcher_display', 'dropdown') === 'dropdown')
{!! Arr::get($options, 'before') !!}
@if (Arr::get($options, 'lang_flag', true) && ($languageDisplay == 'all' || $languageDisplay == 'flag'))
{!! language_flag(Language::getCurrentLocaleFlag(), Language::getCurrentLocaleName()) !!}
@endif
@if (Arr::get($options, 'lang_name', true) && ($languageDisplay == 'all' || $languageDisplay == 'name'))
{{ Language::getCurrentLocaleName() }}
@endif
@foreach ($supportedLocales as $localeCode => $properties)
@continue($localeCode === Language::getCurrentLocale())
@if (Arr::get($options, 'lang_flag', true) && ($languageDisplay == 'all' || $languageDisplay == 'flag'))
{!! language_flag($properties['lang_flag'], $properties['lang_name']) !!}
@endif
@if (Arr::get($options, 'lang_name', true) && ($languageDisplay == 'all' || $languageDisplay == 'name'))
{{ $properties['lang_name'] }}
@endif
@endforeach
{!! Arr::get($options, 'after') !!}
@else
@endif
@endif