Skip to content

Commit e24efa8

Browse files
adds abbr tags and definition lists to improve a11y (#242)
1 parent ac7e014 commit e24efa8

15 files changed

+643
-451
lines changed

frontend/app/.server/locales/common-en.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"colon": ":",
23
"meta": {
34
"author": "Employment and Social Development Canada",
45
"description": "The Canada Disability Benefit Estimator is a tool to find out how much money you could get from the Canada Disability Benefit. This is not an application for benefits.",

frontend/app/.server/locales/common-fr.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"colon": "\u00a0:",
23
"meta": {
34
"author": "Emploi et Développement social Canada",
45
"description": "L'Estimateur de la prestation canadienne pour les personnes handicapées est un outil pour déterminer le montant que vous pourriez recevoir de la Prestations canadiennes des personnes handicapées. Il ne s'agit pas d'une demande de prestations.",

frontend/app/.server/locales/estimator-en.json

+22-20
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"fields": {
66
"claimed-income": {
77
"error": {
8-
"invalid": "Your UCCB and RDSP income is invalid"
8+
"invalid": "Your <abbr>UCCB</abbr> and <abbr>RDSP</abbr> income is invalid"
99
},
1010
"info-label": "Information",
11-
"label": "Your UCCB and RDSP income"
11+
"label": "Your <abbrUCCB>UCCB</abbrUCCB> and <abbrRDSP>RDSP</abbrRDSP> income"
1212
},
1313
"claimed-repayment": {
1414
"error": {
15-
"invalid": "Your UCCB and RDSP repayment is invalid"
15+
"invalid": "Your <abbr>UCCB</abbr> and <abbr>RDSP</abbr> repayment is invalid"
1616
},
1717
"info-label": "Information",
18-
"label": "Your UCCB and RDSP repayment"
18+
"label": "Your <abbrUCCB>UCCB</abbrUCCB> and <abbrRDSP>RDSP</abbrRDSP> repayment"
1919
},
2020
"net-income": {
2121
"error": {
@@ -28,17 +28,17 @@
2828
"partner": {
2929
"claimed-income": {
3030
"error": {
31-
"invalid": "Your partner's UCCB and RDSP income is invalid"
31+
"invalid": "Your partner's <abbr>UCCB</abbr> and <abbr>RDSP</abbr> income is invalid"
3232
},
3333
"info-label": "Information",
34-
"label": "Your partner's UCCB and RDSP income"
34+
"label": "Your partner's <abbrUCCB>UCCB</abbrUCCB> and <abbrRDSP>RDSP</abbrRDSP> income"
3535
},
3636
"claimed-repayment": {
3737
"error": {
38-
"invalid": "Your partner's UCCB and RDSP repayment is invalid"
38+
"invalid": "Your partner's <abbr>UCCB</abbr> and <abbr>RDSP</abbr> repayment is invalid"
3939
},
4040
"info-label": "Information",
41-
"label": "Your partner's UCCB and RDSP repayment"
41+
"label": "Your partner's <abbrUCCB>UCCB</abbrUCCB> and <abbrRDSP>RDSP</abbrRDSP> repayment"
4242
},
4343
"net-income": {
4444
"error": {
@@ -70,16 +70,17 @@
7070
"married": "To estimate your benefits, we will need the following information from your {{year}} tax return and your partner's {{year}} tax return.",
7171
"single": "To estimate your benefits, we will need the following information from your {{year}} tax return:"
7272
},
73+
7374
"info": {
74-
"CDB": "<dt>CDB:</dt><dd>Canada Disability Benefit</dd>",
75+
"CDB": { "term": "CDB", "text": "Canada Disability Benefit" },
7576
"claimed-income": "Income claimed by you (line 11700 and line 12500 of your tax return). If field is left blank, we will assume it is zero.",
7677
"claimed-repayment": "Repayment claimed by you (line 21300 and line 23200 of your tax return). If field is left blank, we will assume it is zero.",
7778
"net-income": "Line 23600 on your tax return. If your net income is negative, enter '0'",
7879
"partner-claimed-income": "Income claimed by your spouse/partner (line 11700 and line 12500 of their tax return). If field is left blank, we will assume it is zero.",
7980
"partner-claimed-repayment": "Repayment claimed by your spouse/partner (line 21300 and line 23200 of their tax return). If field is left blank, we will assume it is zero.",
8081
"partner-net-income": "Line 23600 on your spouse/partners tax return. If your the net income is negative, enter '0'",
81-
"RDSP": "<dt>RDSP:</dt><dd>Registered Disability Savings Plan</dd>",
82-
"UCCB": "<dt>UCCB:</dt><dd>Universal Child Care Benefit</dd>",
82+
"RDSP": { "term": "RDSP", "text": "Registered Disability Savings Plan" },
83+
"UCCB": { "term": "UCCB", "text": "Universal Child Care Benefit" },
8384
"working-income": {
8485
"items": [
8586
"Employment income (line 10100)",
@@ -98,7 +99,6 @@
9899
"page-title": "Step 2 of 2: Income"
99100
},
100101
"index": {
101-
"about": "The CDB Estimator is a tool to help users estimate their potential Canada Disability Benefit amount",
102102
"breadcrumb": "Estimator",
103103
"content": {
104104
"completion-time": "It will take about 5 to 10 minutes to complete.",
@@ -126,20 +126,22 @@
126126
"marital-status": {
127127
"additional-info": {
128128
"common-law": {
129+
"text": "you are living in a conjugal relationship with someone to whom you are not married and to whom at least one of the following situations applies. They:",
129130
"item1": "have been living with you for at least 12 continuous months. This includes any period you were separated for less than 90 days because of a breakdown in your relationship",
130131
"item2": "are the parent of your child by birth or adoption",
131132
"item3": "have custody and control of your child (or had custody and control immediately before the child turned 19 years of age) and your child is wholly dependent on that person for support",
132-
"text": "<strong>Common-law:</strong> you are living in a conjugal relationship with someone to whom you are not married and to whom at least one of the following situations applies. They:"
133+
"term": "Common-law:"
133134
},
134-
"divorced": "<strong>Divorced:</strong> you were married and are now legally divorced",
135-
"married": "<strong>Married:</strong> you are legally married to someone.",
135+
"divorced": { "term": "Divorced:", "text": "you were married and are now legally divorced" },
136+
"married": { "term": "Married:", "text": "you are legally married to someone." },
136137
"separated": {
137-
"p1": "<strong>Separated:</strong> you have been living apart from your spouse or common-law partner because of a breakdown in the relationship for a period of at least 90 days and you have not reconciled.",
138-
"p2": "Once you have been separated for 90 days, the effective day of your separation is the date you started living apart. You would still be considered to have a spouse or common-law partner if there is no breakdown in the relationship and you were living apart for reasons such as work, studies, or health problems.",
139-
"p3": "Note: Generally, you are not considered separated if your spouse or common-law partner is incarcerated or does not live in Canada, as long as there is no breakdown in your relationship"
138+
"term": "Separated:",
139+
"text": "you have been living apart from your spouse or common-law partner because of a breakdown in the relationship for a period of at least 90 days and you have not reconciled.",
140+
"p1": "Once you have been separated for 90 days, the effective day of your separation is the date you started living apart. You would still be considered to have a spouse or common-law partner if there is no breakdown in the relationship and you were living apart for reasons such as work, studies, or health problems.",
141+
"p2": "Note: Generally, you are not considered separated if your spouse or common-law partner is incarcerated or does not live in Canada, as long as there is no breakdown in your relationship"
140142
},
141-
"single": "<strong>Single:</strong> you are single and another status does not apply",
142-
"widowed": "<strong>Widowed:</strong> your spouse or common-law partner is deceased."
143+
"single": { "term": "Single:", "text": "you are single and another status does not apply" },
144+
"widowed": { "term": "Widowed:", "text": "your spouse or common-law partner is deceased." }
143145
},
144146
"breadcrumb": "Marital Status",
145147
"fields": {

frontend/app/.server/locales/estimator-fr.json

+25-20
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"fields": {
66
"claimed-income": {
77
"error": {
8-
"invalid": "Votre revenu de PUGE et REEI est invalide"
8+
"invalid": "Votre revenu de <abbr>PUGE</abbr> et <abbr>REEI</abbr> est invalide"
99
},
1010
"info-label": "Information",
11-
"label": "Votre revenu de PUGE et REEI"
11+
"label": "Votre revenu de <abbrUCCB>PUGE</abbrUCCB> et <abbrRDSP>REEI</abbrRDSP>"
1212
},
1313
"claimed-repayment": {
1414
"error": {
15-
"invalid": "Votre remboursement de PUGE et REEI est invalide"
15+
"invalid": "Votre remboursement de <abbr>PUGE</abbr> et <abbr>REEI</abbr> est invalide"
1616
},
1717
"info-label": "Information",
18-
"label": "Votre remboursement de PUGE et REEI"
18+
"label": "Votre remboursement de <abbrUCCB>PUGE</abbrUCCB> et <abbrRDSP>REEI</abbrRDSP>"
1919
},
2020
"net-income": {
2121
"error": {
@@ -28,17 +28,17 @@
2828
"partner": {
2929
"claimed-income": {
3030
"error": {
31-
"invalid": "Le revenu de PUGE et REEI de votre partenaire est invalide"
31+
"invalid": "Le revenu de <abbr>PUGE</abbr> et <abbr>REEI</abbr> de votre partenaire est invalide"
3232
},
3333
"info-label": "Information",
34-
"label": "Le revenu de PUGE et REEI de votre partenaire"
34+
"label": "Le revenu de <abbrUCCB>PUGE</abbrUCCB> et <abbrRDSP>REEI</abbrRDSP> de votre partenaire"
3535
},
3636
"claimed-repayment": {
3737
"error": {
38-
"invalid": "Le remboursement de PUGE et REEI de votre partenaire est invalid"
38+
"invalid": "Le remboursement de <abbr>PUGE</abbr> et <abbr>REEI</abbr> de votre partenaire est invalid"
3939
},
4040
"info-label": "Information",
41-
"label": "Le remboursement de PUGE et REEI de votre partenaire"
41+
"label": "Le remboursement de <abbrUCCB>PUGE</abbrUCCB> et <abbrRDSP>REEI</abbrRDSP> de votre partenaire"
4242
},
4343
"net-income": {
4444
"error": {
@@ -70,16 +70,17 @@
7070
"married": "Pour estimer vos prestations, nous aurons besoin des renseignements suivants de votre déclaration de revenus de {{year}} et de la déclaration de revenus de {{year}} de votre partenaire.",
7171
"single": "Pour estimer vos prestations, nous aurons besoin des renseignements suivants de votre déclaration de revenus de {{year}}. "
7272
},
73+
7374
"info": {
74-
"CDB": "<dt>PCPH\u00A0:</dt><dd>Prestation canadienne des personnes handicapées</dd>",
75+
"CDB": { "term": "PCPH", "text": "Prestation canadienne des personnes handicapées" },
7576
"claimed-income": "Revenu que vous avez demandé (ligne 11700 et ligne 12500 de votre déclaration de revenus). Si le champ est laisse vide, nous supposerons qu'il est égal à zéro.",
7677
"claimed-repayment": "Remboursement que vous avez demandé (ligne 21300 et ligne 23200 de votre déclaration de revenus). Si le champ est laisse vide, nous supposerons qu'il est égal à zéro.",
7778
"net-income": "Ligne 23600 de votre déclaration. Si votre revenu net est négatif, entrez '0'",
7879
"partner-claimed-income": "Revenu que votre conjoint a demandé (ligne 11700 et ligne 12500 de leur déclaration de revenus). Si le champ est laisse vide, nous supposerons qu'il est égal à zéro.",
7980
"partner-claimed-repayment": "Remboursement que votre conjoint a demandé (ligne 21300 et ligne 23200 de leur déclaration de revenus). Si le champ est laisse vide, nous supposerons qu'il est égal à zéro.",
8081
"partner-net-income": "Ligne 23600 de la déclaration de votre conjoint.",
81-
"RDSP": "<dt>REEI\u00A0:</dt><dd>Revenus d'un régime enregistré d'épargne-invalidité</dd>",
82-
"UCCB": "<dt>PUGE\u00A0:</dt><dd>Prestation universelle pour la garde d'enfants</dd>",
82+
"RDSP": { "term": "REEI", "text": "Revenus d'un régime enregistré d'épargne-invalidité" },
83+
"UCCB": { "term": "PUGE", "text": "Prestation universelle pour la garde d'enfants" },
8384
"working-income": {
8485
"items": [
8586
"Revenus d'emploi (linge 10100)",
@@ -98,7 +99,6 @@
9899
"page-title": "Étape 2 de 2\u00A0: Revenu"
99100
},
100101
"index": {
101-
"about": "L'estimateur de la PCPH est un outil pour aider les utilisateurs à estimer le montant potentiel de leur Prestation canadienne pour les personnes handicapées",
102102
"breadcrumb": "Estimateur",
103103
"content": {
104104
"completion-time": "Il vous faudra environ 5 à 10 minutes pour obtenir une estimation.",
@@ -126,20 +126,25 @@
126126
"marital-status": {
127127
"additional-info": {
128128
"common-law": {
129+
"term": "Conjoint de fait\u00a0:",
129130
"item1": "elle vit avec vous depuis au moins 12 mois sans interruption. Cela comprend les périodes de moins de 90 jours où vous avez vécu séparément en raison de la rupture de votre union;",
130131
"item2": "elle est le parent de votre enfant, par la naissance ou l'adoption;",
131132
"item3": "elle a la garde, la surveillance et la charge entière de votre enfant (ou elle en avait la garde et la surveillance juste avant que l'enfant atteigne l'âge de 19 ans).",
132-
"text": "<strong>Conjoint de fait\u00a0:</strong> vous vivez en relation conjugale avec une personne avec qui vous n'êtes pas marié et à qui au moins l'une des situations suivantes s'applique\u00a0:"
133+
"text": "vous vivez en relation conjugale avec une personne avec qui vous n'êtes pas marié et à qui au moins l'une des situations suivantes s'applique\u00a0:"
133134
},
134-
"divorced": "<strong>Divorcé\u00a0:</strong> vous étiez marié et êtes maintenant divorcé légalement",
135-
"married": "<strong>Marié\u00a0:</strong> vous êtes légalement marié à quelqu'un.",
135+
"divorced": { "term": "Divorcé\u00a0:", "text": "vous étiez marié et êtes maintenant divorcé légalement" },
136+
"married": { "term": "Marié\u00a0:", "text": "vous êtes légalement marié à quelqu'un." },
136137
"separated": {
137-
"p1": "<strong>Séparé\u00a0:</strong> vous vivez séparément de votre époux ou conjoint de fait depuis 90 jours ou plus en raison de la rupture de votre union, et il n'y a pas de réconciliation.",
138-
"p2": "Lorsque vous êtes séparé depuis 90 jours, la date d'entrée en vigueur de votre séparation est le jour où vous et votre époux ou conjoint de fait avez commencé à vivre séparément. Vous êtes toujours considéré comme ayant un époux ou un conjoint de fait s'il n'y a pas de rupture de votre union et que vous vivez séparément pour des raisons telles que le travail, les études ou des problèmes de santé.",
139-
"p3": "Remarque\u00a0: Généralement, vous n'êtes pas considéré séparé si votre époux ou conjoint de fait est détenu dans une prison ou ne vit pas au Canada, tant qu'il n'y a pas de rupture de votre union."
138+
"term": "Séparé\u00a0:",
139+
"text": "vous vivez séparément de votre époux ou conjoint de fait depuis 90 jours ou plus en raison de la rupture de votre union, et il n'y a pas de réconciliation.",
140+
"p1": "Lorsque vous êtes séparé depuis 90 jours, la date d'entrée en vigueur de votre séparation est le jour où vous et votre époux ou conjoint de fait avez commencé à vivre séparément. Vous êtes toujours considéré comme ayant un époux ou un conjoint de fait s'il n'y a pas de rupture de votre union et que vous vivez séparément pour des raisons telles que le travail, les études ou des problèmes de santé.",
141+
"p2": "Remarque\u00a0: Généralement, vous n'êtes pas considéré séparé si votre époux ou conjoint de fait est détenu dans une prison ou ne vit pas au Canada, tant qu'il n'y a pas de rupture de votre union."
140142
},
141-
"single": "<strong>Célibataire\u00a0:</strong> vous êtes célibataire et aucune des situations ci-dessus ne s'applique à vous",
142-
"widowed": "<strong>Veuf\u00a0:</strong> votre époux ou conjoint de fait est décédé."
143+
"single": {
144+
"term": "Célibataire\u00a0:",
145+
"text": "vous êtes célibataire et aucune des situations ci-dessus ne s'applique à vous"
146+
},
147+
"widowed": { "term": "Veuf\u00a0:", "text": "votre époux ou conjoint de fait est décédé." }
143148
},
144149
"breadcrumb": "État matrimonial",
145150
"fields": {

frontend/app/components/input-field.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { cn } from '~/utils/tailwind-utils';
99
export interface InputFieldProps extends ComponentProps<'input'> {
1010
beforeInput?: React.ReactNode;
1111
afterInput?: React.ReactNode;
12-
errorMessage?: string;
12+
errorMessage?: string | React.ReactNode;
1313
helpMessagePrimary?: React.ReactNode;
1414
helpMessagePrimaryClassName?: string;
1515
helpMessageSecondary?: React.ReactNode;
1616
helpMessageSecondaryClassName?: string;
17-
label: string;
17+
label: string | React.ReactNode;
1818
name: string;
1919
type?: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
2020
}

frontend/app/i18n-config.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function initI18next(namespace: Namespace): Promise<i18n> {
3434
backend: { loadPath: `/api/translations?ns={{ns}}&lng={{lng}}&v=${BUILD_REVISION}` },
3535
interpolation: { escapeValue: false },
3636
react: {
37-
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd'],
37+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd', 'abbr'],
3838
},
3939
});
4040

frontend/app/i18n-config.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function initI18next(language?: Language): Promise<i18n> {
8383
throw new AppError(`Missing translation key: ${key}`, ErrorCodes.MISSING_TRANSLATION_KEY);
8484
},
8585
react: {
86-
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd'],
86+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd', 'abbr'],
8787
},
8888
});
8989

0 commit comments

Comments
 (0)