<% available_locale_options_for_select = Spree.i18n_available_locales.map {
  [I18n.t('spree.i18n.this_file_language', locale: _1, default: _1.to_s, fallback: false), _1]
}.sort %>

<% if available_locale_options_for_select.size > 1 %>
  <%= form_tag(spree.admin_set_locale_path(format: :html), method: :put, style: "width: 100%;") do %>
    <label class="admin-navbar-selection admin-locale-selection">
      <i class="fa fa-globe fa-fw" title="<%= I18n.t('spree.choose_dashboard_locale') %>"></i>
      <select class="custom-select fullwidth" onchange="this.form.requestSubmit()">
        <%= options_for_select(available_locale_options_for_select, I18n.locale) %>
      </select>
    </label>
  <% end %>
<% end %>
