You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8303849
Browse filesBrowse the repository at this point in the historyBrowse files
Translate the mail dialog, the Playground web server and the copy-path error (#647)
## Why
#630 is the last batch of #622. This PR is the part of it that doesn't
wait on the five open batches (#636, #643, #644, #645, #646): the mail
dialog, the Playground web server and the copy-path error were still
plain English, and `applyDoneMessage` spliced a verb and a noun into an
English sentence for any pair it had no sentence for.
## What changes
- The mail dialog: "From:", "To:", "CC:", "Date:", the Rendered and Raw
tabs, and the "Email" title of a mail with no subject.
- The Playground web server: its Start and Stop buttons, the loading
announcement, "Starting…", the panel's heading, "Stopped", and "Server
exited with code %d".
- The copy-path failure: the alert and the clipboard-unavailable message
in it.
- `applyDoneMessage`'s fallback is `_x('Done', 'an action that
finished')` instead of `` `${verb} the ${noun}` ``. No caller reaches it
today: the three in `use-apply-patch.jsx` pass only the five pairs it
has sentences for.
Not in this PR, because another open PR already wraps them or because
#630 says to wait for one:
| Item | Where |
|---|---|
| `COPY_BUTTON_LABELS` | #646 |
| "Dismiss" on the deep-link notice, "Choose application…" | #644 |
| "Setting up new site…" | #636 |
| `use-dev-server.jsx` leftovers | after #646 |
| `apply-card.cjs:191` period | after #645 |
| `project-type.cjs` `workItem.label` | after #643, #636, #644 |
| The full `--lang=en-XA` walk | after all five merge |
## How to test this
Two en-XA journeys cover this, and both are red without the change:
```bash
# from the repository root
npm run build:once
npx playwright test --project=journeys tests/e2e/journeys/i18n.spec.js -g "a mail the site sent|Playground web server"
```
- **a mail the site sent is fully translatable**: a mail on its Rendered
tab and its Raw tab, and a mail with no subject, whose dialog is titled
"Email".
- **the Playground web server is fully translatable**: stopped, starting
(including the live-region announcement), running, and after it exits
with code 1.
The English journeys in `mail.spec.js` still pass, so an English speaker
sees the same text as before.
What the journeys can't reach is the copy-path alert. It needs the
clipboard to refuse a write, and I couldn't stage that.
To look by hand (any platform, current head): run `npx electron .
--lang=en-XA` from the repository root, start a site's dev server, and
open a mail from the Email tray. Every label and both tabs show accented
and in brackets. The Playground web server only appears in a build that
ships `local-playground-web`, so a checkout won't show it.
**What must not have happened:** with no `--lang`, the mail dialog and
the web server read exactly as they did before.
## Risks and limitations
- Found while writing the web server journey: `@wordpress/a11y` adds a
screen-reader-only "Notifications" paragraph at DOM-ready, before the
app loads its locale, so it stays English. #630 doesn't list it, so it
isn't fixed here.
- The web server's other errors come from main (`'local-playground-web
directory not found.'`, or a thrown error) and stay English. That
belongs with the main-process strings, not this renderer batch.
## Related
Part of #630. Part of #622.
---
<details>
<summary>Review outcome</summary>
**4 [fix here] · 2 [follow-up]. All 4 fixed in c9c5c0c.** One more
finding was dropped as wrong (below).
- **Review:** completed by a separate agent with a fresh context,
against `.github/instructions/code-review.instructions.md`. Reviewed
head 4f8b808, base e94f507 (trunk). `npm run lint` clean, `npm test`
2033/2033.
- **Fixed:**
- The web server journey could pass with the loading announcement
unwrapped, because `speak()` writes outside the area scanned. It now
asserts `#a11y-speak-polite`.
- `__('Email')` only shows for a mail with no subject. The journey now
opens one.
- The `Done` fallback wasn't in the unit test that runs every sentence
through a catalog. It is now.
- A bare `__('Done')` would share a msgid with the `Done` button in
`@wordpress/components`. It now has a context.
Each new journey assertion was checked to fail with its string
unwrapped.
- **Deferred:**
- The mail journey excuses any text that is part of the mail. No label
is excused today, but matching whole text nodes would be stricter.
- The web server's main-process error strings (see Risks).
- **Dropped:** the finding that "Dismiss", "Choose application…",
`COPY_BUTTON_LABELS` and "Setting up new site…" were unwrapped. The
reviewer read the issues, not the PR diffs; #644, #646 and #636 wrap
them.
- **Since review:** 4f8b808 → c9c5c0c, which contains only the fixes
above. Lint, unit tests and the i18n and mail journeys were rerun on
c9c5c0c.
</details>
Nothing on screen changes in English, so there are no screenshots.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
(payload)=>{setWebUrl('');if(payload&&typeofpayload.code==='number'&&payload.code!==0)setWebError(`Server exited with code ${payload.code}`);}
442
+
// translators: %d: the code the server exited with, a number.
443
+
(payload)=>{setWebUrl('');if(payload&&typeofpayload.code==='number'&&payload.code!==0)setWebError(sprintf(__('Server exited with code %d'),payload.code));}
443
444
);
444
445
if(res&&res.ok&&res.url){
445
446
constu=String(res.url).replace(/\/$/,'/');
@@ -554,14 +555,14 @@ function App({ settingsState }) {
consttheMails=(text)=>[MAIL.subject,MAIL.from,MAIL.to,MAIL.cc,MAIL.raw,'Someone has requested a password reset.'].some((part)=>part.includes(text))||text.includes('2026');
0 commit comments