adds optgroup on local switcher

This commit is contained in:
Alberto Garcia Cabeza
2016-12-05 17:46:24 +01:00
parent ec13036955
commit b61b08a2f5
3 changed files with 10 additions and 6 deletions

View File

@@ -5,12 +5,14 @@
<%= t("layouts.header.locale") %>
</label>
<select class="js-location-changer locale-switcher inline-block" name="locale-switcher" id="locale-switcher">
<% 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 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>
</select>
</form>
</div>

View File

@@ -185,6 +185,7 @@ en:
transparency_url: https://transparency.consul
header:
administration: Administration
available_locales: Available languages
debates: Debates
external_link_blog: Blog
external_link_opendata: Open data

View File

@@ -185,6 +185,7 @@ es:
transparency_url: https://transparency.consul
header:
administration: Administrar
available_locales: Idiomas disponibles
debates: Debates
external_link_blog: Blog
external_link_opendata: Datos abiertos