Skip to content

Commit faf1fed

Browse files
committed
feat: integrate I18nServicePlugin and update dependencies
1 parent 5a71ba1 commit faf1fed

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

objectstack.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import CrmApp from './examples/app-crm/objectstack.config';
1212
import TodoApp from './examples/app-todo/objectstack.config';
1313
import BiPlugin from './examples/plugin-bi/objectstack.config';
1414
import { AuthPlugin } from '@objectstack/plugin-auth';
15+
import { I18nServicePlugin } from '@objectstack/service-i18n';
1516

1617
export default defineStack({
1718
manifest: {
@@ -24,6 +25,11 @@ export default defineStack({
2425
plugins: [
2526
new ObjectQLPlugin(),
2627
new DriverPlugin(new InMemoryDriver()),
28+
new I18nServicePlugin({
29+
defaultLocale: 'en',
30+
fallbackLocale: 'en',
31+
registerRoutes: true, // 自动注册 /api/v1/i18n/* 路由
32+
}),
2733
new AuthPlugin({
2834
secret: 'dev-secret-please-change-in-production-min-32-chars',
2935
baseUrl: 'http://localhost:3000',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@objectstack/plugin-auth": "workspace:*",
4242
"@objectstack/plugin-hono-server": "workspace:*",
4343
"@objectstack/runtime": "workspace:*",
44+
"@objectstack/service-i18n": "workspace:*",
4445
"@objectstack/spec": "workspace:*",
4546
"lucide-react": "^0.577.0"
4647
},

pnpm-lock.yaml

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)