Skip to content

Commit

Permalink
More i18n text extractions
Browse files Browse the repository at this point in the history
Continuing #233, extracting text from the Rails comparison page
  • Loading branch information
ijdickinson committed Jul 31, 2020
1 parent a417f36 commit f0ae10f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
29 changes: 17 additions & 12 deletions app/views/compare/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
.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 }
- theme.statistics.each do |stat|
%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
Expand All @@ -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:
Expand All @@ -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?)
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ en:
summary: "* Locations matching search term <code>%{sterm}</code> of type <code>%{stype}</code>:"
more: "* &hellip; 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"
Expand Down Expand Up @@ -107,6 +112,7 @@ en:
for: "* for"
to: "* to"
from: "* from"
between: "* between"

action:
change: "* change"
Expand All @@ -119,6 +125,8 @@ en:
about: "* about UKHPI"
search: "* search"
show_result: "* show result"
compare: "* compare"
update_comparison: "* update comparison"

# old-------------

Expand Down

0 comments on commit f0ae10f

Please sign in to comment.