Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
…g, auto-register in createKernel, remove manual MSW handlers - CRM config: add i18n field with namespace, translations, defaultLocale, supportedLocales - sharedConfig: merge i18n bundles from all composed stacks - createKernel: register i18n kernel service, auto-generate MSW handler from config bundles - browser.ts/server.ts: remove loadAppLocale and custom i18n MSW handlers - Add i18n.getTranslations support to broker shim - Update CHANGELOG.md Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/00eab53d-cefa-4f13-9413-eed4af8e9854
…back) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/00eab53d-cefa-4f13-9413-eed4af8e9854
Copilot
AI
changed the title
[WIP] Update i18n plugin loading and translation injection mechanism
feat(i18n): Unify i18n loading — declare translations in stack config, auto-register in createKernel
Mar 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR unifies the console’s mock i18n loading pipeline by declaring translations in each stack config, aggregating those bundles into the composed app config, and having the MSW kernel factory auto-register an i18n service + MSW translation endpoint in the spec envelope format.
Changes:
- Declare CRM translations in
examples/crmstack config via ani18nsection (namespace, locales,translations). - Merge all stacks’ i18n declarations into
sharedConfig.i18n.bundlesfor the console app. - In the MSW kernel factory, register an
i18nservice and auto-inject an MSW handler forGET /api/v1/i18n/translations/:langreturning{ data: { locale, translations } }; remove per-environmentloadAppLocaleand manual MSW i18n handlers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| examples/crm/objectstack.config.ts | Adds stack-level i18n declaration (namespace + translation map) so translations are discoverable via config. |
| apps/console/objectstack.shared.ts | Aggregates stack i18n configs into sharedConfig.i18n.bundles for downstream consumers. |
| apps/console/src/mocks/createKernel.ts | Registers an i18n kernel service from config bundles and auto-injects an MSW i18n translations handler returning the spec envelope. |
| apps/console/src/mocks/browser.ts | Removes duplicate locale loader + manual i18n MSW handler; relies on createKernel injection. |
| apps/console/src/mocks/server.ts | Removes duplicate locale loader + manual i18n MSW handler; relies on createKernel injection. |
| CHANGELOG.md | Documents the unified i18n pipeline changes and removal of custom handlers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server and MSW/mock environments maintained separate i18n pipelines: duplicate
loadAppLocalefunctions inbrowser.ts/server.ts, manual MSW custom handlers, and CRM translations (crmLocales) never wired into the stack config. This caused format inconsistencies and made the i18n route fragile across environments.Changes
examples/crm/objectstack.config.ts— Declarei18n: { namespace: 'crm', defaultLocale, supportedLocales, translations: crmLocales }in the stack definitionapps/console/objectstack.shared.ts— Aggregatei18nbundles from all composed stacks intoi18n.bundlesapps/console/src/mocks/createKernel.ts— ReadappConfig.i18n.bundles, register a kerneli18nservice, and auto-inject the MSW handler forGET /i18n/translations/:langreturning the spec envelope format. Addi18n.getTranslationsto broker shim.apps/console/src/mocks/browser.ts&server.ts— RemoveloadAppLocale, remove custom i18n handler, remove unusedhttp/HttpResponseimportsFlow
Callers no longer construct i18n MSW routes —
createKernelderives them from config. Response uses the spec envelope soloadLanguage.tsunwraps identically for mock and production.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.