From 7a7072e40d52e7e4274533fb6d1eeba7da082217 Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 14 Jul 2022 14:35:03 +0100 Subject: [PATCH] Put location questions and hints into a translation file --- app/views/locations/edit.html.erb | 22 +++++++++++----------- app/views/locations/new.html.erb | 20 ++++++++++---------- config/locales/en.yml | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/app/views/locations/edit.html.erb b/app/views/locations/edit.html.erb index 45cb3bba5..696c24c53 100644 --- a/app/views/locations/edit.html.erb +++ b/app/views/locations/edit.html.erb @@ -16,17 +16,17 @@ <%= f.govuk_text_field :postcode, label: { size: "m" }, - hint: { text: "For example, SW1P 4DF." }, + hint: { text: I18n.t("hints.location.postcode") }, width: 5 %> <%= f.govuk_text_field :name, - label: { text: "Location name (optional)", size: "m" }, - hint: { text: "This is how you refer to this location within your organisation" } %> + label: { text: I18n.t("questions.location.name"), size: "m" }, + hint: { text: I18n.t("hints.location.name")} %> <%= 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, - 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 %> <% 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, :id, :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) } %> <%= f.govuk_collection_radio_buttons :wheelchair_adaptation, wheelchair_user_selection, :id, :name, - hint: { text: "This includes stairlifts, ramps, level-access showers or grab rails" }, - legend: { text: "Are the majority of units in this location built or adapted to wheelchair-user standards?", size: "m" } %> + hint: { text: I18n.t("hints.location.wheelchair_adaptation") }, + legend: { text: I18n.t("questions.location.wheelchair_adaptation"), size: "m" } %> <%= 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 %> - + <%= govuk_section_break(visible: true, size: "m") %> <% another_location_selection = %w[Yes no].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> @@ -56,7 +56,7 @@ :id, :name, 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" %> diff --git a/app/views/locations/new.html.erb b/app/views/locations/new.html.erb index 94c34ed8b..f8cf6321d 100644 --- a/app/views/locations/new.html.erb +++ b/app/views/locations/new.html.erb @@ -16,17 +16,17 @@ <%= f.govuk_text_field :postcode, label: { size: "m" }, - hint: { text: "For example, SW1P 4DF." }, + hint: { text: I18n.t("hints.location.postcode") }, width: 5 %> <%= f.govuk_text_field :name, - label: { text: "Location name (optional)", size: "m" }, - hint: { text: "This is how you refer to this location within your organisation" } %> + label: { text: I18n.t("questions.location.name"), size: "m" }, + hint: { text: I18n.t("hints.location.name") } %> <%= 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, - 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 %> <% 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, :id, :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) } %> @@ -43,11 +43,11 @@ wheelchair_user_selection, :id, :name, - hint: { text: "This includes stairlifts, ramps, level-access showers or grab rails" }, - legend: { text: "Are the majority of units in this location built or adapted to wheelchair-user standards?", size: "m" } %> + hint: { text:I18n.t("hints.location.wheelchair_adaptation")}, + legend: { text: I18n.t("questions.location.wheelchair_adaptation"), size: "m" } %> <%= 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 %> <%= govuk_section_break(visible: true, size: "m") %> @@ -59,7 +59,7 @@ :id, :name, 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" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4c3083b10..8e1470ffc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -287,6 +287,22 @@ en: code_required: "Security code is required" 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: one_argument: "This is based on the tenant’s work situation: %{ecstat1}" title_text: