Skip to content

[Bug:] i18n appears to be broken #4094

Description

@sydk-adhoc

Describe the Bug

MCT recently adopted the CMSDS Pagination component. It contains overridable translations for Previous and Next links, but the mobile-viewport-width content Page {X} of {XX} is not controlled by a prop, and only uses the CMSDS internal translation helper, t.

MCT uses both the setLanguage helper from CMSDS and also updates the html element's lang attribute anytime a user changes language using the switch in the MAX global header. But the component is not updating its content to reflect the language set using the helper or derived from the html lang attribute.

See code here and observe the value of the html lang attribute when switching from English to Spanish and back.

To reproduce

  • Go to https://imp.medicare.gov/plan-compare
  • Enter 21224
  • Select MA plans
  • Choose no extra help (low-income subsidy)
  • Choose to add no drugs
  • Choose to add no providers
  • On the plans results page, open devtools, narrow the viewport down to mobile-device width, scroll down to where the pagination component is rendered and showing Page 1 of 3 (or similar)
  • Scroll to the top, open the mobile menu using the hamburger icon, and choose "Cambiar a Espanol"
  • Scroll back to the bottom and observe that Page 1 of 3 has not changed to Spanish

Expected behavior

Either changing the html lang attribute (from en to es or vice-versa) or calling CMSDS's setLanguage helper with either en or es, or both, should update CMSDS components' internal translations.

Severity/Impact

High: Affects PI objectives, breaks 508 compliance, breaks application

Desktop Operating System

Mac OS

Desktop Browser Name

Chrome

Desktop Browser Version

149.0.7827.54

Device

N/A

Mobile Operating System

N/A

Mobile Browser Name

N/A

Mobile Browser Version

N/A

Additional context

I have tried all variations of using html lang or the CMSDS language helpers (one, not the other, both, choosing to update the URL with a lang query parameter or not -- we do), and no combination of changes trigger the Pagination component to update its internally translated content.

Codebase/Repository URL

https://github.com/CMSgov/oc-mct-frontend

Design System Version

Medicare 14.4.5

Existing branch or Pull request on Github

N/A

Team Name

MCT

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impacts: CoreImpacts the core DS primarily, changes may occur in other themes as well.Impacts: DocumentationIndicates that this item relates to documentationImpacts: HealthcareImpacts the Healthcare.gov theme directly.Impacts: MedicareImpacts the Medicare theme directly.Status: In JIRAIndicates that this item is also tracked in JiraStatus: Work In ProgressPR's that are not yet ready for reviewdependenciesPull requests that update a dependency filejavascriptPull requests that update javascript code

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions