Remove unneeded optgroup in locale switcher
The `<optgroup>` doesn't make much sense if all options are inside one group. And the information provided was redundant: when using a select field having "Language" as a label, it's obvious that the options are the available languages. Now that, since now the `<select>` field is smaller, we need to add an extra padding so the icon doesn't overlap the text.
This commit is contained in:
@@ -5,14 +5,12 @@
|
||||
<%= t("layouts.header.locale") %>
|
||||
</label>
|
||||
<select class="js-location-changer locale-switcher inline-block" name="locale-switcher" id="locale-switcher">
|
||||
<optgroup label="<%= t("layouts.header.available_locales") %>">
|
||||
<% I18n.available_locales.map do |loc| %>
|
||||
<option <%= "selected" if loc == I18n.locale %>
|
||||
value="<%= current_path_with_query_params(locale: loc) %>">
|
||||
<%= name_for_locale(loc) %>
|
||||
</option>
|
||||
<% end %>
|
||||
</optgroup>
|
||||
<% I18n.available_locales.map do |loc| %>
|
||||
<option <%= "selected" if loc == I18n.locale %>
|
||||
value="<%= current_path_with_query_params(locale: loc) %>">
|
||||
<%= name_for_locale(loc) %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user