Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use explicit question specific options in i18n YAML #2005

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3afe16b
TEMP: List missing option translations
floehopper Oct 13, 2015
b9bee57
Remove unused flow-level option from am-i-getting-minimum-wage
floehopper Oct 13, 2015
7310c5a
Explicit Q-specific options for am-i-getting-minimum-wage
floehopper Oct 13, 2015
b0ebd25
Explicit Q-specific options for benefit-cap-calculator
floehopper Oct 13, 2015
335ed80
Explicit Q-specific options for calculate-married-couples-allowance
floehopper Oct 13, 2015
2f1b5ef
Remove unused flow-level option from calculate-state-pension
floehopper Oct 13, 2015
34988b3
Explicit Q-specific options for calculate-state-pension
floehopper Oct 13, 2015
f95f196
Explicit Q-specific options for calculate-statutory-sick-pay
floehopper Oct 13, 2015
d872fd4
Explicit Q-specific options for calculate-your-child-maintenance
floehopper Oct 13, 2015
9bf855c
Remove unused flow-level options from calculate-your-holiday-entitlement
floehopper Oct 13, 2015
ab357c6
Explicit Q-specific options for calculate-your-holiday-entitlement
floehopper Oct 13, 2015
33cbcaa
Explicit Q-specific options for childcare-costs-for-tax-credits
floehopper Oct 13, 2015
1054602
Explicit Q-specific options for inherits-someone-dies-without-will
floehopper Oct 13, 2015
0dc86f7
Remove unused flow-level options from maternity-paternity-calculator
floehopper Oct 13, 2015
ec0ed10
Explicit Q-specific options for maternity-paternity-calculator
floehopper Oct 13, 2015
aba0c26
Don't rely on option fallback for maternity-paternity-calculator
floehopper Oct 13, 2015
9c1b124
Remove unused flow-level option from minimum-wage-calculator-employers
floehopper Oct 13, 2015
9f03c86
Explicit Q-specific options for minimum-wage-calculator-employers
floehopper Oct 13, 2015
7070a17
Explicit Q-specific options for pip-checker
floehopper Oct 13, 2015
c1f3635
Explicit Q-specific options for register-a-birth
floehopper Oct 13, 2015
54ce678
Explicit Q-specific options for register-a-death
floehopper Oct 13, 2015
40b8b3f
Add explicit key for question in report-a-lost-or-stolen-passport
floehopper Oct 13, 2015
5431b0d
Explicit Q-specific options for report-a-lost-or-stolen-passport
floehopper Oct 13, 2015
c9eaedf
Remove unused Q-specific options from simplified-expenses-checker
floehopper Oct 13, 2015
8b166bb
Explicit Q-specific options for simplified-expenses-checker
floehopper Oct 13, 2015
d4b5b72
Remove unused flow-level options from state-pension-topup
floehopper Oct 13, 2015
4029cd7
Explicit Q-specific options for towing-rules
floehopper Oct 13, 2015
2fbfe60
Explicit Q-specific options for uk-benefits-abroad
floehopper Oct 13, 2015
7d997fb
Use explicit Q-specific options in SmartAnswersControllerTest
floehopper Oct 13, 2015
f50ec82
Use explicit Q-specific options in CheckboxQuestionsTest
floehopper Oct 13, 2015
84846b9
Use explicit Q-specific options in DataPartialsTest
floehopper Oct 13, 2015
f1f884a
Revert "TEMP: List missing option translations"
floehopper Oct 13, 2015
c623582
Fail fast if explicit Q-specific option is missing
floehopper Oct 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/smart_answer/i18n_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ def translate_and_render(subkey, html: true)
end

def translate_option(option)
translate!("options.#{option}") || begin
I18n.translate!("#{@i18n_prefix}.options.#{option}", @state.to_hash)
rescue I18n::MissingTranslationData
option
end
translate!("options.#{option}", rescue_exception: false)
end

def translate!(subkey)
def translate!(subkey, rescue_exception: true)
I18n.translate!("#{i18n_node_prefix}.#{subkey}", state_for_interpolation)
rescue I18n::MissingTranslationData
rescue I18n::MissingTranslationData => e
raise e unless rescue_exception
nil
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
en-GB:
flow:
am-i-getting-minimum-wage:
options:
"yes": "Yes"
"no": "No"

# Q1
what_would_you_like_to_check?:
title: "What would you like to check?"
Expand Down Expand Up @@ -36,6 +32,7 @@ en-GB:
were_you_an_apprentice?:
title: "Were you an apprentice at the time?"
options:
"no": "No"
apprentice_under_19: "Apprentice under 19"
apprentice_over_19: "Apprentice aged 19 and over and in your first year"
# Q3
Expand Down Expand Up @@ -120,12 +117,14 @@ en-GB:
is_provided_with_accommodation?:
title: "Does your employer provide you with accommodation?"
options:
"no": "No"
yes_free: "Yes, the accommodation is free"
yes_charged: "Yes, the accommodation is charged for"
# Q9 Past
was_provided_with_accommodation?:
title: "Did your employer provide you with accommodation?"
options:
"no": "No"
yes_free: "Yes, the accommodation was free"
yes_charged: "Yes, the accommodation was charged for"
# Q10
Expand Down
12 changes: 9 additions & 3 deletions lib/smart_answer_flows/locales/en/benefit-cap-calculator.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
en-GB:
flow:
benefit-cap-calculator:
options:
"yes": "Yes"
"no": "No"

# Q1
receive_housing_benefit?:
title: Do you receive Housing Benefit?
options:
"yes": "Yes"
"no": "No"

# Q2
working_tax_credit?:
title: Do you qualify for Working Tax Credit?
hint: You don't need to be getting Working Tax Credit, only qualify for it.
options:
"yes": "Yes"
"no": "No"

# Q3
receiving_exemption_benefits?:
Expand All @@ -26,6 +29,9 @@ en-GB:
- War Widow’s or War Widower’s Pension
- Armed Forces Compensation Scheme
- Armed Forces Independence Payment
options:
"yes": "Yes"
"no": "No"

