Skip to content

Commit

Permalink
i18n expand search options
Browse files Browse the repository at this point in the history
  • Loading branch information
camillevilla committed Jan 29, 2018
1 parent 9934c91 commit 8f3d3e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/views/spotlight/browse/_search_box.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@
<% if params[:browse_q]%>
<div class="browse-search-expand">
<% if search.count > 0 %>
<p>Your search matched <strong><%= search.count %> of <%= parent_search_count%> items</strong> in this browse category.</p>
<p>You can also <%= link_to "search all exhibit items for \"#{params[:browse_q]}\"", search_exhibit_catalog_path(current_exhibit, q: params[:browse_q]) %>.</p>
<p><%= t('spotlight.browse.search_box.success.result_number_html', search_size: search.count, parent_search_count: parent_search_count) %></p>
<p><%= t('spotlight.browse.search_box.success.expand_html',
search_url: search_exhibit_catalog_path(current_exhibit, q: params[:browse_q]),
browse_query: params[:browse_q]) %>
</p>
<% else %>
<p>Your search did not match any items in this browse category.</p>
<p>You can <%= link_to 'clear this search', exhibit_browse_path(current_exhibit, search)%> or try <%= link_to "searching all exhibit items for \"#{params[:browse_q]}\"", search_exhibit_catalog_path(current_exhibit, q: params[:browse_q]) %>.<p>
<p><%= t('spotlight.browse.search_box.zero_results.result_number') %></p>
<p><%= t('spotlight.browse.search_box.zero_results.expand_html',
clear_search_url: exhibit_browse_path(current_exhibit, search),
expand_search_url: search_exhibit_catalog_path(current_exhibit, q: params[:browse_q]),
browse_query: params[:browse_q])%>
</p>
<% end %>
</div>
<% end %>
Expand Down
6 changes: 6 additions & 0 deletions config/locales/spotlight.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,12 @@ en:
placeholder: Search…
label: Search within this browse category
submit: Search within browse category
success:
result_number_html: Your search matched <strong> %{search_size} of %{parent_search_count} items</strong> in this browse category.
expand_html: You can also <a href="%{expand_search_url}">search all exhibit items for "%{browse_query}"</a>.
zero_results:
result_number: Your search did not match any items in this browse category.
expand_html: You can <a href="%{clear_search_url}"> clear this search</a> or try <a href="%{expand_search_url}">searching all exhibit items for "%{browse_query}"</a>.
tags:
index:
title: "Curation - Tags"
Expand Down

0 comments on commit 8f3d3e1

Please sign in to comment.