Skip to content

feat(site): add bilingual English and Chinese site - #4

Merged
taosher merged 1 commit into
masterfrom
t3/i18n-language-switch
Nov 11, 2026
Merged

taosher merged 1 commit into
masterfrom
t3/i18n-language-switch

Conversation

@taosher

@taosher taosher commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add URL-based locale routing: English at /, /registry, /privacy, /terms and Simplified Chinese under /zh.
  • Add a header language menu that switches locale while preserving the current page, query string, and hash.
  • Introduce a lightweight i18n layer with separate English and Chinese UI copy covering the landing page, registry, legal pages, 404, shell, error states, drawers, and theme menu.
  • Localize document metadata per locale: page title, description, canonical URL, og:locale, hreflang alternates, html lang, and structured data.
  • Prerender Chinese routes and add localized sitemap entries plus a /zh/features redirect.
  • Document the bilingual site setup in both READMEs and the deployment guide.

Testing

  • npm run type-check
  • npm test — 31 tests passed across 12 files, including new locale, language toggle, shell, metadata, and landing page coverage
  • npm run build:seo — English and Chinese routes prerendered successfully
  • Manual check: switching between /zh/registry?view=trending#results and /registry?view=trending#results preserves query and hash
  • Manual check: Chinese pages render lang="zh-CN" and include the expected hreflang alternates

- Add `/zh` routes for landing, registry, privacy, and terms with a header language switcher that preserves path, query, and hash
- Move UI copy into `content.en.ts` and `content.zh.ts`, with locale helpers for path localization and formatting
- Prerender both locales with localized metadata, canonical URLs, `hreflang` alternates, and structured data
- Update sitemap, redirects, and READMEs to document the bilingual site
@taosher
taosher merged commit 602eb79 into master Nov 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant