From f0ae10fa5753029947d0af808a24898acbaf210f Mon Sep 17 00:00:00 2001 From: Ian Dickinson Date: Fri, 31 Jul 2020 14:33:03 +0100 Subject: [PATCH] More i18n text extractions Continuing #233, extracting text from the Rails comparison page --- app/views/compare/show.html.haml | 29 +++++++++++++++++------------ config/locales/en.yml | 8 ++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/views/compare/show.html.haml b/app/views/compare/show.html.haml index 8bad1a9e..51e3074c 100644 --- a/app/views/compare/show.html.haml +++ b/app/views/compare/show.html.haml @@ -1,19 +1,22 @@ .grid-row .column-full %article.c-compare - %h2.o-heading--2 Compare UKHPI statistics across locations + %h2.o-heading--2 + = t('compare.show.heading') %p.u-muted - Select up to five locations to compare any UKHPI statistic, for a range of dates. + = t('compare.show.prompt') .c-location-compare--non-js.u-js-hidden %form.c-compare__form{ action: compare_path, method: 'get' } %p - %label{ for: 'select-in' } Compare + %label{ for: 'select-in' } + = t('action.compare').titlecase %select#select-in{ name: 'in' } - UkhpiDataCube::INDICATORS.each do |indicator| %option{ value: indicator.slug, selected: @view_state.selected_indicator == indicator.slug } = indicator.label - %label{ for: 'select-st' } for + %label{ for: 'select-st' } + = t('preposition.for') %select#select-st{ name: 'st' } - UkhpiDataCube::THEMES.each_value do |theme| %optgroup{ label: theme.label } @@ -21,16 +24,18 @@ %option{ value: stat.slug, selected: @view_state.selected_statistic == stat.slug } = stat.label %label{ for: 'from-date' } - from - %span.u-sr-only dd/mm/yyyy day two digits, month two digits, year four digits + = t('preposition.from') + %span.u-sr-only + = t('browse.edit.form.dates_format_sr') %input#from-date{ type: 'date', name: 'from', value: @view_state.from_date } %label{ for: 'to-date' } - to - %span.u-sr-only dd/mm/yyyy day two digits, month two digits, year four digits + = t('preposition.to') + %span.u-sr-only + = t('browse.edit.form.dates_format_sr') %input#to-date{ type: 'date', name: 'to', value: @view_state.to_date } %p.c-compare__locations-prompt - Between: + = t('preposition.between').titlecase %ul.c-compare__locations-list - @view_state.selected_locations.each do |location| %li.c-compare__location @@ -43,7 +48,7 @@ Add another location: %input{ type: 'text', name: 'location-term', value: @view_state.search_term } %button{ type: 'submit', value: 'search', name: 'form-action' } - Search + = t('action.search') - if @view_state.search_results %p Search results: @@ -54,7 +59,7 @@ = location.label %p %button{ type: 'submit' } - Update comparison + = t('action.update_comparison') - unless @view_state.search? - if (msg = @view_state.unavailable_statistic_indicator?) @@ -65,7 +70,7 @@ %thead %tr %th{ scope: 'col' } - Date + = t('label.date') - @view_state.selected_locations.each do |loc| %th{ scope: 'col' } = loc.label diff --git a/config/locales/en.yml b/config/locales/en.yml index 7ca58e87..035eb470 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -57,6 +57,11 @@ en: summary: "* Locations matching search term %{sterm} of type %{stype}:" more: "* … and %{n_more} more" + compare: + show: + heading: "* Compare UKHPI statistics across locations" + prompt: "* Select up to five locations to compare any UKHPI statistic, for a range of dates." + theme: property_type: "* Type of property" buyer_status: "* Buyer status" @@ -107,6 +112,7 @@ en: for: "* for" to: "* to" from: "* from" + between: "* between" action: change: "* change" @@ -119,6 +125,8 @@ en: about: "* about UKHPI" search: "* search" show_result: "* show result" + compare: "* compare" + update_comparison: "* update comparison" # old-------------