diff --git a/app/helpers/copy_helper.rb b/app/helpers/copy_helper.rb new file mode 100644 index 000000000..ebea85379 --- /dev/null +++ b/app/helpers/copy_helper.rb @@ -0,0 +1,5 @@ +module CopyHelper + def translate(key, pluralise_condition: false) + I18n.t(key, count: pluralise_condition ? 2 : 1) + end +end diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb index d6c0c63d4..d035d9d2f 100644 --- a/app/models/form/sales/questions/buyer_previous.rb +++ b/app/models/form/sales/questions/buyer_previous.rb @@ -1,9 +1,13 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question + include CopyHelper + def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "soctenant" - @check_answer_label = "#{joint_purchase ? 'Any buyers were' : 'Buyer was a'} registered provider#{'s' if joint_purchase}, housing association or local authority tenant#{'s' if joint_purchase} immediately before this sale?" - @header = "#{joint_purchase ? 'Were any of the buyers' : 'Was the buyer a'} private registered provider#{'s' if joint_purchase}, housing association or local authority tenant#{'s' if joint_purchase} immediately before this sale?" + @check_answer_label = translate("check_answer_labels.soctenant", pluralise_condition: joint_purchase) + # @check_answer_label = I18n.t("check_answer_labels.soctenant", count: joint_purchase ? 2 : 1) + @header = translate("questions.soctenant", pluralise_condition: joint_purchase) + # @header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1) @type = "radio" @answer_options = ANSWER_OPTIONS end diff --git a/config/locales/en.yml b/config/locales/en.yml index 8665c022a..b38dce879 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -538,6 +538,9 @@ en: W: "Suitable for someone who uses a wheelchair and offers the full use of all rooms and facilities." A: "Fitted with stairlifts, ramps, level access showers or grab rails." N: "Not designed to wheelchair-user standards or fitted with any equipment or adaptations." + soctenant: + one: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?" + other: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?" hints: location: @@ -551,6 +554,11 @@ en: bulk_upload: needstype: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." + check_answer_labels: + soctenant: + one: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?" + other: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?" + warnings: location: deactivate: