diff --git a/README.md b/README.md index 5f16f13..5d42a1d 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,38 @@ implementation: - `language-provider-protocol` for LPP protocol contracts. Do not treat an issue state, an unreleased branch, or a hidden command as proof -that a capability ships. Describe direction (for example the intent-driven -agent loop) as direction, not as current behavior. Keep internal terms such as -WIR, HIR, frontend, and provider out of primary homepage messaging. +that a capability ships. Planned features go in the agents section's "Coming +soon" line, never in current-capability copy. Keep internal terms such as +WIR, HIR, frontend, and provider out of primary homepage messaging. Say what a +feature does for a Workshop developer; implementation background belongs in the +owning repository's docs, not on the homepage. -All copy, navigation, and support claims live in `src/lib/site.ts`. The hero -terminal shows real `wright` output; refresh it when the CLI output changes. +Locale-independent data (URLs, commands, repository names, support status, +the hero terminal, and the "What it catches" examples) lives in +`src/lib/site.ts`. The terminal and every example show real `wright` output: +each example has a Workshop snippet per locale, written in that game client's +syntax, and must be re-run through `wright lint` when edited or when the CLI +output changes. + +## Localization + +English is the default at `/`; Simplified Chinese is at `/zh-CN`. There is no +browser-language redirect; readers switch from the header language menu. + +- Copy lives in `src/lib/content/.ts`, typed by + `src/lib/content/types.ts`. Records keyed by the ids in `site.ts` and + fixed-length lists keep every locale making the same claims; change a claim + in all locales in the same PR. +- Commands, repository names, protocol names, and CLI output stay literal. +- Write each locale for its readers, not word for word. Keep it short and + plain: the audience is Workshop, OverPy, and OSTW developers, not compiler + engineers. Chinese follows the zh-CN game client's Workshop terms (地图工坊, + 规则, 动作, 值, 服务器负载) and puts a space between CJK text and Latin words. +- Long Chinese headings may use `\u200b` to mark where they are allowed to + wrap; headings otherwise break only at spaces and punctuation. +- To add a locale: add it to `src/lib/locales.ts`, add a content file, and add + the path to `prerender.entries` in `svelte.config.js` and to + `scripts/verify-build.mjs`. ## Stack diff --git a/scripts/verify-build.mjs b/scripts/verify-build.mjs index d9e503b..a41bdb2 100644 --- a/scripts/verify-build.mjs +++ b/scripts/verify-build.mjs @@ -41,3 +41,42 @@ for (const installer of installers) { process.exit(1); } } + +// Each locale must ship as its own prerendered page with correct language +// metadata, and commands and captured CLI output must stay untranslated. +const SITE_URL = 'https://wrightkit.dev'; +const pages = [ + { file: 'index.html', lang: 'en', canonical: `${SITE_URL}/` }, + { file: 'zh-CN.html', lang: 'zh-CN', canonical: `${SITE_URL}/zh-CN` } +]; +const literals = [ + 'curl -fsSL https://wrightkit.dev/install.sh | bash', + 'brew install wrightkit/tap/wright', + 'wright lint rules.txt', + 'warning[min-wait-loop]: loop body waits at the workshop minimum rate', + 'warning[while-without-wait]: loop body contains no wait call' +]; + +for (const page of pages) { + const path = resolve(ROOT_DIR, 'build', page.file); + if (!existsSync(path)) { + console.error(`[verify-build] Error: build/${page.file} does not exist.`); + process.exit(1); + } + const html = readFileSync(path, 'utf8'); + const expected = [ + ` ` + +import type { Locale } from '$lib/locales'; + +declare global { + namespace App { + interface PageData { + locale?: Locale; + } + } +} + +export {}; diff --git a/src/app.html b/src/app.html index 91a4496..5a3b3ff 100644 --- a/src/app.html +++ b/src/app.html @@ -1,5 +1,5 @@ - + @@ -8,6 +8,7 @@ -
-
- {#each agents.columns as column (column.title)} -
-

{column.title}

-
    - {#each column.points as point (point)} -
  • - - {point} -
  • - {/each} -
-
+
+
    + {#each agents.capabilities as item, i (i)} +
  • +

    {item.title}

    +

    {item.body}

    +
  • {/each} -
+ -
-

{agents.loop.title}

-

{agents.loop.lead}

-
    - {#each agents.loop.steps as step, i (step.title)} -
  1. - {String(i + 1).padStart(2, '0')} -

    {step.title}

    -

    {step.body}

    +
    + + {agents.upcomingLabel} + +
      + {#each agents.upcoming as item, i (i)} +
    • + {#if i > 0}{/if}{item}
    • {/each} -
+
diff --git a/src/lib/components/CopyButton.svelte b/src/lib/components/CopyButton.svelte index dd070eb..4069972 100644 --- a/src/lib/components/CopyButton.svelte +++ b/src/lib/components/CopyButton.svelte @@ -1,5 +1,10 @@ - -
- - - - -
-

{ecosystem.nonGoals.title}

-
    - {#each ecosystem.nonGoals.items as item (item)} -
  • {item}
  • - {/each} -
-
-
diff --git a/src/lib/components/FeaturesSection.svelte b/src/lib/components/FeaturesSection.svelte new file mode 100644 index 0000000..d1b8994 --- /dev/null +++ b/src/lib/components/FeaturesSection.svelte @@ -0,0 +1,41 @@ + + +
+ +
diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index db1617e..34c1590 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -1,16 +1,25 @@