cds-snc / c19-benefits-node

Answer some questions to find which federal programs can help you https://covid-benefits.alpha.canada.ca/. - Répondez à quelques questions pour trouver quels programmes d’aide financière fédéraux s’offrent à vous https://covid-prestations.alpha.canada.ca/.
MIT License
2 stars 4 forks source link

Fix language toggle on Results screen #364

Closed dsamojlenko closed 4 years ago

dsamojlenko commented 4 years ago

Closes #361

Fixes the language switching bug on the Results screen. When on the results screen, if you switched language, you would lose your results.

Introduced in #338, this bug was due to the language switch link not preserving the querystring parameters required for the results screen to display.

To fix, I added a middleware helper for use in the languageLink.njk template. This helper will accept the current route object, and a selected language. It will return the language-specific route, with the querystring intact.

CalvinRodo commented 4 years ago

so this works but I'm wondering if query strings need to comply with OLA Requirements.

CalvinRodo commented 4 years ago

I'm not seeing anything about query strings here but it might be covered under the policy: https://www.tbs-sct.gc.ca/pol/doc-eng.aspx?id=26164#sec6.6

6.6.3.2 (Website addresses) Primary domain names provide equal treatment to both official languages and accurately represent the Website's primary purpose in both official languages by using at least one of the following: unilingual names for each official language (e.g. “youth” and “jeunesse”) or a term or terms with the same meaning and spelling in both official languages (e.g. “justice”).

CalvinRodo commented 4 years ago

I'm going to approve this for now and I'm following up with CDS policy folks.