Skip to content

feat: add i18n translation examples to app-todo and app-crm#659

Merged
hotlong merged 3 commits intomainfrom
copilot/improve-internationalization-example
Feb 13, 2026
Merged

feat: add i18n translation examples to app-todo and app-crm#659
hotlong merged 3 commits intomainfrom
copilot/improve-internationalization-example

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 13, 2026

No i18n examples existed despite comprehensive TranslationBundleSchema support in the spec. Adds working translation bundles to both example apps.

app-todo (3 locales: en, zh-CN, ja-JP)

  • Task object: all 19 field labels, select options (status/priority/tags), help text
  • App label, 19 UI messages, 2 validation messages

app-crm (4 locales: en, zh-CN, ja-JP, es-ES)

  • 4 core objects (Account, Contact, Lead, Opportunity) with full field/option coverage
  • App & nav translations, 21 UI messages, 3 validation messages

Wiring pattern

Both follow the existing barrel-import convention:

import * as translations from './src/translations';

export default defineStack({
  // ...
  translations: Object.values(translations),
});

Each *.translation.ts exports a typed TranslationBundle covering objects, apps, messages, and validationMessages:

import type { TranslationBundle } from '@objectstack/spec/system';

export const TodoTranslations: TranslationBundle = {
  en:      { objects: { task: { label: 'Task', fields: { ... } } }, messages: { ... } },
  'zh-CN': { objects: { task: { label: '任务', fields: { ... } } }, messages: { ... } },
  'ja-JP': { objects: { task: { label: 'タスク', fields: { ... } } }, messages: { ... } },
};

README

  • Added I18n row to System Protocol coverage map
  • Updated directory structures and feature lists for both examples
  • Added translations/ to standard file structure convention
Original prompt

完善example 中关于国际化的例子


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 13, 2026

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 10:17am
spec Ready Ready Preview, Comment Feb 13, 2026 10:17am

Request Review

Copilot AI and others added 2 commits February 13, 2026 10:12
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance internationalization example in documentation feat: add i18n translation examples to app-todo and app-crm Feb 13, 2026
Copilot AI requested a review from hotlong February 13, 2026 10:16
@hotlong hotlong marked this pull request as ready for review February 13, 2026 10:46
Copilot AI review requested due to automatic review settings February 13, 2026 10:47
@hotlong hotlong merged commit 42979b7 into main Feb 13, 2026
3 checks passed
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 comprehensive internationalization (i18n) examples to both app-todo and app-crm example applications, demonstrating the TranslationBundle schema support that exists in @objectstack/spec/system. Prior to this PR, no working i18n examples existed in the repository.

Changes:

  • Added multi-locale translation bundles to app-todo (English, Simplified Chinese, Japanese) and app-crm (English, Simplified Chinese, Japanese, Spanish)
  • Introduced translations/ directory structure following the established barrel-import convention
  • Updated README.md to document i18n coverage and add translations to the standard file structure

Reviewed changes

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

Show a summary per file
File Description
examples/app-todo/src/translations/todo.translation.ts Complete translation bundle for Task object covering all 19 fields, select options, app labels, 19 UI messages, and 2 validation messages across 3 locales
examples/app-todo/src/translations/index.ts Barrel export for todo translations
examples/app-todo/objectstack.config.ts Wires translation bundles into stack definition using Object.values(translations) pattern
examples/app-crm/src/translations/crm.translation.ts Translation bundle for 4 core CRM objects (Account, Contact, Lead, Opportunity) with field labels and select options across 4 locales
examples/app-crm/src/translations/index.ts Barrel export for CRM translations
examples/app-crm/objectstack.config.ts Wires translation bundles into stack definition
examples/README.md Documents i18n feature in both examples, adds translations row to System Protocol coverage table, and includes translations/ in standard directory structure

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