Repository navigation
feat: the site speaks both languages, and /zh/ stops reverting to English #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,4 @@ apps/site/public/registry.json | |
| apps/site/public/r/ | ||
| apps/site/dist/ | ||
| apps/site/.astro/ | ||
| apps/site/src/paraglide/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,47 @@ | ||
| // @ts-check | ||
| import { defineConfig } from "astro/config"; | ||
| import react from "@astrojs/react"; | ||
| import { paraglideVitePlugin } from "@inlang/paraglide-js"; | ||
| import * as paraglideOptions from "./project.inlang/paraglide.options.js"; | ||
|
|
||
| /** | ||
| * Static output, no adapter. | ||
| * | ||
| * The registry is JSON and the demos run in the browser, so there is nothing to | ||
| * render per request — and `output: 'static'` means the deploy target is a plain | ||
| * file tree, which is exactly what Cloudflare Pages wants. Adding SSR later is one | ||
| * line: `@astrojs/cloudflare` plus `output: 'server'`, and the pages here do not | ||
| * change. | ||
| * line: `@astrojs/cloudflare` plus `output: 'server'`, and the pages do not change. | ||
| * | ||
| * `i18n.locales` MUST match `project.inlang/settings.json`. Astro's i18n is what | ||
| * gives the middleware a `currentLocale` during a static render — with no request, | ||
| * something has to tell Paraglide which language it is building. | ||
| */ | ||
| export default defineConfig({ | ||
| output: "static", | ||
| integrations: [react()], | ||
| build: { | ||
| // the engine ships real source in the registry, so the demo inlining the built | ||
| // bundle is not the same bytes — but it IS the same implementation, which is | ||
| // the property that matters. Keeping it a separate chunk makes that visible in | ||
| // the network panel instead of hidden in a bundle. | ||
| assets: "assets", | ||
| i18n: { | ||
| defaultLocale: "en", | ||
| locales: ["en", "zh"], | ||
| // every locale is prefixed, because SSG needs one file per locale: `/en/` and | ||
| // `/zh/` are different files on disk, not one file that varies by request | ||
| // English is NOT prefixed: `/` is English and `/zh/` is Chinese. Astro demands a | ||
| // root index page whenever prefixDefaultLocale is on, and paying a redirect hop on | ||
| // the URL people share and bookmark is a worse trade than one shared page body. | ||
| routing: { prefixDefaultLocale: false, redirectToDefaultLocale: false }, | ||
| }, | ||
| build: { assets: "assets" }, | ||
| vite: { | ||
| // a warning here means the engine is being pulled into the SSR graph, where it | ||
| // has no document to paint into | ||
| ssr: { noExternal: ["@botharness/botui-core"] }, | ||
| plugins: [ | ||
| // Options come from project.inlang/paraglide.options.js, which the standalone | ||
| // CLI compile reads too, so the plugin and `pnpm --filter botui-site | ||
| // i18n:compile` cannot produce two different runtimes. Only `outdir` is spelled | ||
| // out here: it is a path relative to the bundler's CWD, not to the project. | ||
| paraglideVitePlugin({ | ||
| project: "./project.inlang", | ||
| outdir: "./src/paraglide", | ||
| ...paraglideOptions, | ||
| }), | ||
| ], | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| { | ||
| "site_title": "BotUI — open-source UI components for agent products", | ||
| "site_description": "Copy-and-own UI components for agent products. Install with npx, then the code is yours. MIT licensed.", | ||
| "brand": "BotUI", | ||
| "nav_install": "Install", | ||
| "nav_components": "Components", | ||
| "nav_github": "GitHub", | ||
| "hero_title": "UI components for things that think.", | ||
| "hero_lede": "Loading states, streaming indicators, agent status — the surfaces an agent product lives on. Install one with npx, and the code lands in your repo. No runtime dependency, nothing to keep current. Read it, change it, delete the name.", | ||
| "hero_also": "Also works with shadcn, against the same registry:", | ||
| "install_command": "npx @botharness/botui add dot-matrix", | ||
| "install_copy": "copy", | ||
| "install_copied": "copied", | ||
| "install_manual": "select it", | ||
| "components_heading": "Components", | ||
| "components_note": "Read from /registry.json — the same document the CLI installs from.", | ||
| "components_loading": "Loading the registry…", | ||
| "components_error": "Could not read /registry.json — {reason}. The registry is served from this site, so this is the site being broken rather than the component.", | ||
| "components_install": "npx @botharness/botui add {name}", | ||
| "group_shape": "shape · 形状", | ||
| "group_size": "size · 尺寸", | ||
| "group_motion": "motion · 动效", | ||
| "ctl_silhouette": "silhouette", | ||
| "ctl_sides": "sides", | ||
| "ctl_glyph": "glyph preset", | ||
| "ctl_radius": "corner radius", | ||
| "ctl_aspect": "aspect", | ||
| "ctl_size": "size", | ||
| "ctl_cols": "cols", | ||
| "ctl_rows": "rows", | ||
| "ctl_dot_cell": "dot / cell", | ||
| "ctl_gap_x": "gap x", | ||
| "ctl_gap_y": "gap y", | ||
| "ctl_preset": "preset", | ||
| "ctl_speed": "speed", | ||
| "ctl_stagger": "stagger", | ||
| "ctl_softness": "softness", | ||
| "ctl_grow": "grow", | ||
| "ctl_floor": "floor", | ||
| "ctl_reset": "reset to the preset value", | ||
| "ctl_reset_aria": "{label} — 回到预设值", | ||
| "value_preset": "preset {value}", | ||
| "value_radius": "{value}% of {max}%", | ||
| "value_speed": "{value}×", | ||
| "css_renderer": "CSS renderer", | ||
| "css_renderer_note": "0 JS per frame", | ||
| "css_refused": "This motion is a highlight moving down the field, and a per-dot delay can only offset a phase — so the CSS renderer refuses it rather than showing something else.", | ||
| "readout_dot_cell": "dot / cell", | ||
| "readout_dot_pitch": "dot / pitch", | ||
| "readout_touching": "touching at", | ||
| "readout_pitch": "pitch", | ||
| "readout_dot": "dot", | ||
| "readout_silhouette": "silhouette", | ||
| "readout_renderer": "renderer", | ||
| "readout_touching_hint": "100% = two dots touching", | ||
| "readout_touching_value": "dot / cell = {value}", | ||
| "glyph_square": "Square", | ||
| "glyph_rounded": "Rounded square", | ||
| "glyph_circle": "Circle", | ||
| "glyph_ellipse": "Ellipse", | ||
| "glyph_triangle": "Triangle", | ||
| "glyph_diamond": "Diamond", | ||
| "glyph_pentagon": "Pentagon", | ||
| "glyph_hexagon": "Hexagon", | ||
| "glyph_star4": "4-point star", | ||
| "glyph_star5": "5-point star", | ||
| "glyph_star6": "6-point star", | ||
| "glyph_burst": "Soft star", | ||
| "glyph_drop": "Teardrop", | ||
| "glyph_bar": "Bar", | ||
| "poly_triangle": "triangle", | ||
| "poly_square": "square", | ||
| "poly_pentagon": "pentagon", | ||
| "poly_hexagon": "hexagon", | ||
| "poly_heptagon": "heptagon", | ||
| "poly_octagon": "octagon", | ||
| "poly_nonagon": "nonagon", | ||
| "poly_decagon": "decagon", | ||
| "poly_gon": "{sides}-gon", | ||
| "task_thinking": "Thinking", | ||
| "task_advancing": "Advancing", | ||
| "task_serpentine": "Serpentine", | ||
| "task_expanding": "Expanding", | ||
| "task_chasing": "Chasing", | ||
| "task_sweeping": "Sweeping", | ||
| "task_column_drop": "Column drop", | ||
| "task_breathing": "Breathing", | ||
| "task_morphing": "Morphing", | ||
| "why_heading": "Why copy-and-own", | ||
| "why_own_title": "Yours after install", | ||
| "why_own_body": "The registry ships the real source files. What lands in components/botui/ is the same text as the repository, and a test in CI proves it byte for byte.", | ||
| "why_version_title": "No version to track", | ||
| "why_version_body": "There is no runtime dependency to upgrade and nothing that can break under you. When BotUI ships something better, you take the diff when you want to.", | ||
| "why_layers_title": "One component, five layers", | ||
| "why_layers_body": "Lattice, traversal, brightness envelope, dot polygon, renderer. Each is a table you can extend without touching the layers above.", | ||
| "footer_license": "MIT licensed · {repo}", | ||
| "sil_square": "square", | ||
| "sil_circle": "circle", | ||
| "sil_diamond": "diamond", | ||
| "sil_hex": "hexagon", | ||
| "sil_ring": "ring", | ||
| "sil_cross": "cross", | ||
| "readout_speed": "speed" | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Translate the English reset accessibility message.
ctl_reset_ariacontains Chinese instructions in the English catalog. English-page users receive a mixed-language reset label. Replace the instructions with English.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents