From 7c87ccf47886b7bdb003f45f429ee2c86b2f934b Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Mon, 15 Jan 2018 18:57:19 -0500 Subject: [PATCH] search buttons: Make translation-ready * Add translation strings in `config/locales/search.en.yml` * Update `layouts/_search.html.haml` to use translation strings --- app/views/layouts/_search.html.haml | 4 ++-- config/locales/search.en.yml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 config/locales/search.en.yml diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml index fb5bcf9f..95de084d 100644 --- a/app/views/layouts/_search.html.haml +++ b/app/views/layouts/_search.html.haml @@ -7,9 +7,9 @@ .input-group = text_field_tag :search, params[:search], class: "form-control search-bar", aria: {label: t("search_bar.enter_location")} .input-group-btn - %button.btn.btn-light-purple.submit-search-button{type: "button", title: "Search", value: "Search", aria: { label: "Search" }} + %button.btn.btn-light-purple.submit-search-button{type: "button", title: t('.search'), value: t('.search'), aria: { label: t('.search') }} %i.fa.fa-search.fa-2x %i.fa.fa-refresh.fa-spin.fa-2x - %button.btn.btn-light-purple.current-location-button{type: "button", title: "Search by Current Location", aria: { label: "Search by Current Location" }, value: (splash ? "Search Current Location" : nil ) } + %button.btn.btn-light-purple.current-location-button{type: "button", title: t('.search-by-current-location'), aria: { label: t('.search-by-current-location') }, value: (splash ? t('.search-by-current-location') : nil ) } %i.fa.fa-location-arrow.fa-2x %i.fa.fa-refresh.fa-spin.fa-2x diff --git a/config/locales/search.en.yml b/config/locales/search.en.yml new file mode 100644 index 00000000..66fc9a07 --- /dev/null +++ b/config/locales/search.en.yml @@ -0,0 +1,6 @@ +en: + layouts: + search: + search: 'Search' + search-by-current-location: 'Search by Current Location' +