Skip to content

feat(spec): formalize i18n file organization conventions#660

Merged
hotlong merged 3 commits into
mainfrom
copilot/evaluate-code-standards
Feb 13, 2026
Merged

feat(spec): formalize i18n file organization conventions#660
hotlong merged 3 commits into
mainfrom
copilot/evaluate-code-standards

Conversation

Copilot AI commented Feb 13, 2026

Copy link
Copy Markdown
Contributor
  • Analyze existing i18n/translation schema and conventions
  • Add FieldTranslationSchema for reusable field translation structure
  • Add ObjectTranslationDataSchema for per-object translation file validation
  • Add TranslationFileOrganizationSchema enum (bundled, per_locale, per_namespace)
  • Add TranslationConfigSchema for i18n stack configuration
  • Add TranslationData type export
  • Add i18n optional property to ObjectStackDefinitionSchema in stack.zod.ts
  • Add 18 new tests for all new schemas (39 total, up from 21)
  • Refactor examples/app-todo/src/translations/ to per-locale file splitting
  • Refactor examples/app-crm/src/translations/ to per-locale file splitting (en, zh-CN, ja-JP, es-ES)
  • Run full test suite — 195 files, 5269 tests all passing
  • Code review — no issues found
  • Security scan — no alerts
Original prompt

评估需要约定代码的规范,国际化是否建议按照每一种语言分拆开单独的文件。是否需要精确到安对象分才开。


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

@vercel

vercel Bot commented Feb 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
objectstack-play Ready Ready Preview, Comment Feb 13, 2026 11:19am
spec Ready Ready Preview, Comment Feb 13, 2026 11:19am

Request Review

…ale example

- Add ObjectTranslationDataSchema for per-object translation file validation
- Add FieldTranslationSchema for reusable field translation structure
- Add TranslationFileOrganizationSchema enum (bundled, per_locale, per_namespace)
- Add TranslationConfigSchema for i18n stack configuration
- Add TranslationData type export
- Add i18n optional property to ObjectStackDefinitionSchema
- Refactor app-todo to per-locale file splitting convention
- Add 18 new tests for all new schemas

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Assess code standards for internationalization practices feat(spec): formalize i18n file organization conventions Feb 13, 2026
Copilot AI requested a review from hotlong February 13, 2026 11:01
@hotlong

hotlong commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

@copilot app-crm 也要修改

Split monolithic crm.translation.ts into per-locale files:
- en.ts, zh-CN.ts, ja-JP.ts, es-ES.ts
- Add i18n config to objectstack.config.ts

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>

Copilot AI commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot app-crm 也要修改

Done in d8d4124. Split crm.translation.ts into per-locale files (en.ts, zh-CN.ts, ja-JP.ts, es-ES.ts) and added i18n config to objectstack.config.ts, matching the same pattern as app-todo.

@hotlong
hotlong marked this pull request as ready for review February 13, 2026 11:34
Copilot AI review requested due to automatic review settings February 13, 2026 11:34
@hotlong
hotlong merged commit 9b4fd15 into main Feb 13, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 formalizes i18n (internationalization) file organization conventions for the ObjectStack platform by introducing comprehensive schema definitions and refactoring example apps to follow the new per_locale pattern. The changes establish three distinct file organization strategies (bundled, per_locale, per_namespace) that align with enterprise platform best practices from Salesforce DX and ServiceNow.

Changes:

  • Added reusable FieldTranslationSchema and ObjectTranslationDataSchema for granular translation validation
  • Introduced TranslationFileOrganizationSchema enum and TranslationConfigSchema for i18n stack configuration
  • Added i18n optional property to ObjectStackDefinitionSchema for centralized i18n settings
  • Added 18 comprehensive tests (bringing translation tests from 21 to 39 total)
  • Refactored both example apps (app-todo and app-crm) to use per-locale file splitting with separate files for each language

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/spec/src/system/translation.zod.ts Core schema additions: FieldTranslationSchema, ObjectTranslationDataSchema, TranslationFileOrganizationSchema, TranslationConfigSchema with comprehensive JSDoc documentation
packages/spec/src/system/translation.test.ts 18 new tests covering all new schemas with positive/negative test cases
packages/spec/src/stack.zod.ts Added optional i18n configuration property to stack definition
examples/app-todo/src/translations/*.ts Refactored to per-locale organization: en.ts, zh-CN.ts, ja-JP.ts with bundle aggregation
examples/app-crm/src/translations/*.ts Refactored to per-locale organization: en.ts, zh-CN.ts, ja-JP.ts, es-ES.ts with bundle aggregation
examples/app-todo/objectstack.config.ts Added i18n configuration object following TranslationConfigSchema
examples/app-crm/objectstack.config.ts Added i18n configuration object following TranslationConfigSchema

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.

3 participants