@extends('layout')

@section('title', __('store.preferences_language_title'))

@section('content')
<div class="container py-4">
    <h1 class="h4 mb-3">{{ __('store.preferences_language_title') }}</h1>
    <form method="POST" action="{{ route('store.locale.set') }}" class="row g-2">
        @csrf
        <div class="col-sm-6 col-md-4">
            <select name="locale" class="form-select">
                @foreach($languages as $lang)
                    <option value="{{ $lang->a2_iso }}" @selected(app()->getLocale() === $lang->a2_iso)>
                        {{ $lang->native_name }}
                        @if($lang->site_default) ({{ __('store.preferences_language_default') }}) @endif
                    </option>
                @endforeach
            </select>
        </div>
        <div class="col-sm-4 col-md-2">
            <button type="submit" class="btn btn-primary w-100">{{ __('store.buttons_save') }}</button>
        </div>
    </form>
</div>
@endsection


