Skip to content

Commit 0bdfcee

Browse files
hotlongCopilot
andcommitted
feat(spec,crm-example): translate sidebar group labels via navigation convention
Adds an optional navigation field to the apps.<name> entry in TranslationData so each translation pack can localise sidebar navigation group labels following the new objectui {ns}.apps.{appName}.navigation.{groupId}.label convention. - packages/spec: TranslationDataSchema.apps[name] now accepts an optional navigation record of { label } entries. - examples/app-crm: en/zh-CN/es-ES/ja-JP translations gain apps.crm_enterprise.navigation entries for the five CRM sidebar groups (group_sales, group_service, group_marketing, group_products, group_analytics). The crm.app.ts metadata keeps English literals as the in-source fallback. Tests: @objectstack/spec suite passes (6811 tests). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f1fa9a7 commit 0bdfcee

5 files changed

Lines changed: 31 additions & 0 deletions

File tree

examples/app-crm/src/translations/en.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ export const en: TranslationData = {
144144
crm_enterprise: {
145145
label: 'Enterprise CRM',
146146
description: 'Customer relationship management for sales, service, and marketing',
147+
navigation: {
148+
group_sales: { label: 'Sales' },
149+
group_service: { label: 'Service' },
150+
group_marketing: { label: 'Marketing' },
151+
group_products: { label: 'Products' },
152+
group_analytics: { label: 'Analytics' },
153+
},
147154
},
148155
},
149156

examples/app-crm/src/translations/es-ES.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ export const esES: TranslationData = {
143143
crm_enterprise: {
144144
label: 'CRM Empresarial',
145145
description: 'Gestión de relaciones con clientes para ventas, servicio y marketing',
146+
navigation: {
147+
group_sales: { label: 'Ventas' },
148+
group_service: { label: 'Servicio' },
149+
group_marketing: { label: 'Marketing' },
150+
group_products: { label: 'Productos' },
151+
group_analytics: { label: 'Analíticas' },
152+
},
146153
},
147154
},
148155

examples/app-crm/src/translations/ja-JP.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ export const jaJP: TranslationData = {
143143
crm_enterprise: {
144144
label: 'エンタープライズ CRM',
145145
description: '営業・サービス・マーケティング向け顧客関係管理システム',
146+
navigation: {
147+
group_sales: { label: '営業' },
148+
group_service: { label: 'サービス' },
149+
group_marketing: { label: 'マーケティング' },
150+
group_products: { label: '製品' },
151+
group_analytics: { label: '分析' },
152+
},
146153
},
147154
},
148155

examples/app-crm/src/translations/zh-CN.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ export const zhCN: TranslationData = {
316316
crm_enterprise: {
317317
label: '企业 CRM',
318318
description: '涵盖销售、服务和市场营销的客户关系管理系统',
319+
navigation: {
320+
group_sales: { label: '销售' },
321+
group_service: { label: '服务' },
322+
group_marketing: { label: '营销' },
323+
group_products: { label: '产品' },
324+
group_analytics: { label: '数据分析' },
325+
},
319326
},
320327
},
321328

packages/spec/src/system/translation.zod.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export const TranslationDataSchema = lazySchema(() => z.object({
8484
apps: z.record(z.string(), z.object({
8585
label: z.string().describe('Translated app label'),
8686
description: z.string().optional().describe('Translated app description'),
87+
navigation: z.record(z.string(), z.object({
88+
label: z.string().describe('Translated navigation group label'),
89+
})).optional().describe('Navigation group translations keyed by group ID'),
8790
})).optional().describe('App translations keyed by app name'),
8891

8992
/** UI Messages */

0 commit comments

Comments
 (0)