Skip to content

SegmentSkip: make labels translatable - #3250

Open
CrisBarreiro wants to merge 2 commits into
mainfrom
CrisBarreiro/segment-skip-localize-label
Open

CrisBarreiro wants to merge 2 commits into
mainfrom
CrisBarreiro/segment-skip-localize-label

Conversation

@CrisBarreiro

@CrisBarreiro CrisBarreiro commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1212227266948491/task/1220898355398037?focus=true

Description

Makes the SegmentSkip button labels ("Skip" and "Undo Skip") translatable. Stacked on #3246.

  • Moves "Skip" and "Undo Skip" (skipButton, undoSkipButton) into injected/src/locales/segment-skip/en/segment-skip.json, the file to upload to Smartling. It's named for the feature because Smartling needs unique file names per repo.
  • buildLocales.js bundles it into build/locales/segment-skip-locales.js.
  • The feature reads the locale from init(args) (de-DE → de) and picks the label from the bundled locale, falling back to English. Same approach as chrome-webstore-patching.

Until translations are committed, every locale shows the English labels.

Testing Steps

  • npm run build -w injected and check that injected/build/locales/segment-skip-locales.js contains skipButton and undoSkipButton.
  • npx playwright test segment-skip --reporter list in injected/: the existing tests still pass.
  • No new test: the button lives in a closed shadow root, so Playwright can't read its label.

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

🤖 Generated with Claude Code

@CrisBarreiro
CrisBarreiro added this pull request to stack #3251 November 25, 2026 14:04
@github-actions github-actions Bot added the semver-minor New feature — triggers minor version bump label Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

[Beta] Generated file diff

Time updated: Fri, 27 Nov 2026 16:43:34 GMT

Android
    - android/contentScope.js

File has changed

Apple
    - apple/contentScopeIsolated.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

New Files
    - locales/segment-skip-locales.js

❌ File only exists in new changeset

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Build Branch

Branch pr-releases/CrisBarreiro/segment-skip-localize-label
Commit f9ce653e07
Updated November 27, 2026 at 4:42:39 PM UTC

Static preview entry points

QR codes (mobile preview)
Entry point QR code
Docs QR for docs preview
Static pages QR for static pages preview
Integration pages QR for integration pages preview

Integration commands

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#pr-releases/CrisBarreiro/segment-skip-localize-label

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/CrisBarreiro/segment-skip-localize-label")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/CrisBarreiro/segment-skip-localize-label
git -C submodules/content-scope-scripts checkout origin/pr-releases/CrisBarreiro/segment-skip-localize-label
Pin to exact commit

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#f9ce653e0731623ee4406ae60d5ec0be9015f806

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "f9ce653e0731623ee4406ae60d5ec0be9015f806")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/CrisBarreiro/segment-skip-localize-label
git -C submodules/content-scope-scripts checkout f9ce653e0731623ee4406ae60d5ec0be9015f806

@CrisBarreiro
CrisBarreiro force-pushed the CrisBarreiro/segment-skip-localize-label branch from 95d2cf0 to cba6af0 Compare November 25, 2026 16:20
@CrisBarreiro CrisBarreiro changed the title SegmentSkip: localize the skip button label SegmentSkip: localize the skip and undo button labels Nov 25, 2026
@CrisBarreiro
CrisBarreiro force-pushed the CrisBarreiro/segment-skip-localize-label branch 2 times, most recently from 4ee98b6 to b0bcce5 Compare November 25, 2026 17:22
@CrisBarreiro
CrisBarreiro marked this pull request as ready for review November 25, 2026 17:32

@claude claude Bot 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@CrisBarreiro CrisBarreiro changed the title SegmentSkip: localize the skip and undo button labels SegmentSkip: update design to latest iteration Nov 25, 2026
@CrisBarreiro CrisBarreiro changed the title SegmentSkip: update design to latest iteration SegmentSkip: make labels translatable Nov 25, 2026
@CrisBarreiro
CrisBarreiro force-pushed the CrisBarreiro/segment-skip-localize-label branch from b0bcce5 to 8c18354 Compare November 26, 2026 13:47
@CrisBarreiro
CrisBarreiro force-pushed the CrisBarreiro/segment-skip-localize-label branch from 8c18354 to 9bd0eee Compare November 26, 2026 16:13
Base automatically changed from CrisBarreiro/segment-skip-highlight-color to main November 27, 2026 16:40
CrisBarreiro and others added 2 commits November 27, 2026 17:41
Move "Skip" into src/locales/segment-skip/en/segment-skip.json for Smartling,
bundle it with buildLocales.js, and pick the string by the platform locale,
falling back to English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add "Undo Skip" to segment-skip.json as undoSkipButton and look it up the
same way as the Skip label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CrisBarreiro
CrisBarreiro force-pushed the CrisBarreiro/segment-skip-localize-label branch from 9bd0eee to ae91909 Compare November 27, 2026 16:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor New feature — triggers minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants