47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
|
|
<section>
|
||
|
|
<header>
|
||
|
|
<h2 class="text-lg font-medium text-gray-900">
|
||
|
|
{{ __('messages.settings.language') }}
|
||
|
|
</h2>
|
||
|
|
|
||
|
|
<p class="mt-1 text-sm text-gray-600">
|
||
|
|
{{ __('messages.settings.select_language') }}
|
||
|
|
</p>
|
||
|
|
</header>
|
||
|
|
|
||
|
|
<form method="post" action="{{ route('locale.update') }}" class="mt-6 space-y-6">
|
||
|
|
@csrf
|
||
|
|
|
||
|
|
<div>
|
||
|
|
<x-input-label for="locale" :value="__('messages.settings.language')" />
|
||
|
|
<select
|
||
|
|
id="locale"
|
||
|
|
name="locale"
|
||
|
|
class="mt-1 block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
|
||
|
|
>
|
||
|
|
@foreach(\App\Http\Middleware\SetLocale::SUPPORTED_LOCALES as $code => $name)
|
||
|
|
<option value="{{ $code }}" {{ (auth()->user()->locale ?? 'en') === $code ? 'selected' : '' }}>
|
||
|
|
{{ $name }}
|
||
|
|
</option>
|
||
|
|
@endforeach
|
||
|
|
</select>
|
||
|
|
<x-input-error class="mt-2" :messages="$errors->get('locale')" />
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="flex items-center gap-4">
|
||
|
|
<x-primary-button>{{ __('messages.common.save') }}</x-primary-button>
|
||
|
|
|
||
|
|
@if (session('success'))
|
||
|
|
<p
|
||
|
|
x-data="{ show: true }"
|
||
|
|
x-show="show"
|
||
|
|
x-transition
|
||
|
|
x-init="setTimeout(() => show = false, 2000)"
|
||
|
|
class="text-sm text-gray-600"
|
||
|
|
>{{ session('success') }}</p>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</section>
|
||
|
|
|