feat(website): add language infrastructure for translated pages

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 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-11 07:23:29 +00:00
co-authored by Claude Opus 5.5
parent 80f6365523
commit ce58aebc0e
35 changed files with 1564 additions and 71 deletions
+178 -3
View File
@@ -6,9 +6,11 @@
--soft: #f4f6f8;
--accent: #294f82;
--page: #ffffff;
--font-sans:
-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
/* Translated pages extend these stacks with fonts for their script. */
--font-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial;
--font-code: "SFMono-Regular", Consolas, "Liberation Mono";
--font-sans: var(--font-latin), sans-serif;
--font-mono: var(--font-code), monospace;
font-family: var(--font-sans);
font-synthesis: none;
text-rendering: optimizeLegibility;
@@ -2487,3 +2489,176 @@ pre code {
grid-template-columns: 1fr;
}
}
/* Translated pages. Latin text keeps the site's fonts, then each language
names its own CJK fonts so Han characters take that language's forms. */
:lang(en) {
--font-sans: var(--font-latin), sans-serif;
--font-mono: var(--font-code), monospace;
}
:lang(ja) {
--font-sans:
var(--font-latin), "Hiragino Sans", "Hiragino Kaku Gothic ProN",
"Yu Gothic UI", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
--font-mono:
var(--font-code), "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP",
"Noto Sans CJK JP", monospace;
}
:lang(zh-Hans) {
--font-sans:
var(--font-latin), "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
"Noto Sans CJK SC", sans-serif;
--font-mono:
var(--font-code), "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
"Noto Sans CJK SC", monospace;
}
:lang(zh-Hant) {
--font-sans:
var(--font-latin), "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
"Noto Sans CJK TC", sans-serif;
--font-mono:
var(--font-code), "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
"Noto Sans CJK TC", monospace;
}
:lang(ko) {
--font-sans:
var(--font-latin), "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
"Noto Sans CJK KR", sans-serif;
--font-mono:
var(--font-code), "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
"Noto Sans CJK KR", monospace;
}
/* Resolve the stack again wherever the language changes, such as the
language menu's names or an English badge. */
[lang] {
font-family: var(--font-sans);
}
:is(:lang(ja), :lang(ko), :lang(zh-Hans), :lang(zh-Hant))
:is(
h1,
h2,
h3,
.brand-name,
.home-no,
.agent-one-prompt,
.stats dt,
.home-start-grid .home-setup h2
) {
letter-spacing: 0;
}
:is(:lang(ja), :lang(ko), :lang(zh-Hans), :lang(zh-Hant)) :is(h1, h2, h3) {
line-height: 1.3;
text-wrap: pretty;
}
/* CJK fonts have no italics, so emphasis uses weight instead. */
:is(:lang(ja), :lang(ko), :lang(zh-Hans), :lang(zh-Hant)) em {
font-style: normal;
font-weight: 600;
}
:lang(ja) {
line-break: strict;
}
:lang(ja) :is(h1, h2, h3) {
word-break: auto-phrase;
}
:lang(ko) {
word-break: keep-all;
}
:lang(de) :is(h1, h2, h3, .lede, .contents a, .button) {
hyphens: auto;
overflow-wrap: break-word;
}
.language-menu {
position: relative;
}
.language-menu summary {
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 44px;
padding-inline: 10px;
border: 1px solid var(--line);
border-radius: 10px;
color: var(--muted);
font-size: 0.875rem;
cursor: pointer;
list-style: none;
}
.language-menu summary::-webkit-details-marker {
display: none;
}
.language-menu summary:hover,
.language-menu[open] summary {
background: var(--soft);
color: var(--ink);
}
.language-menu svg {
display: block;
flex-shrink: 0;
}
.language-list {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 6;
min-width: 10rem;
margin: 0;
padding: 0.35rem;
border: 1px solid var(--line);
border-radius: 10px;
background: var(--page);
box-shadow: 0 8px 24px rgb(32 37 43 / 12%);
list-style: none;
}
.language-list li + li {
margin-top: 0;
}
.language-list a {
display: block;
padding: 0.45rem 0.7rem;
border-radius: 6px;
color: var(--ink);
text-decoration: none;
}
.language-list a:hover {
background: var(--soft);
}
.language-list a[aria-current="true"] {
font-weight: 600;
}
.nav-badge {
margin-left: 0.3em;
padding: 0 0.3em;
border: 1px solid var(--line);
border-radius: 4px;
color: var(--muted);
font-size: 0.65rem;
font-weight: 600;
letter-spacing: 0.04em;
vertical-align: 0.15em;
}
.translation-notice {
margin: 1.5rem 0 0;
padding: 0.75rem 1rem;
border-left: 3px solid var(--accent);
background: var(--soft);
font-size: 0.9rem;
}
main:not(.container) > .translation-notice {
width: min(1080px, calc(100% - 3.5rem));
margin-inline: auto;
}
@media (max-width: 640px) {
.language-current {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
main:not(.container) > .translation-notice {
width: calc(100% - 2.5rem);
}
}
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="REA Blog — Thoughts on Reverse Engineering" />
<!-- prettier-ignore -->
<meta property="og:description" content="Thoughts on reverse engineering, drawing on practical experience with REA and AI agents." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Reverse Engineering’s Industrial Revolution — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="N0zoM1z0 reflects on manual reverse engineering, Touhou reconstruction with AI agents, and how knowledge compounds across TH08, TH095 and PC-98 TH04." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Chrome Dinosaur Game: Rebuild Its Speed Rule — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Read the dinosaur game’s speed rule with REA, rebuild it, then change the speed and play." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="REA FAQ: Setup, Updates and Troubleshooting" />
<!-- prettier-ignore -->
<meta property="og:description" content="Answers to common REA questions: installation, updates, analysis tools, coding agents, troubleshooting and sharing examples." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Your First Reverse Engineering Investigation — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Try REA on a small Notes app. Set up your agent, ask where exported notes go, and check the CSV formatter with a sample title." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Install REA and Set Up Your Coding Agent" />
<!-- prettier-ignore -->
<meta property="og:description" content="Connect REA to your coding agent or inspect a local JavaScript or Electron app from the terminal. Setup, first questions and native provider guides." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Browser and Network Analysis — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Observe a Notes export with REA: select a browser page, capture a click, inspect the request and follow the export script." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Reverse Engineering Guides — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Learn REA through short worked examples: a native calculation, an Electron CSV export and a browser request." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="JavaScript and Electron Analysis — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Trace a Notes CSV export through a renderer API, preload and IPC handler with REA. Includes downloadable example files and a verified analysis result." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Native Binary Analysis — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Recover a native calculation with REA: inspect instructions, follow a caller, read constants and check reconstructed C." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="REA — Reverse Engineering for Your Coding Agent" />
<!-- prettier-ignore -->
<meta property="og:description" content="Reverse engineer apps, binaries and browser behavior with your coding agent. Follow clear guides and try interactive examples with REA." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Aegis APK Reverse Engineering: Login Codes — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Inspect the Aegis Android APK with REA, recover its six-digit login-code calculation and try a reconstruction with an adjustable clock." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="CTF Reverse Engineering: DownUnderCTF Flag Checker — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Use REA to solve DownUnderCTF&#x27;s masked squares flag checker. Find the checking functions, extract the masks and compare a recovered flag with the original program." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="DX-Ball Reverse Engineering: Sound Panning — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Follow a DX-Ball reconstruction from binary analysis through REA to maintained C, original-x86 tests and matching compiled function bytes." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Reverse Engineering Case Studies — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Follow REA investigations through code, figures and demos: an Android authenticator, DX-Ball, Notion, TH04 and a DownUnderCTF flag checker." />
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="Notion Electron Reverse Engineering: Clipboard — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Follow Notion&#x27;s clipboard API through Electron&#x27;s preload, IPC wrappers and main process, with short code excerpts and a look at its rich clipboard format." />
+2
View File
@@ -16,6 +16,8 @@
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="en_US" />
<!-- prettier-ignore -->
<meta property="og:title" content="TH04 Reverse Engineering: DOS Bullet Patterns — REA" />
<!-- prettier-ignore -->
<meta property="og:description" content="Inspect TH04&#x27;s original 16-bit DOS code with REA. Follow the assembly and recovered C++ to see how a ring of bullets is spaced and aimed at the player." />