Skip to content

Commit

Permalink
Use i18n keys for search form labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Aug 29, 2016
1 parent c359d63 commit ee47698
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/views/collections/_search_form.html.erb
@@ -1,7 +1,7 @@
<%= form_for presenter, method: :get, class: "well form-search" do |f| %>
<label class="sr-only">Search Collection <%= presenter.title_or_label %></label>
<label class="sr-only"><%= t('curation_concerns.collections.search_form.label', title: presenter.title_or_label) %></label>
<div class="input-group">
<%= text_field_tag :cq, params[:cq], class: "collection-query form-control", placeholder: "Search Collection", size: '30', type: "search", id: "collection_search" %>
<%= text_field_tag :cq, params[:cq], class: "collection-query form-control", placeholder: t('curation_concerns.collections.search_form.placeholder'), size: '30', type: "search", id: "collection_search" %>
<div class="input-group-btn">
<button type="submit" class="btn btn-primary" id="collection_submit"><i class="glyphicon glyphicon-search"></i> Go</button>
</div>
Expand Down
4 changes: 4 additions & 0 deletions config/locales/curation_concerns.en.yml
Expand Up @@ -6,6 +6,10 @@ en:
index:
type_tabs:
all: All
collections:
search_form:
placeholder: "Search Collection"
label: "Search Collection %{title}"
division:
name: "Your Division at Institution"
homepage_url: "#"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/collection_spec.rb
Expand Up @@ -86,7 +86,7 @@
within('#document_' + collection.id) do
click_link('collection title')
end
expect(page).to have_content 'Search Collection Test collection title', visible: false
expect(page).to have_selector '.sr-only', text: 'Search Collection Test collection title', visible: false
expect(page).to have_content 'Test collection title'
expect(page).to have_content 'collection description'
# Should have search results / contents listing
Expand Down

0 comments on commit ee47698

Please sign in to comment.