Commit b836c5c
fix(i18n): add i18n bundle aggregation to root objectstack.config.ts
Root cause: `pnpm dev` from the monorepo root runs `objectstack serve --dev`
which loads the ROOT objectstack.config.ts — not apps/console/objectstack.config.ts.
The root config collects plugin configs via getConfig() and composes them with
composeStacks(), but composeStacks() doesn't handle the custom `i18n` field.
So translation data from CRM (and other stacks) was lost during composition,
and AppPlugin.loadTranslations() found nothing to load.
Fix:
1. Aggregate i18n bundles from all plugin configs (same pattern as objectstack.shared.ts)
2. Build spec-format translations array passed to AppPlugin(mergedApp)
3. Add MemoryI18nPlugin to register i18n service during init phase
Verified by actually running the server and testing:
- GET /api/v1/i18n/translations/zh → {"crm":{"objects":{"account":{"label":"客户"}},...}}
- GET /api/v1/i18n/translations/en → {"crm":{"objects":{"account":{"label":"Account"}},...}}
- GET /api/v1/i18n/locales → all 10 CRM locales
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/8b23b829-56d5-4f03-b8f4-fe066b6625871 parent 2e842bb commit b836c5c
2 files changed
+45
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
42 | 61 | | |
43 | 62 | | |
44 | 63 | | |
| |||
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
61 | 86 | | |
62 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
63 | 105 | | |
64 | 106 | | |
65 | 107 | | |
66 | 108 | | |
67 | 109 | | |
| 110 | + | |
68 | 111 | | |
69 | 112 | | |
70 | 113 | | |
| |||
0 commit comments