Skip to content

Commit 42979b7

Browse files
authored
Merge pull request #659 from objectstack-ai/copilot/improve-internationalization-example
2 parents 9237500 + e1be05f commit 42979b7

File tree

7 files changed

+1015
-3
lines changed

7 files changed

+1015
-3
lines changed

examples/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ A complete task management application demonstrating all core ObjectStack protoc
4242
- Reports (6 types: tabular, summary, matrix)
4343
- Automation flows (reminders, escalation, recurring tasks)
4444
- App navigation and branding configuration
45+
- **I18n translations** (English, Chinese, Japanese)
4546
- Package structure with `objectstack.config.ts`
4647

4748
**Directory Structure:**
@@ -60,8 +61,10 @@ app-todo/
6061
│ │ └── task.dashboard.ts
6162
│ ├── reports/ # Report definitions
6263
│ │ └── task.report.ts
63-
│ └── flows/ # Automation flows
64-
│ └── task.flow.ts
64+
│ ├── flows/ # Automation flows
65+
│ │ └── task.flow.ts
66+
│ └── translations/ # I18n translations (en, zh-CN, ja-JP)
67+
│ └── todo.translation.ts
6568
└── test/
6669
└── seed.test.ts
6770
```
@@ -91,6 +94,7 @@ pnpm typecheck
9194
- 6 reports (by account, contact, lead, opportunity, case, task)
9295
- 5 automation flows (lead conversion, case escalation, opportunity approval, etc.)
9396
- AI agents and RAG pipelines
97+
- **I18n translations** (English, Chinese, Japanese, Spanish)
9498

9599
**Directory Structure:**
96100
```
@@ -124,6 +128,8 @@ app-crm/
124128
│ │ ├── lead-conversion.flow.ts
125129
│ │ ├── case-escalation.flow.ts
126130
│ │ └── ...
131+
│ ├── translations/ # I18n translations (en, zh-CN, ja-JP, es-ES)
132+
│ │ └── crm.translation.ts
127133
│ ├── agents/ # AI agents
128134
│ ├── rag/ # RAG pipelines
129135
│ ├── apis/ # Custom APIs
@@ -220,6 +226,7 @@ pnpm typecheck
220226
| Manifest | ✅ Complete | All examples with `objectstack.config.ts` |
221227
| Plugin System | ✅ Complete | [App Host](./app-host/) |
222228
| Datasources | 🟡 Partial | [App Host](./app-host/) |
229+
| I18n / Translations | ✅ Complete | [Todo Translations](./app-todo/src/translations/), [CRM Translations](./app-crm/src/translations/) |
223230
| Job Scheduling | 🔴 Missing | _Planned_ |
224231
| Metrics | 🔴 Missing | _Planned_ |
225232

@@ -322,7 +329,8 @@ example-name/
322329
│ ├── apps/ # *.app.ts
323330
│ ├── dashboards/ # *.dashboard.ts
324331
│ ├── reports/ # *.report.ts
325-
│ └── flows/ # *.flow.ts
332+
│ ├── flows/ # *.flow.ts
333+
│ └── translations/ # *.translation.ts (i18n bundles)
326334
└── test/
327335
└── seed.test.ts
328336
```

examples/app-crm/objectstack.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import * as agents from './src/agents';
1313
import * as ragPipelines from './src/rag';
1414
import * as profiles from './src/profiles';
1515
import * as apps from './src/apps';
16+
import * as translations from './src/translations';
1617
import { CrmSeedData } from './src/data';
1718

1819
// ─── Sharing & Security (special: mixed single/array values) ───────
@@ -49,6 +50,9 @@ export default defineStack({
4950
// Seed Data (top-level, registered as metadata)
5051
data: CrmSeedData,
5152

53+
// I18n Translation Bundles (en, zh-CN, ja-JP, es-ES)
54+
translations: Object.values(translations),
55+
5256
// Sharing & security (requires explicit wiring)
5357
sharingRules: [
5458
AccountTeamSharingRule,

0 commit comments

Comments
 (0)