Skip to content

A free open source IT asset/license management system

Introduce locale select component and make replacement on profile page

Marcus Moore75924be95881
diff --git a/resources/views/account/profile.blade.php b/resources/views/account/profile.blade.php
index 7a6ad69da1..f6c1b4e342 100755
--- a/resources/views/account/profile.blade.php
+++ b/resources/views/account/profile.blade.php
@@ -49,7 +49,7 @@
<div class="col-md-7">
@if (!config('app.lock_passwords'))
- {!! Form::locales('locale', old('locale', $user->locale), 'select2') !!}
+ <x-input.locale-select name="locales" :selected="old('locale', $user->locale)"/>
{!! $errors->first('locale', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@else
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
diff --git a/resources/views/blade/input/locale-select.blade.php b/resources/views/blade/input/locale-select.blade.php
new file mode 100644
index 0000000000..71da6df6a3
--- /dev/null
+++ b/resources/views/blade/input/locale-select.blade.php
@@ -0,0 +1,24 @@
+@props([
+ 'name' => 'locale',
+ 'selected' => null,
+])
+<div>
+ <select
+ name="{{ $name }}"
+ {{ $attributes->merge(['class' => 'select2', 'style' => 'width:100%']) }}
+ aria-label="{{ $name }}"
+ data-placeholder="{{ trans('localizations.select_language') }}"
+ >
+ <option value="" role="option">{{ trans('localizations.select_language') }}</option>'
+ @foreach (trans('localizations.languages') as $abbr => $locale)
+ <option
+ value="{{ $abbr }}"
+ role="option"
+ @selected($abbr == $selected)
+ aria-selected="{{ $abbr == $selected ? 'true' : 'false' }}"
+ >
+ {{ $locale }}
+ </option>
+ @endforeach
+ </select>
+</div>