feat: localize selection shortcuts - #2754
Merged
webbrain-one merged 3 commits intoAug 11, 2026
Merged
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
Localizes selection shortcuts and context menus across all 23 interface locales while aligning fixed-action responses with the selected language.
Changes:
- Adds mirrored localization bundles and localized translation targets.
- Applies live locale/RTL updates and response-language prompting.
- Expands unit and browser-fixture coverage.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/run.js |
Tests localization coverage, parity, and prompts. |
test/fixtures/run.mjs |
Tests live localized shortcut behavior. |
src/chrome/src/selection-shortcut-i18n.js |
Adds Chrome localization bundle. |
src/firefox/src/selection-shortcut-i18n.js |
Adds Firefox localization bundle. |
src/chrome/src/context-menu-storage.js |
Adds response-language instructions. |
src/firefox/src/context-menu-storage.js |
Mirrors localized prompt handling. |
src/chrome/src/content/selection-shortcut.js |
Localizes the floating shortcut. |
src/firefox/src/content/selection-shortcut.js |
Mirrors localized shortcut behavior. |
src/chrome/src/background.js |
Localizes and rebuilds Chrome menus. |
src/firefox/src/background.js |
Localizes and rebuilds Firefox menus. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+157
to
+158
| export function buildContextMenuPrompt(selectionText, language = '') { | ||
| return wrapSelectedPageText(selectionText, GENERIC_CONTEXT_MENU_INSTRUCTION + responseLanguageInstruction(language)); |
Comment on lines
+157
to
+158
| export function buildContextMenuPrompt(selectionText, language = '') { | ||
| return wrapSelectedPageText(selectionText, GENERIC_CONTEXT_MENU_INSTRUCTION + responseLanguageInstruction(language)); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Owner
|
Great addition! There are still a couple of open items, if we can close them this'll get merged right away! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wbLocalechanges and apply live locale/RTL updates to the closed-shadow selection surfaceselection_onlygrounding and nonce-based untrusted-content boundaryCloses #2746.
Why
The extension already stores the selected interface locale, but the two selection-menu surfaces hardcoded English labels. Fixed actions also omitted that locale when building their model prompt, so a Chinese UI could still produce an English explanation. The implementation resolves one static, offline bundle in the background for both surfaces and adds the allowlisted response-language instruction outside the selected page-content boundary.
Test plan
npm test— passed (1624 passed, 0 failed; security corpus60/60)npm run test:fixtures— new Chrome/Firefox localization, live-switch, RTL, and fixed-action language cases pass; overall149 passed, 2 failed, with the same two pre-existing selection-dialog keyboard-focus failures as cleanmain(147 passed, 2 failedbefore these two new cases)npm run test:webmcp— both functional smoke assertions printPASS; the process then hits the existing 30-second cleanup timeoutnpm run test:ci— still hits the existing workflow/source assertion mismatch inci/test.mjs; this PR does not modify either filegit diff --check