Skip to content

Add i18n support for homepage (国际化官网首页)#31

Merged
huangyiirene merged 5 commits intomainfrom
copilot/add-international-homepage
Jan 20, 2026
Merged

Add i18n support for homepage (国际化官网首页)#31
huangyiirene merged 5 commits intomainfrom
copilot/add-international-homepage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

The homepage was hardcoded in English. This adds Chinese translations while leveraging the existing middleware and routing infrastructure.

Changes

Created apps/docs/lib/homepage-i18n.ts

  • TypeScript interface HomepageTranslations defining all translatable strings
  • English and Chinese translation objects
  • getHomepageTranslations(lang) selector with fallback to English

Updated apps/docs/app/[lang]/page.tsx

  • Changed to async function to extract lang from route params
  • Replaced hardcoded strings with translation variables
  • All sections now localized: hero, features, personas

Example

// Before
<h1>The ObjectStack Protocol</h1>

// After
const t = getHomepageTranslations(lang);
<h1>{t.hero.title.line1} <br/> {t.hero.title.line2}</h1>

Screenshots

English (/):
English

Chinese (/cn):
Chinese

Original prompt

国际化官网首页


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 20, 2026 3:41am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add international homepage for website Add i18n support for homepage (国际化官网首页) Jan 20, 2026
Copilot AI requested a review from hotlong January 20, 2026 03:12
@github-actions github-actions bot added documentation Improvements or additions to documentation size/m labels Jan 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds internationalization (i18n) support to the ObjectStack homepage, enabling both English and Chinese language versions. The implementation leverages the existing Next.js i18n routing infrastructure while keeping translations maintainable through a centralized module.

Changes:

  • Created a new i18n module with TypeScript-typed translations for English and Chinese
  • Converted the homepage component to async to access route parameters for language detection
  • Replaced all hardcoded English strings with dynamic translation variables

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
apps/docs/lib/homepage-i18n.ts New translation module defining the HomepageTranslations interface and providing English/Chinese translation objects with a language selector function
apps/docs/app/[lang]/page.tsx Updated homepage to extract language from route params and use translations instead of hardcoded strings
packages/spec/src/system/manifest.test.ts Removed unused MenuItem test cases and import
packages/spec/src/data/field.test.ts Fixed extraneous closing brace

expect(() => MenuItemSchema.parse({ path: '/test' })).toThrow();
});
});
import { ManifestSchema, type ObjectStackManifest } from './manifest.zod';
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed MenuItemSchema tests provided validation coverage for the menu item structure. Ensure that menu item validation is adequately covered elsewhere in the test suite, or consider keeping these tests to maintain comprehensive schema validation.

Copilot uses AI. Check for mistakes.
@huangyiirene huangyiirene merged commit ca0e6dd into main Jan 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants