Skip to content

Add LanguageSelector to pages that do not render the Header component (PP-5158) - #201

Merged
PoorBillyPilgrim merged 3 commits into
mainfrom
bugfix/multi-library-language-switcher
Sep 25, 2026
Merged

PoorBillyPilgrim merged 3 commits into
mainfrom
bugfix/multi-library-language-switcher

Conversation

@PoorBillyPilgrim

Copy link
Copy Markdown
Contributor

Description

The LanguageSelector menu has been added to several pages:

  • The multi-library home page
  • The cross-library item landing page
  • The Open eBooks landing page
  • The "Signed Out" security notice page

A small update was also made to the library filter search input width that improved its spacing on smaller screens:

Before After
image image

Motivation and Context

When the CPW was first internationalized, the LanguageSelector was only added to the Header component, as this was a component that rendered on many of the main screens available to a user. However, the Header is only rendered within pages wrapped with the Layout component - which is used to provide the Header and Footer components to pages that are used for "site-wide navigation." This change excluded the above-mentioned pages. No visual indicator rendered to alert a user that they could change the locale for that catalog instance. This led to a poorer user experience for users who might a) end up on a page in a locale other than their own, and/or b) be unaware that their catalog could be navigated in a familiar language.

Jira PP-5158

How Has This Been Tested?

  • Manually tested from a local server on a desktop in Firefox, Chrome, and Safari and tested in Safari on an iPhone
  • New unit tests check if LanguageSelector renders based on appConfig.enableLanguageSelector flag

Checklist:

  • [N/A] I have updated the documentation accordingly.
  • All new and existing tests passed.

@PoorBillyPilgrim PoorBillyPilgrim added the bug Something isn't working label Sep 25, 2026

@tdilauro tdilauro 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.

This looks great! 🎉

One suggestion below to reduce code duplication and possible divergence, but this can go in as is.

Comment thread src/components/ItemLandingPage.tsx Outdated
Comment on lines +25 to +42
<div
sx={{
display: "flex",
flexDirection: ["column", "row"],
justifyContent: "space-between"
}}
>
<h1 sx={{ order: [2, 1] }}>
{t("itemLandingPage.findLibrary", "Find a Library")}
</h1>
<LanguageSelector
sx={{
order: [1, 2],
width: "fit-content",
alignSelf: ["end", "unset"]
}}
/>
</div>

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.

It looks like this is exactly duplicated in MultiLibraryHome.tsx ll. 60-77. Might be worth making a helper component to keep them from diverging.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36155433474

Coverage decreased (-0.3%) to 29.819%

Details

  • Coverage decreased (-0.3%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (1 of 2 lines covered, 50.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/components/layouts/MultiLibraryLandingPageHeader.tsx 2 1 50.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2122
Covered Lines: 733
Line Coverage: 34.54%
Relevant Branches: 1520
Covered Branches: 353
Branch Coverage: 23.22%
Branches in Coverage %: Yes
Coverage Strength: 9.61 hits per line

💛 - Coveralls

@PoorBillyPilgrim
PoorBillyPilgrim merged commit 5671382 into main Sep 25, 2026
7 checks passed
@PoorBillyPilgrim
PoorBillyPilgrim deleted the bugfix/multi-library-language-switcher branch September 25, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants