Skip to content

Commit

Permalink
Add a new i18n key for the sort/per page labels that include HTML w/ …
Browse files Browse the repository at this point in the history
…bootstrap utility classes to remove unnecessary text at the smallest breakpoints.
  • Loading branch information
jkeck committed Sep 19, 2019
1 parent 164c9b9 commit 0ad267a
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/views/catalog/_per_page_widget.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="sr-only"><%= t('blacklight.search.per_page.title') %></span>
<div id="per_page-dropdown" class="per-page-dropdown btn-group">
<button type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<%= t(:'blacklight.search.per_page.button_label', :count => current_per_page) %> <span class="caret"></span>
<%= t(:'blacklight.search.per_page.button_label_html', :count => current_per_page) %> <span class="caret"></span>
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<%- per_page_options_for_select.each do |(label, count)| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_sort_widget.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if show_sort_and_per_page? and active_sort_fields.many? %>
<div id="sort-dropdown" class="sort-dropdown btn-group">
<button type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<%= t('blacklight.search.sort.label', :field =>sort_field_label(current_sort_field.key)) %> <span class="caret"></span>
<%= t('blacklight.search.sort.label_html', :field =>sort_field_label(current_sort_field.key)) %> <span class="caret"></span>
</button>

<div class="dropdown-menu" role="menu">
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ de:
invalid_solr_id: "Entschuldigung, Sie haben einen nicht vorhandenen Datensatz angefordert."
per_page:
label: '%{count}<span class="sr-only"> pro Seite</span>'
button_label: '%{count} pro Seite'
button_label: '%{count} pro Seite' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> pro Seite</span>'
title: 'Anzahl der Ergebnisse, die pro Seite angezeigt werden'
submit: 'Aktualisieren'
sort:
label: 'Ordnen nach %{field}'
label: 'Ordnen nach %{field}' # TODO: Remove during major release
label_html: 'Ordnen<span class="d-none d-sm-inline"> nach %{field}</span>'
submit: 'Ergebnisse ordnen'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ en:
invalid_solr_id: "Sorry, you have requested a record that doesn't exist."
per_page:
label: '%{count}<span class="sr-only"> per page</span>'
button_label: '%{count} per page'
button_label: '%{count} per page' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> per page</span>'
title: 'Number of results to display per page'
submit: 'Update'
sort:
label: 'Sort by %{field}'
label: 'Sort by %{field}' # TODO: Remove during major release
label_html: 'Sort<span class="d-none d-sm-inline"> by %{field}</span>'
submit: 'sort results'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ es:
invalid_solr_id: "Lo sentimos, usted ha solicitado un registro que no existe."
per_page:
label: '%{count}<span class="sr-only"> por página</span>'
button_label: '%{count} por página'
button_label: '%{count} por página' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> por página</span>'
title: 'El número de resultados a mostrar por página'
submit: 'Actualización'
sort:
label: 'Ordenar por %{field}'
label: 'Ordenar por %{field}' # TODO: Remove during major release
label_html: 'Ordenar<span class="d-none d-sm-inline"> por %{field}</span>'
submit: 'Resultados de ordenación'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ fr:
invalid_solr_id: "Vous avez demandé une notice qui n'existe pas."
per_page:
label: '%{count}<span class="sr-only"> par page</span>'
button_label: '%{count} par page'
button_label: '%{count} par page' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> par page</span>'
title: 'Nombre de résultats à afficher par page'
submit: 'mettre à jour'
sort:
label: 'Trier par %{field}'
label: 'Trier par %{field}' # TODO: Remove during major release
label_html: 'Trier<span class="d-none d-sm-inline"> par %{field}</span>'
submit: 'trier les résultats'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ hu:
invalid_solr_id: "Elnézést, de az Ön által kért rekord nem létezik."
per_page:
label: '%{count}<span class="sr-only"> oldalanként</span>'
button_label: '%{count} oldalanként'
button_label: '%{count} oldalanként' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> oldalanként</span>'
title: 'Az eredmények száma oldalanként'
submit: 'Frissítés'
sort:
label: 'Rendezés %{field}'
label: 'Rendezés %{field}' # TODO: Remove during major release
label_html: 'Rendezés<span class="d-none d-sm-inline"> %{field}</span>'
submit: 'Eredmények rendezése'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ it:
invalid_solr_id: "Il numero di scheda richiesto non esiste."
per_page:
label: '%{count}<span class="sr-only"> per pagina</span>'
button_label: '%{count} per pagina'
button_label: '%{count} per pagina' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
title: 'Risultati per pagina'
submit: 'Aggiorna'
sort:
label: 'Ordina per %{field}'
label: 'Ordina per %{field}' # TODO: Remove during major release
label_html: 'Ordina<span class="d-none d-sm-inline"> per %{field}</span>'
submit: 'Ordina i risultati'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ nl:
invalid_solr_id: "Sorry, u vroeg een onbestaande record op."
per_page:
label: '%{count}<span class="sr-only"> per pagina</span>'
button_label: '%{count} per pagina'
button_label: '%{count} per pagina' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
title: 'Toon aantal zoekresultaten per pagina'
submit: 'Update'
sort:
label: 'Sorteer op %{field}'
label: 'Sorteer op %{field}' # TODO: Remove during major release
label_html: 'Sorteer<span class="d-none d-sm-inline"> op %{field}</span>'
submit: 'sorteer resultaten'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ pt-BR:
invalid_solr_id: "Desculpe, você solicitou um cadastro que não existe."
per_page:
label: '%{count}<span class="hide-text"> por página</span>'
button_label: '%{count} por página'
button_label: '%{count} por página' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> por página</span>'
title: 'Número de resultados para mostrar por página'
submit: 'Atualizar'
sort:
label: 'Ordenar por %{field}'
label: 'Ordenar por %{field}' # TODO: Remove during major release
label_html: 'Ordenar<span class="d-none d-sm-inline"> por %{field}</span>'
submit: 'ordenar resultados'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ sq:
invalid_solr_id: "Na vjen keq, ju keni kërkuar një të dhënë që nuk ekziston."
per_page:
label: '%{count}<span class="sr-only"> për faqe</span>'
button_label: '%{count} për faqe'
button_label: '%{count} për faqe' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> për faqe</span>'
title: 'Numri i rezultateve që do të shfaqen për faqe'
submit: 'Përditëso'
sort:
label: 'Klasifikoj sipas %{field}'
label: 'Klasifikoj sipas %{field}' # TODO: Remove during major release
label_html: 'Klasifikoj<span class="d-none d-sm-inline"> sipas %{field}</span>'
submit: 'klasifiko rezultatet'
form:
search_field:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/blacklight.zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ zh:
invalid_solr_id: "抱歉,你要找的结果不存在。"
per_page:
label: '%{count}<span class="sr-only"> 每页</span>'
button_label: '%{count} 每页'
button_label: '%{count} 每页' # TODO: Remove during major release
button_label_html: '%{count}<span class="d-none d-sm-inline"> 每页</span>'
title: '每页显示结果数'
submit: '更新'
sort:
label: '按 %{field} 排序'
label: '按 %{field} 排序' # TODO: Remove during major release
label_html: '<span class="d-none d-sm-inline">按 %{field} </span>排序'
submit: '排序'
form:
search_field:
Expand Down

0 comments on commit 0ad267a

Please sign in to comment.