Browse Source

Wording in translation files

Prototyping
Rachael Booth 8 months ago
parent
commit
da1833a082
  1. 30
      app/models/form/lettings/questions/gender_identity1.rb
  2. 14
      config/locales/forms/questions/2023/en.yml
  3. 14
      config/locales/forms/questions/2024/en.yml

30
app/models/form/lettings/questions/gender_identity1.rb

@ -2,29 +2,21 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex1" @id = "sex1"
@check_answer_label = "Lead tenant’s gender identity" @check_answer_label = I18n.t("forms.questions.#{form.start_date.year}.sex1.check_answer_label")
@header = "Which of these best describes the lead tenant’s gender identity?" @header = I18n.t("forms.questions.#{form.start_date.year}.sex1.header")
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = ANSWER_OPTIONS @question_number = I18n.t("forms.questions.#{form.start_date.year}.sex1.question_number")
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hint_text = I18n.t("forms.questions.#{form.start_date.year}.sex1.hint_text")
end end
ANSWER_OPTIONS = { def answer_options
"F" => { "value" => "Female" }, {
"M" => { "value" => "Male" }, "F" => { "value" => I18n.t("forms.questions.#{form.start_date.year}.sex1.options.F") },
"X" => { "value" => "Non-binary" }, "M" => { "value" => I18n.t("forms.questions.#{form.start_date.year}.sex1.options.M") },
"X" => { "value" => I18n.t("forms.questions.#{form.start_date.year}.sex1.options.X") },
"divider" => { "value" => true }, "divider" => { "value" => true },
"R" => { "value" => "Tenant prefers not to say" }, "R" => { "value" => I18n.t("forms.questions.#{form.start_date.year}.sex1.options.R") },
}.freeze }
def hint_text
if form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
else
"The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
end
end end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze
end end

14
config/locales/forms/questions/2023/en.yml

@ -0,0 +1,14 @@
en:
forms:
questions:
2023:
sex1:
header: "Which of these best describes the lead tenant’s gender identity?"
check_answer_label: "Lead tenant’s gender identity"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_number: 33
options:
F: "Female"
M: "Male"
X: "Non-binary"
R: "Tenant prefers not to say"

14
config/locales/forms/questions/2024/en.yml

@ -0,0 +1,14 @@
en:
forms:
questions:
2024:
sex1:
header: "Which of these best describes the lead tenant’s gender identity?"
check_answer_label: "Lead tenant’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_number: 32
options:
F: "Female"
M: "Male"
X: "Non-binary"
R: "Tenant prefers not to say"
Loading…
Cancel
Save