Skip to content

DEP-233 and 235: add language switching in public and preview interfaces - #2870

Merged
NatSquared merged 6 commits into
DEP-234-authoring-language-switchingfrom
DEP-233-235-public-language-switcher
Jun 11, 2026
Merged

DEP-233 and 235: add language switching in public and preview interfaces#2870
NatSquared merged 6 commits into
DEP-234-authoring-language-switchingfrom
DEP-233-235-public-language-switcher

Conversation

@NatSquared

Copy link
Copy Markdown
Collaborator

Issue #: 🎟️ DEP-233 and 🎟️ DEP-235

Description of changes:

  • Feature Added language switcher to public, preview engagement pages
    • Added a common language switcher component that can be used to switch between language views within a language context.
    • Integrated the language switcher into the public engagement details page and the engagement preview page, allowing users to switch between available languages for the engagement content.
    • Improved the preview experience with a focus on language switching
    • Updated the widget components to support language switching and to display content in the selected language.

User Guide update ticket (if applicable):

    • Yes, a user guide update ticket has been created. (Link to ticket)
    • No, a user guide update ticket is not required.

Common component changes:

    • Yes, I have updated CONTRIBUTING.md and the docblocks to document any changes to the common components.
    • No, there are no changes to the common components.

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.64865% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.64%. Comparing base (951b1ed) to head (0babf2a).

Files with missing lines Patch % Lines
...ent/public/view/engagementTranslationResolution.ts 25.00% 48 Missing ⚠️
...engagement/public/view/EngagementWidgetDisplay.tsx 37.83% 23 Missing ⚠️
...c/services/widgetService/TimelineService/index.tsx 25.00% 3 Missing ⚠️
...mponents/engagement/public/view/EngagementHero.tsx 97.05% 1 Missing ⚠️
...s/engagement/public/view/EngagementSurveyBlock.tsx 87.50% 1 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                            @@
##           DEP-234-authoring-language-switching    #2870      +/-   ##
========================================================================
- Coverage                                 72.75%   72.64%   -0.12%     
========================================================================
  Files                                       532      533       +1     
  Lines                                     21489    21605     +116     
  Branches                                   1855     1819      -36     
========================================================================
+ Hits                                      15635    15694      +59     
- Misses                                     5844     5901      +57     
  Partials                                     10       10              
Flag Coverage Δ
api 84.21% <ø> (ø)
web 59.63% <48.64%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
web/src/components/layout/Header/PublicHeader.tsx 78.57% <100.00%> (ø)
web/src/models/widget.tsx 100.00% <ø> (ø)
...mponents/engagement/public/view/EngagementHero.tsx 89.77% <97.05%> (+2.67%) ⬆️
...s/engagement/public/view/EngagementSurveyBlock.tsx 80.55% <87.50%> (+2.29%) ⬆️
...c/services/widgetService/TimelineService/index.tsx 29.41% <25.00%> (+2.13%) ⬆️
...engagement/public/view/EngagementWidgetDisplay.tsx 51.92% <37.83%> (-26.65%) ⬇️
...ent/public/view/engagementTranslationResolution.ts 25.00% <25.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jareth-whitney jareth-whitney left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with this implementation of language switching. I'm excited to play around with this on on the test server. Nothing blocking, as per usual. Just check the following:

  • Check engagement start/end dates are being translated from UTC to local
  • Authentication-based CSS check (should be fine, just checking that it's not trying to hide anything)

<Await resolve={engagementInfo}>
{([engagement, startDate, endDate]: [Engagement, dayjs.Dayjs | null, dayjs.Dayjs | null]) => {
{([engagement, resolvedTranslationBundle]: [Engagement, TranslationBundle | undefined]) => {
const startDate = dayjs(engagement.start_date);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking the start/end date get converted from UTC.

menuName="Public Language Menu"
translationLanguages={translationLanguages}
currentLanguageCode={language}
top={isAuthenticated ? { xs: '8px', md: '12px' } : 0}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is just positioning based on whether or not an admin area control is present. Just making sure that this isn't security by obfuscation.

}
// If there is no extension, it is a link rather than a file
if (url.indexOf('.') === -1) {
if (!url.includes('.')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the small optimizations throughout

userEvent.click(dropdownMenu);
const englishMenuItem = await screen.findByRole('option', { name: 'English' });
expect(englishMenuItem).toBeInTheDocument();
expect(screen.getByText('engage')).toBeInTheDocument();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding some unit tests.

Comment thread CHANGELOG.MD
## June 10, 2026

- **Feature** Added language switcher to public, preview engagement pages [🎟️ DEP-233](https://citz-gdx.atlassian.net/browse/DEP-233) and [🎟️ DEP-235](https://citz-gdx.atlassian.net/browse/DEP-235)
- Added a common language switcher component that can be used to switch between language views within a language context.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for unifying the language switchers

@sonarqubecloud

Copy link
Copy Markdown

@NatSquared
NatSquared merged commit 8ac2f5d into DEP-234-authoring-language-switching Jun 11, 2026
10 checks passed
@NatSquared
NatSquared deleted the DEP-233-235-public-language-switcher branch June 11, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants