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
+10 -10
View File
@@ -3,10 +3,10 @@
<div class="container footer-inner">
<p>REA · Reverse Engineer Anything</p>
<div class="footer-links">
<a href="https://github.com/morluto/rea">Source</a
><a href="https://github.com/morluto/rea/blob/main/LICENSE">MIT license</a
><a href="https://discord.gg/GkcryMnJDM">Join the community</a
><a href="https://x.com/reatools">Follow us on X</a>
<a href="https://github.com/morluto/rea">$t_source</a
><a href="https://github.com/morluto/rea/blob/main/LICENSE">$t_license</a
><a href="https://discord.gg/GkcryMnJDM">$t_community</a
><a href="https://x.com/reatools">$t_followUs</a>
</div>
</div>
</footer>
@@ -15,11 +15,11 @@
id="copy-status"
role="status"
aria-live="polite"
data-copied="Copied"
data-selected="Selected"
data-status-copied="Code copied to clipboard."
data-status-selected="Code selected. Use your keyboard to copy it."
data-copied="$t_copied"
data-selected="$t_selected"
data-status-copied="$t_statusCopied"
data-status-selected="$t_statusSelected"
></p>
<a class="back-to-top" href="#top" aria-label="Back to top">
<span aria-hidden="true">↑</span> Top
<a class="back-to-top" href="#top" aria-label="$t_backToTop">
<span aria-hidden="true">↑</span> $t_top
</a>
+10 -12
View File
@@ -1,21 +1,19 @@
<!-- prettier-ignore -->
<a class="skip-link" href="#main">Skip to content</a>
<a class="skip-link" href="#main">$t_skipLink</a>
<!-- prettier-ignore -->
<header class="site-header">
<div class="container header-inner">
<a class="brand" href="$base" aria-label="REA home"
<a class="brand" href="$brand" aria-label="$t_home"
><span class="brand-name">REA</span
><span class="brand-caption">Reverse Engineer Anything</span></a
>
<nav class="navigation" aria-label="Main navigation">$navigation</nav>
<div class="header-social">
<nav class="navigation" aria-label="$t_mainNavigation">$navigation</nav>
<div class="header-social">$language_menu
<a
class="nav-github"
href="https://github.com/morluto/rea"
aria-label="REA on GitHub"
title="REA on GitHub"
data-label-one="REA on GitHub ({count} star)"
data-label-other="REA on GitHub ({count} stars)"
aria-label="$t_github"
title="$t_github"$github_star_labels
>
<svg
width="22"
@@ -34,8 +32,8 @@
<a
class="nav-discord"
href="https://discord.gg/GkcryMnJDM"
aria-label="Join REA on Discord"
title="Join REA on Discord"
aria-label="$t_discord"
title="$t_discord"
>
<svg
width="22"
@@ -53,8 +51,8 @@
<a
class="nav-x"
href="https://x.com/reatools"
aria-label="Follow REA on X"
title="Follow REA on X"
aria-label="$t_followRea"
title="$t_followRea"
>
<svg
width="18"
+5 -3
View File
@@ -1,10 +1,12 @@
<!-- prettier-ignore -->
<link rel="canonical" href="$canonical" />
<link rel="canonical" href="$canonical" />$hreflang
<!-- prettier-ignore -->
<meta property="og:type" content="website" />
<!-- prettier-ignore -->
<meta property="og:site_name" content="REA" />
<!-- prettier-ignore -->
<meta property="og:locale" content="$og_locale" />$og_locale_alternates
<!-- prettier-ignore -->
<meta property="og:title" content="$title" />
<!-- prettier-ignore -->
<meta property="og:description" content="$description" />
@@ -21,7 +23,7 @@
<!-- prettier-ignore -->
<meta
property="og:image:alt"
content="REA — Find out how software works. Reverse engineering with your coding agent."
content="$t_imageAlt"
/>
<!-- prettier-ignore -->
<meta name="twitter:card" content="summary_large_image" />
@@ -34,5 +36,5 @@
<!-- prettier-ignore -->
<meta
name="twitter:image:alt"
content="REA — Find out how software works. Reverse engineering with your coding agent."
content="$t_imageAlt"
/>