Skip to content

Switch: Fix uppercase labels to sentence case in all locales - #8055

Open
clairedenning wants to merge 1 commit into
masterfrom
switch-update-260629
Open

Switch: Fix uppercase labels to sentence case in all locales#8055
clairedenning wants to merge 1 commit into
masterfrom
switch-update-260629

Conversation

@clairedenning

@clairedenning clairedenning commented Jun 29, 2026

Copy link
Copy Markdown

Proposed behaviour

Switch labels must be in Sentence case
image

Current behaviour

Switch labels are in UPPER CASE
image

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

@clairedenning
clairedenning requested review from a team as code owners June 29, 2026 11:26
@clairedenning clairedenning changed the title fix(switch): Fix uppercase labels to sentence case in all locales Switch: Fix uppercase labels to sentence case in all locales Jun 29, 2026
@clairedenning clairedenning self-assigned this Jun 29, 2026
@ljemmo
ljemmo force-pushed the switch-update-260629 branch 3 times, most recently from e5d3f51 to 8b814ab Compare July 14, 2026 12:51
@ljemmo
ljemmo requested a review from Copilot July 14, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates Switch on/off label translations to use sentence case (instead of all-caps) across the provided locale files, aligning the component text with the design requirement and updating associated unit tests accordingly.

Changes:

  • Updated switch.on / switch.off locale strings from uppercase to sentence case in multiple locales.
  • Updated Switch unit tests to reflect sentence-case labels.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/locales/pt-pt.ts Switch on/off labels changed from ON/OFF to On/Off.
src/locales/fr-ca.ts Switch on/off labels changed from OUI/NON to Oui/Non.
src/locales/es-es.ts Switch on/off labels changed from SÍ/NO to Sí/No.
src/locales/en-gb.ts Switch on/off labels changed from ON/OFF to On/Off.
src/locales/de-de.ts Switch on/off labels changed from EIN/AUS to Ein/Aus.
src/components/switch/switch.test.tsx Updated assertions/descriptions for the new sentence-case labels.

Comment on lines +106 to 109
it("renders Off and On text outside the track when not loading", () => {
renderSwitch();
expect(screen.getByText(/^(ON|OFF)$/i)).toBeInTheDocument();
expect(screen.getByText(/^(On|Off)$/i)).toBeInTheDocument();
});
Comment on lines 232 to 235
it("hides On/Off state text when loading", () => {
renderSwitch({ loading: true });
expect(screen.queryByText(/^(ON|OFF)$/i)).not.toBeInTheDocument();
expect(screen.queryByText(/^(On|Off)$/i)).not.toBeInTheDocument();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants