Repository navigation
refactor(website): move UI text out of scripts before translation - #1737
kaoru0822-kitauji wants to merge 7 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Prepare the website for localized pages without changing what English readers see: - Add --font-sans and --font-mono tokens and use them for every font stack. - Read copy feedback from the shared #copy-status element, restore each Copy button's own label, and build the GitHub star label from header data attributes with Intl.PluralRules and Intl.NumberFormat for the page language. - Move the percent demo, dinosaur game and speed-check messages into data-msg-* attributes on the home page and dino lab. - Render the skip link from the shared header template. - Fix the lowercase Ghidra macOS/Linux copy-button label. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page that omits a message attribute (a translation that drops one, or a
page without the shared footer) must not show empty or "undefined" text:
- Copy buttons still copy without #copy-status or its messages, keep their
own label and leave the status empty.
- The star label is skipped when the header has no label for the count.
- The percent demo, dinosaur game and speed check leave the current text in
place for a missing message; an unknown {placeholder} stays literal.
scripts/test-website-scripts.mjs runs main.js, home.js and dino-demo.js
against a small document model with node:test. `website.py check` runs it,
so the website CI job and the publisher's preparation job now set up the
repository's Node.js version.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
8b0fe11 to
80f6365
Compare
Prepare translated versions of the home, Get started, Guides and FAQ pages in zh-Hans, zh-Hant, ja, ko, de and fr. English stays at the root and each language lives under its own directory. No translated page exists yet, so English pages only gain an og:locale tag. - LANGUAGES in website.py owns each language's directory, lang/hreflang tag, menu name and og:locale; locales/<language>.json holds the shared UI text (non-English locales start as English placeholders). - sync renders the header, footer and sharing regions in the page's language: localized navigation with an EN badge on English-only targets, a native-details language menu (same page, else the language's reviewed home, else omitted), hreflang alternates with x-default, og:locale alternates and the brand link to the language's home. - Translations record source-sha256 and status (draft or reviewed). Drafts are noindex and stay out of the sitemap, menus, hreflang and navigation. - sync copies every Copy-targeted code block from English by ID, and fills the website:translation-notice region when the English text has changed. The hash leaves out shared regions and those code blocks. - The verifier checks records, copied code, ID/Copy/data-msg parity while fresh, whitespace between CJK characters in ja/zh, and the page's lang. An out-of-date translation, inline-code differences, links to English pages with a reviewed translation and English placeholder UI strings are warnings, shown as GitHub annotations and in the job summary. - New commands: `translate <language> <route>` creates a draft and `translations` reports status, freshness and OS names to confirm. - styles.css adds per-language CJK font stacks, CJK heading, emphasis and line-breaking rules, German hyphenation, and the menu, badge and notice. - The publisher runs sync after the checks so notices are current. - website/translation.md documents the workflow, rules, register, glossary (with Korean), OS names to confirm and the review checklist. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The menu's list opened leftward past the screen edge on phones, and at 320px the fourth header button overlapped the brand. Open the list to the right below 640px, and hide the GitHub star count below 360px when a page has a language menu. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The translation tests now drop existing translated pages from their site copy, read expected UI strings from the locale file, and insert their own paragraphs and code changes instead of editing particular English sentences, so ordinary page edits and new translations do not break them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pilot translation created with `website.py translate zh-hant get-started` and translated in place. It stays a noindex draft until review, so it is not linked from other pages, the sitemap or hreflang. - locales/zh-hant.json: Taiwan-standard UI strings for the header, footer, copy messages, star label and out-of-date notice. - Prose, headings, captions, Copy labels, the agent prompts, title and description are translated; commands and paths come from English. - Ten OS names are marked data-os-ui for confirmation (PowerShell's messages, the Start menu, File Explorer and Copy as path on Windows; Terminal, the Pathname command and Show Package Contents on macOS). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the work on this, especially the script-message separation and Traditional Chinese onboarding draft. The complete multilingual implementation is now in #1779, covering all 19 README languages, reading pages, figures and interactive examples. It uses gettext catalogs and generated language pages, so we should keep one translation system. I've incorporated your CJK font choices, original copy-button label restoration, accessibility wording and parts of the Traditional Chinese draft, with co-author credit. Once #1779 passes CI and merges, I'll close this as superseded. Further language review would be very welcome; the PO workflow is documented in |
Adapt CJK font stacks, original copy-button label restoration, accessibility wording and Traditional Chinese onboarding improvements from PR #1737. Protect the complete APK filename and correct setup terminology. Co-authored-by: Kaoru0822 <[email protected]>
|
#1779 is now merged, so I'm closing this as superseded. The incorporated font, copy-button, accessibility and Traditional Chinese improvements carry co-author credit. Language corrections and further review are welcome through the PO translation workflow. Thanks for contributing to this work! |
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-sansand--font-monoon:rootreplace the literal font stacks, so later per-language rules (:lang(...)) only override the tokens. The Aegis code display keeps itsui-monospacefirst choice (ui-monospace, var(--font-mono)). One side effect: its fallback list now also includesLiberation Mono.main.jshas no reader-facing text.Copied,Selectedand the two status messages) comes fromdata-*attributes on the shared#copy-statuselement in the footer template."Copy".data-label-one/data-label-otherfrom the header template, chosen withIntl.PluralRules. The count is formatted withIntl.NumberFormatfor the page'slang, which gives the same1,234forenas the previousen-US.home.js(percent demo) anddino-demo.js(game, canvas labels, speed check) readdata-msg-*attributes with{name}placeholders. The home page andexamples/dino-lab/both carry the attributes.website:headerregion, and all 17 synced pages were regenerated.templates/page.htmlno longer contains its own copy.Copy ghidra connection · macos / linux→Copy Ghidra connection for macOS and Linux, matching the Windows label.website/README.mddocuments 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/assetsreports only the existingmax-lines-per-functionwarning oninitializeDinoDemo, which is also present on main.git archive origin/main):🤖 Generated with Claude Code