Browse Source

Put location questions and hints into a translation file

pull/744/head
Kat 3 years ago
parent
commit
7a7072e40d
  1. 22
      app/views/locations/edit.html.erb
  2. 20
      app/views/locations/new.html.erb
  3. 16
      config/locales/en.yml

22
app/views/locations/edit.html.erb

@ -16,17 +16,17 @@
<%= f.govuk_text_field :postcode, <%= f.govuk_text_field :postcode,
label: { size: "m" }, label: { size: "m" },
hint: { text: "For example, SW1P 4DF." }, hint: { text: I18n.t("hints.location.postcode") },
width: 5 %> width: 5 %>
<%= f.govuk_text_field :name, <%= f.govuk_text_field :name,
label: { text: "Location name (optional)", size: "m" }, label: { text: I18n.t("questions.location.name"), size: "m" },
hint: { text: "This is how you refer to this location within your organisation" } %> hint: { text: I18n.t("hints.location.name")} %>
<%= f.govuk_number_field :units, <%= f.govuk_number_field :units,
label: { text: "Total number of units at this location", size: "m" }, label: { text: I18n.t("questions.location.units"), size: "m" },
width: 2, width: 2,
hint: { text: "A unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff.s" }, hint: { text: I18n.t("hints.location.units") },
autofocus: true %> autofocus: true %>
<% type_of_units_selection = Location.type_of_units.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <% type_of_units_selection = Location.type_of_units.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
@ -34,20 +34,20 @@
type_of_units_selection, type_of_units_selection,
:id, :id,
:name, :name,
legend: { text: "What is this type of scheme?", size: "m" } %> legend: { text: I18n.t("questions.location.type_of_unit"), size: "m" } %>
<% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
<%= f.govuk_collection_radio_buttons :wheelchair_adaptation, <%= f.govuk_collection_radio_buttons :wheelchair_adaptation,
wheelchair_user_selection, wheelchair_user_selection,
:id, :id,
:name, :name,
hint: { text: "This includes stairlifts, ramps, level-access showers or grab rails" }, hint: { text: I18n.t("hints.location.wheelchair_adaptation") },
legend: { text: "Are the majority of units in this location built or adapted to wheelchair-user standards?", size: "m" } %> legend: { text: I18n.t("questions.location.wheelchair_adaptation"), size: "m" } %>
<%= f.govuk_date_field :startdate, <%= f.govuk_date_field :startdate,
legend: { text: "When did the first property in this location become available?", size: "m" }, legend: { text:I18n.t("questions.location.startdate"), size: "m" },
width: 20 %> width: 20 %>
<%= govuk_section_break(visible: true, size: "m") %> <%= govuk_section_break(visible: true, size: "m") %>
<% another_location_selection = %w[Yes no].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <% another_location_selection = %w[Yes no].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
@ -56,7 +56,7 @@
:id, :id,
:name, :name,
inline: true, inline: true,
legend: { text: "Do you want to add another location?", size: "m" } %> legend: { text: I18n.t("questions.location.add_another_location"), size: "m" } %>
<%= f.hidden_field :page, value: "edit" %> <%= f.hidden_field :page, value: "edit" %>

20
app/views/locations/new.html.erb

@ -16,17 +16,17 @@
<%= f.govuk_text_field :postcode, <%= f.govuk_text_field :postcode,
label: { size: "m" }, label: { size: "m" },
hint: { text: "For example, SW1P 4DF." }, hint: { text: I18n.t("hints.location.postcode") },
width: 5 %> width: 5 %>
<%= f.govuk_text_field :name, <%= f.govuk_text_field :name,
label: { text: "Location name (optional)", size: "m" }, label: { text: I18n.t("questions.location.name"), size: "m" },
hint: { text: "This is how you refer to this location within your organisation" } %> hint: { text: I18n.t("hints.location.name") } %>
<%= f.govuk_number_field :units, <%= f.govuk_number_field :units,
label: { text: "Total number of units at this location", size: "m" }, label: { text: I18n.t("questions.location.units"), size: "m" },
width: 2, width: 2,
hint: { text: "A unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff.s" }, hint: { text: I18n.t("hints.location.units") },
autofocus: true %> autofocus: true %>
<% type_of_units_selection = Location.type_of_units.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <% type_of_units_selection = Location.type_of_units.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
@ -35,7 +35,7 @@
type_of_units_selection, type_of_units_selection,
:id, :id,
:name, :name,
legend: { text: "What is this type of scheme?", size: "m" } %> legend: { text: I18n.t("questions.location.type_of_unit"), size: "m" } %>
<% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
@ -43,11 +43,11 @@
wheelchair_user_selection, wheelchair_user_selection,
:id, :id,
:name, :name,
hint: { text: "This includes stairlifts, ramps, level-access showers or grab rails" }, hint: { text:I18n.t("hints.location.wheelchair_adaptation")},
legend: { text: "Are the majority of units in this location built or adapted to wheelchair-user standards?", size: "m" } %> legend: { text: I18n.t("questions.location.wheelchair_adaptation"), size: "m" } %>
<%= f.govuk_date_field :startdate, <%= f.govuk_date_field :startdate,
legend: { text: "When did the first property in this location become available?", size: "m" }, legend: { text: I18n.t("questions.location.startdate"), size: "m" },
width: 20 %> width: 20 %>
<%= govuk_section_break(visible: true, size: "m") %> <%= govuk_section_break(visible: true, size: "m") %>
@ -59,7 +59,7 @@
:id, :id,
:name, :name,
inline: true, inline: true,
legend: { text: "Do you want to add another location?", size: "m" } %> legend: { text: I18n.t("questions.location.add_another_location"), size: "m" } %>
<%= f.govuk_submit "Save and continue" %> <%= f.govuk_submit "Save and continue" %>
</div> </div>

16
config/locales/en.yml

@ -287,6 +287,22 @@ en:
code_required: "Security code is required" code_required: "Security code is required"
code_incorrect: "Security code is incorrect" code_incorrect: "Security code is incorrect"
questions:
location:
name: "Location name (optional)"
units: "Total number of units at this location"
type_of_unit: "What is this type of scheme?"
wheelchair_adaptation: "Are the majority of units in this location built or adapted to wheelchair-user standards?"
startdate: "When did the first property in this location become available?"
add_another_location: "Do you want to add another location?"
hints:
location:
postcode: "For example, SW1P 4DF."
name: "This is how you refer to this location within your organisation"
units: "A unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff."
wheelchair_adaptation: "This includes stairlifts, ramps, level-access showers or grab rails"
test: test:
one_argument: "This is based on the tenant’s work situation: %{ecstat1}" one_argument: "This is based on the tenant’s work situation: %{ecstat1}"
title_text: title_text:

Loading…
Cancel
Save