[PR #1737] [CLOSED] refactor(website): move UI text out of scripts before translation #4788

Closed
opened 2026-10-31 00:55:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1737
Author: @kaoru0822-kitauji
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: refactor/website-i18n-prep


📝 Commits (7)

  • 3d34185 refactor(website): move UI text out of scripts before translation
  • dabcd78 refactor(website): keep page text when a script message is missing
  • 80f6365 refactor(website): run the website lane for the page-script test
  • ce58aeb feat(website): add language infrastructure for translated pages
  • 4db6ff4 feat(website): fit the language menu on narrow screens
  • 0fd4021 feat(website): keep translation tests independent of page text
  • c865e20 feat(website): translate Get started into Traditional Chinese (draft)

📊 Changes

43 files changed (+3342 additions, -162 deletions)

View changed files

📝 .github/workflows/website-check.yml (+4 -0)
📝 .github/workflows/website-pages.yml (+7 -0)
📝 scripts/ci/scopes.mjs (+1 -0)
➕ scripts/test-website-scripts.mjs (+481 -0)
📝 scripts/test-website.py (+212 -2)
📝 scripts/verify-website.py (+221 -8)
📝 scripts/website.py (+442 -28)
📝 website/AGENTS.md (+6 -2)
📝 website/README.md (+20 -8)
➕ website/locales/de.json (+34 -0)
➕ website/locales/en.json (+34 -0)
➕ website/locales/fr.json (+34 -0)
➕ website/locales/ja.json (+33 -0)
➕ website/locales/ko.json (+33 -0)
➕ website/locales/zh-hans.json (+33 -0)
➕ website/locales/zh-hant.json (+33 -0)
📝 website/public/assets/dino-demo.js (+42 -32)
📝 website/public/assets/home.js (+15 -6)
📝 website/public/assets/main.js (+22 -9)
📝 website/public/assets/styles.css (+195 -8)

...and 23 more files

📄 Description

Step 1 of the website translation plan (zh-Hans, zh-Hant, ja, ko, fr, de). This PR changes only English pages. Readers should see no difference.

Changes

  • Font tokens. --font-sans and --font-mono on :root replace the literal font stacks, so later per-language rules (:lang(...)) only override the tokens. The Aegis code display keeps its ui-monospace first choice (ui-monospace, var(--font-mono)). One side effect: its fallback list now also includes Liberation Mono.
  • main.js has no reader-facing text.
    • Copy feedback (Copied, Selected and the two status messages) comes from data-* attributes on the shared #copy-status element in the footer template.
    • Each Copy button restores its own original label instead of a hard-coded "Copy".
    • The GitHub star label uses data-label-one / data-label-other from the header template, chosen with Intl.PluralRules. The count is formatted with Intl.NumberFormat for the page's lang, which gives the same 1,234 for en as the previous en-US.
  • Demo messages in the page. home.js (percent demo) and dino-demo.js (game, canvas labels, speed check) read data-msg-* attributes with {name} placeholders. The home page and examples/dino-lab/ both carry the attributes.
  • Skip link in the header template. It is now rendered inside the website:header region, and all 17 synced pages were regenerated. templates/page.html no longer contains its own copy.
  • Fixed the lowercase aria-label Copy ghidra connection · macos / linux → Copy Ghidra connection for macOS and Linux, matching the Windows label.
  • website/README.md documents where script messages live.

Validation

  • python3 scripts/website.py check: passes (19 HTML pages, 422 local references, 17 indexable pages, 7 regression tests).
  • npm run format:check: passes. oxlint website/public/assets reports only the existing max-lines-per-function warning on initializeDinoDemo, which is also present on main.
  • Comparison with main in real headless Firefox (the installed Firefox, driven over WebDriver BiDi; main served from git archive origin/main):
    • Full-page screenshots at 375px and 1440px of the home page, dino lab, get-started, FAQ and Aegis are byte-identical between main and this branch.
    • These read out the same: the percent-demo status through both operations, the dino button/status text through play, pause, slider, auto toggle, reset and crash, the canvas text, the dino-lab speed check, copy feedback on both the clipboard-success and fallback-selection paths with the label restored after 2 s, the star label for 1 and 1,234 stars (fetch stubbed), and the skip link as the first link.
  • Not verified: Chromium and WebKit rendering (no other browser is installed here).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1737 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/website-i18n-prep` --- ### 📝 Commits (7) - [`3d34185`](https://github.com/morluto/rea/commit/3d34185171fb49dd0a514bc00ead7e82bbea39af) refactor(website): move UI text out of scripts before translation - [`dabcd78`](https://github.com/morluto/rea/commit/dabcd783d55c2f4aba46371b29db21fbe30e4ddd) refactor(website): keep page text when a script message is missing - [`80f6365`](https://github.com/morluto/rea/commit/80f6365523b6aa51fbcff81f673ad8cd007ca9d7) refactor(website): run the website lane for the page-script test - [`ce58aeb`](https://github.com/morluto/rea/commit/ce58aebc0e8b04f202a50b9251bf78a98e20a6ee) feat(website): add language infrastructure for translated pages - [`4db6ff4`](https://github.com/morluto/rea/commit/4db6ff461f06fa45ceecafbf2f5fb79e0e357111) feat(website): fit the language menu on narrow screens - [`0fd4021`](https://github.com/morluto/rea/commit/0fd40218427464666d3f103067a547bd5e44dab5) feat(website): keep translation tests independent of page text - [`c865e20`](https://github.com/morluto/rea/commit/c865e20a0bd3fe1fe3c7e56aea7c04fa8d28db08) feat(website): translate Get started into Traditional Chinese (draft) ### 📊 Changes **43 files changed** (+3342 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/website-check.yml` (+4 -0) 📝 `.github/workflows/website-pages.yml` (+7 -0) 📝 `scripts/ci/scopes.mjs` (+1 -0) ➕ `scripts/test-website-scripts.mjs` (+481 -0) 📝 `scripts/test-website.py` (+212 -2) 📝 `scripts/verify-website.py` (+221 -8) 📝 `scripts/website.py` (+442 -28) 📝 `website/AGENTS.md` (+6 -2) 📝 `website/README.md` (+20 -8) ➕ `website/locales/de.json` (+34 -0) ➕ `website/locales/en.json` (+34 -0) ➕ `website/locales/fr.json` (+34 -0) ➕ `website/locales/ja.json` (+33 -0) ➕ `website/locales/ko.json` (+33 -0) ➕ `website/locales/zh-hans.json` (+33 -0) ➕ `website/locales/zh-hant.json` (+33 -0) 📝 `website/public/assets/dino-demo.js` (+42 -32) 📝 `website/public/assets/home.js` (+15 -6) 📝 `website/public/assets/main.js` (+22 -9) 📝 `website/public/assets/styles.css` (+195 -8) _...and 23 more files_ </details> ### 📄 Description Step 1 of the website translation plan (zh-Hans, zh-Hant, ja, ko, fr, de). This PR changes only English pages. Readers should see no difference. ## Changes - **Font tokens.** `--font-sans` and `--font-mono` on `:root` replace the literal font stacks, so later per-language rules (`:lang(...)`) only override the tokens. The Aegis code display keeps its `ui-monospace` first choice (`ui-monospace, var(--font-mono)`). One side effect: its fallback list now also includes `Liberation Mono`. - **`main.js` has no reader-facing text.** - Copy feedback (`Copied`, `Selected` and the two status messages) comes from `data-*` attributes on the shared `#copy-status` element in the footer template. - Each Copy button restores its own original label instead of a hard-coded `"Copy"`. - The GitHub star label uses `data-label-one` / `data-label-other` from the header template, chosen with `Intl.PluralRules`. The count is formatted with `Intl.NumberFormat` for the page's `lang`, which gives the same `1,234` for `en` as the previous `en-US`. - **Demo messages in the page.** `home.js` (percent demo) and `dino-demo.js` (game, canvas labels, speed check) read `data-msg-*` attributes with `{name}` placeholders. The home page and `examples/dino-lab/` both carry the attributes. - **Skip link in the header template.** It is now rendered inside the `website:header` region, and all 17 synced pages were regenerated. `templates/page.html` no longer contains its own copy. - Fixed the lowercase aria-label `Copy ghidra connection · macos / linux` → `Copy Ghidra connection for macOS and Linux`, matching the Windows label. - `website/README.md` documents where script messages live. ## Validation - `python3 scripts/website.py check`: passes (19 HTML pages, 422 local references, 17 indexable pages, 7 regression tests). - `npm run format:check`: passes. `oxlint website/public/assets` reports only the existing `max-lines-per-function` warning on `initializeDinoDemo`, which is also present on main. - **Comparison with main in real headless Firefox** (the installed Firefox, driven over WebDriver BiDi; main served from `git archive origin/main`): - Full-page screenshots at 375px and 1440px of the home page, dino lab, get-started, FAQ and Aegis are byte-identical between main and this branch. - These read out the same: the percent-demo status through both operations, the dino button/status text through play, pause, slider, auto toggle, reset and crash, the canvas text, the dino-lab speed check, copy feedback on both the clipboard-success and fallback-selection paths with the label restored after 2 s, the star label for 1 and 1,234 stars (fetch stubbed), and the skip link as the first link. - Not verified: Chromium and WebKit rendering (no other browser is installed here). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4788
No description provided.