Skip to content

Commit 013d84f

Browse files
add definition lists for income terms
1 parent 64ff4b5 commit 013d84f

File tree

4 files changed

+26
-41
lines changed

4 files changed

+26
-41
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@
7171
"single": "To estimate your benefits, we will need the following information from your {{year}} tax return:"
7272
},
7373
"info": {
74-
"CDB": "<strong>CDB:</strong> Canada Disability Benefit",
74+
"CDB": "<dt>CDB:</dt><dd>Canada Disability Benefit</dd>",
7575
"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.",
7676
"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.",
7777
"net-income": "Line 23600 on your tax return. If your net income is negative, enter '0'",
7878
"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.",
7979
"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.",
8080
"partner-net-income": "Line 23600 on your spouse/partners tax return. If your the net income is negative, enter '0'",
81-
"RDSP": "<strong>RDSP:</strong> Registered Disability Savings Plan",
82-
"UCCB": "<strong>UCCB:</strong> Universal Child Care Benefit",
81+
"RDSP": "<dt>RDSP:</dt><dd>Registered Disability Savings Plan</dd>",
82+
"UCCB": "<dt>UCCB:</dt><dd>Universal Child Care Benefit</dd>",
8383
"working-income": {
8484
"items": [
8585
"Employment income (line 10100)",

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'],
37+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd'],
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'],
86+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em', 'dl', 'dt', 'dd'],
8787
},
8888
});
8989

frontend/app/routes/estimator/step-income.tsx

+21-36
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,8 @@ export default function StepIncome({ actionData, loaderData, matches, params }:
305305
<div className="my-4 space-y-4">
306306
<Collapsible summary={<>{t('estimator:income.fields.claimed-income.info-label')}</>}>
307307
<div className="space-y-4">
308-
<p>
309-
<Trans i18nKey={'estimator:income.info.UCCB'} />
310-
</p>
311-
<p>
312-
<Trans i18nKey={'estimator:income.info.RDSP'} />
313-
</p>
314-
<p>
315-
<Trans i18nKey={'estimator:income.info.CDB'} />
316-
</p>
308+
<DefinitionList />
309+
317310
<p>
318311
<Trans i18nKey={'estimator:income.info.claimed-income'} />
319312
</p>
@@ -336,15 +329,7 @@ export default function StepIncome({ actionData, loaderData, matches, params }:
336329
<div className="my-4 space-y-4">
337330
<Collapsible summary={<>{t('estimator:income.fields.claimed-repayment.info-label')}</>}>
338331
<div className="space-y-4">
339-
<p>
340-
<Trans i18nKey={'estimator:income.info.UCCB'} />
341-
</p>
342-
<p>
343-
<Trans i18nKey={'estimator:income.info.RDSP'} />
344-
</p>
345-
<p>
346-
<Trans i18nKey={'estimator:income.info.CDB'} />
347-
</p>
332+
<DefinitionList />
348333
<p>
349334
<Trans i18nKey={'estimator:income.info.claimed-repayment'} />
350335
</p>
@@ -368,15 +353,7 @@ export default function StepIncome({ actionData, loaderData, matches, params }:
368353
<div className="my-4 space-y-4">
369354
<Collapsible summary={<>{t('estimator:income.fields.partner.claimed-income.info-label')}</>}>
370355
<div className="space-y-4">
371-
<p>
372-
<Trans i18nKey={'estimator:income.info.UCCB'} />
373-
</p>
374-
<p>
375-
<Trans i18nKey={'estimator:income.info.RDSP'} />
376-
</p>
377-
<p>
378-
<Trans i18nKey={'estimator:income.info.CDB'} />
379-
</p>
356+
<DefinitionList />
380357
<p>
381358
<Trans i18nKey={'estimator:income.info.partner-claimed-income'} />
382359
</p>
@@ -401,15 +378,7 @@ export default function StepIncome({ actionData, loaderData, matches, params }:
401378
<div className="my-4 space-y-4">
402379
<Collapsible summary={<>{t('estimator:income.fields.partner.claimed-repayment.info-label')}</>}>
403380
<div className="space-y-4">
404-
<p>
405-
<Trans i18nKey={'estimator:income.info.UCCB'} />
406-
</p>
407-
<p>
408-
<Trans i18nKey={'estimator:income.info.RDSP'} />
409-
</p>
410-
<p>
411-
<Trans i18nKey={'estimator:income.info.CDB'} />
412-
</p>
381+
<DefinitionList />
413382
<p>
414383
<Trans i18nKey={'estimator:income.info.partner-claimed-repayment'} />
415384
</p>
@@ -452,4 +421,20 @@ export default function StepIncome({ actionData, loaderData, matches, params }:
452421
</FetcherErrorSummary>
453422
</div>
454423
);
424+
425+
function DefinitionList() {
426+
return (
427+
<dl className="mt-2 space-y-2 [&>div>dd]:ml-2 [&>div>dd]:inline [&>div>dt]:inline [&>div>dt]:font-bold">
428+
<div>
429+
<Trans i18nKey={'estimator:income.info.UCCB'} />
430+
</div>
431+
<div>
432+
<Trans i18nKey={'estimator:income.info.RDSP'} />
433+
</div>
434+
<div>
435+
<Trans i18nKey={'estimator:income.info.CDB'} />
436+
</div>
437+
</dl>
438+
);
439+
}
455440
}

0 commit comments

Comments
 (0)