# Q4
receiving_non_exemption_benefits?:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ en-GB:
flow:
calculate-married-couples-allowance:
section_name: Money and tax
options:
"no": "No"
"yes": "Yes"
#Q1
were_you_or_your_partner_born_on_or_before_6_april_1935?:
title: Were you or your partner born before 6 April 1935?
hint: You must be married or in a civil partnership to qualify.
options:
"no": "No"
"yes": "Yes"
error_message: Please choose 'Yes' or 'No'
#Q2
did_you_marry_or_civil_partner_before_5_december_2005?:
title: Did you marry before 5 December 2005?
hint: Before this date the husband's income is used to work out your allowance, after this date it's the income of the highest earner.
options:
"no": "No"
"yes": "Yes"
error_message: Please choose 'Yes' or 'No'
#Q3
whats_the_husbands_date_of_birth?:
Expand All @@ -39,6 +42,9 @@ en-GB:
#Q7
paying_into_a_pension?:
title: Are you paying into a pension?
options:
"no": "No"
"yes": "Yes"
#Q8
how_much_expected_contributions_before_tax?:
title: How much do you expect to pay into a pension where your contributions are made before tax is taken away?
Expand Down
13 changes: 9 additions & 4 deletions lib/smart_answer_flows/locales/en/calculate-state-pension.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
en-GB:
flow:
calculate-state-pension:
options:
"yes": "Yes"
"no": "No"
none: "None of the above"
phrases:
carers_allowance_women_hint: Don’t count years when you opted for the reduced National Insurance rate for married women and widows.
carers_allowance_women_ni_reduced_years_before_2010: Don’t count years before April 2010 when you opted for the reduced National Insurance rate for married women and widows.
Expand Down Expand Up @@ -39,6 +35,9 @@ en-GB:
title: Have you ever opted to pay the reduced National Insurance rate for married women and widows (also known as the married woman’s stamp)?
hint: |
Opting to pay the reduced rate means you chose to pay a lower rate of National Insurance while you were employed or you chose not to pay Class 2 contributions while you were self-employed.
options:
"yes": "Yes"
"no": "No"
## Q4
years_paid_ni?:
title: How many years have you worked and paid National Insurance contributions from the age of 19?
Expand All @@ -58,6 +57,9 @@ en-GB:
## Q6
received_child_benefit?:
title: Have you ever claimed Child Benefit, cared for someone sick or disabled or worked as a registered foster carer?
options:
"yes": "Yes"
"no": "No"
## Q7
years_of_benefit?:
title: "Before 6 April 2010 how many years did any of the following apply:"
Expand Down Expand Up @@ -95,3 +97,6 @@ en-GB:
## Q11
lived_or_worked_outside_uk?:
title: Have you lived or worked outside the UK?
options:
"yes": "Yes"
"no": "No"
36 changes: 21 additions & 15 deletions lib/smart_answer_flows/locales/en/calculate-statutory-sick-pay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,30 @@ en-GB:
[Download ‘Form SSP1, employee not entitled to SSP’ (PDF, 130KB)](http://www.dwp.gov.uk/advisers/claimforms/ssp1.pdf)
$D

options:
"yes": "Yes"
"no": "No"
statutory_maternity_pay: Statutory Maternity Pay
maternity_allowance: Maternity Allowance
ordinary_statutory_paternity_pay: Ordinary Statutory Paternity Pay
statutory_adoption_pay: Statutory Adoption Pay
additional_statutory_paternity_pay: Additional Statutory Paternity Pay

weekly: Weekly
fortnightly: Every 2 weeks
every_4_weeks: Every 4 weeks
monthly: Monthly - eg last day or Friday of a month
irregularly: Irregularly

# Q1
is_your_employee_getting?:
title: Is your employee getting any of the following?
hint: If none apply just click ‘Next step’
options:
statutory_maternity_pay: Statutory Maternity Pay
maternity_allowance: Maternity Allowance
ordinary_statutory_paternity_pay: Ordinary Statutory Paternity Pay
statutory_adoption_pay: Statutory Adoption Pay
additional_statutory_paternity_pay: Additional Statutory Paternity Pay

# Question 2
employee_tell_within_limit?:
title: Did your employee tell you they were sick and unable to come into work within 7 days of their first day of absence (or within your time limit)?
options:
"yes": "Yes"
"no": "No"

# Question 3
employee_work_different_days?:
title: Does your employee routinely work different days of the week?
options:
"yes": "Yes"
"no": "No"

# Question 4
first_sick_day?:
Expand All @@ -55,6 +52,9 @@ en-GB:
These are called ‘linked Periods of Incapacity for Work (PIW)’. Check if an employee’s [PIW links to a previous one.](/government/publications/statutory-sick-pay-tables-for-linking-periods-of-incapacity-for-work)

*[PIW]: Period of Incapacity for Work
options:
"yes": "Yes"
"no": "No"

# Question 6.1
linked_sickness_start_date?:
Expand All @@ -78,6 +78,12 @@ en-GB:
# Q7.2
how_often_pay_employee_pay_patterns?:
title: How often do you pay the employee?
options:
weekly: Weekly
fortnightly: Every 2 weeks
every_4_weeks: Every 4 weeks
monthly: Monthly - eg last day or Friday of a month
irregularly: Irregularly

# Question 8
last_payday_before_sickness?:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ en-GB:
pay_how_many_nights: On average, how many nights a year do the children stay over with you?
receive_how_many_nights: On average, how many nights a year do the children stay over with the parent paying child maintenance?

options:
"yes": "Yes"
"no": "No"

## Q1
are_you_paying_or_receiving?:
title: Will you be paying or receiving child maintenance payments?
Expand Down Expand Up @@ -61,6 +57,9 @@ en-GB:
- Widow’s pension
- Universal Credit with no earned income
hint: "In Scotland, this also includes: Skillseekers training, War Widow’s, Widower’s or Surviving Civil Partner’s Pension"
options:
"yes": "Yes"
"no": "No"

## Q4
gross_income_of_payee?:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,28 @@ en-GB:
* can give more paid holiday - this will be in the employment contract and is called 'contractual leave entitlement'
* must provide [holiday pay](/holiday-entitlement-rights/holiday-pay-the-basics "Holiday pay") during the statutory leave

options:
"days-worked-per-week": "days worked per week"
"hours-worked-per-week": "hours worked per week"
"casual-or-irregular-hours": "casual or irregular hours"
"annualised-hours": "annualised hours"
"compressed-hours": "compressed hours"
"shift-worker": "shifts"
"full-year": "for a full leave year"
"starting": "for someone starting part way through a leave year"
"leaving": "for someone leaving part way through a leave year"
"starting-and-leaving": "for someone starting and leaving part way through a leave year"
"5-days": "5 days per week"
"6-days": "6 days per week"
"6-or-7-days": "6 or 7 days per week"
"7-days": "7 days per week"

# Q1
basis_of_calculation?:
title: "Is the holiday entitlement based on:"
hint: |
Check the employment contract if you’re not sure about the holiday entitlement.
options:
"days-worked-per-week": "days worked per week"
"hours-worked-per-week": "hours worked per week"
"casual-or-irregular-hours": "casual or irregular hours"
"annualised-hours": "annualised hours"
"compressed-hours": "compressed hours"
"shift-worker": "shifts"

# Q2
calculation_period?:
title: "Do you want to work out holiday:"
options:
"full-year": "for a full leave year"
"starting": "for someone starting part way through a leave year"
"leaving": "for someone leaving part way through a leave year"
"starting-and-leaving": "for someone starting and leaving part way through a leave year"

# Q3
how_many_days_per_week?:
title: Number of days worked per week?
Expand Down Expand Up @@ -78,6 +76,11 @@ en-GB:
# Q15
shift_worker_basis?:
title: "Do you want to calculate the holiday:"
options:
"full-year": "for a full leave year"
"starting": "for someone starting part way through a leave year"
"leaving": "for someone leaving part way through a leave year"
"starting-and-leaving": "for someone starting and leaving part way through a leave year"

shift_worker_hours_per_shift?:
title: How many hours in each shift?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
en-GB:
flow:
childcare-costs-for-tax-credits:
options:
"yes": "Yes"
"no": "No"
weekly_same_amount: "Weekly, and I always pay the same amount"
weekly_diff_amount: "Weekly, and the amount I pay varies"
monthly_same_amount: "Monthly, and I always pay the same amount"
monthly_diff_amount: "Monthly, and the amount I pay varies"
other: "Other"

#Q1
currently_claiming?:
title: "Are you currently claiming tax credits for childcare costs?"
options:
"yes": "Yes"
"no": "No"

#Q2
how_often_use_childcare?:
Expand All @@ -25,14 +20,29 @@ en-GB:
#Q3
have_costs_changed?:
title: "Have the costs of your childcare changed since you last made your claim?"
options:
"yes": "Yes"
"no": "No"

#Q4
how_often_pay_1?:
title: "How often do you pay your childcare provider(s)?"
options:
weekly_same_amount: "Weekly, and I always pay the same amount"
weekly_diff_amount: "Weekly, and the amount I pay varies"
monthly_same_amount: "Monthly, and I always pay the same amount"
monthly_diff_amount: "Monthly, and the amount I pay varies"
other: "Other"

#Q5
how_often_pay_2?:
title: "How often do you pay your childcare provider(s)?"
options:
weekly_same_amount: "Weekly, and I always pay the same amount"
weekly_diff_amount: "Weekly, and the amount I pay varies"
monthly_same_amount: "Monthly, and I always pay the same amount"
monthly_diff_amount: "Monthly, and the amount I pay varies"
other: "Other"

#Q6
how_much_12_months_1?:
Expand Down Expand Up @@ -64,6 +74,9 @@ en-GB:

- you regularly use childcare, but pay more during school holidays than you do at term time
- the hours you use childcare change from week to week or month to month
options:
"yes": "Yes"
"no": "No"

#Q12
how_often_pay_providers?:
Expand All @@ -75,6 +88,7 @@ en-GB:
every_month: "Every calendar month"
termly: "Termly"
yearly: "Yearly"
other: "Other"

#Q13
how_much_fortnightly?:
Expand Down
Loading