CRM example: spec compliance fixes and i18n (10 locales)#783
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR performs a comprehensive audit of the CRM example metadata to ensure strict compliance with @objectstack/spec types and adds full internationalization support across 10 languages. The work is divided into two main areas: fixing spec violations and implementing i18n infrastructure.
Changes:
- Fixed 3 critical spec compliance violations: corrected
variant: 'danger'to'destructive'in 4 action files, convertedcolumnsfrom string to number type in 33 form sections across 10 view files, and added requiredtype: 'dashboard'property to the dashboard schema - Added comprehensive i18n infrastructure with 10 locale files (en, zh, ja, ko, de, fr, es, pt, ru, ar) covering all CRM metadata including objects, fields, field options, navigation, actions, views, form sections, dashboard widgets, reports, and pages
- Implemented 24 automated tests validating both metadata spec conformance and i18n completeness across all locales
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/crm/src/actions/account.actions.ts | Fixed action variant from 'danger' to 'destructive' |
| examples/crm/src/actions/event.actions.ts | Fixed action variant from 'danger' to 'destructive' |
| examples/crm/src/actions/opportunity.actions.ts | Fixed action variant from 'danger' to 'destructive' |
| examples/crm/src/actions/user.actions.ts | Fixed action variant from 'danger' to 'destructive' |
| examples/crm/src/views/*.view.ts | Converted form section columns from string to number type (10 files, 33 occurrences) |
| examples/crm/src/dashboards/crm.dashboard.ts | Added required type: 'dashboard' property |
| examples/crm/src/i18n/*.ts | New locale files for 10 languages with comprehensive translations |
| examples/crm/src/i18n/index.ts | Barrel file exporting all locales and types |
| examples/crm/src/index.ts | Added crmLocales export |
| examples/crm/src/tests/crm-metadata.test.ts | New comprehensive test suite with 24 tests for spec compliance and i18n completeness |
| examples/crm/objectstack.config.ts | Updated comment explaining strict: false configuration |
| ROADMAP.md | Added completion markers for spec compliance audit and i18n features |
| @@ -0,0 +1,452 @@ | |||
| /** | |||
| * 日本語 (ja) — CRM サンプル i18n ロケール | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Japanese.
Change to:
/**
* Japanese (ja) — CRM Example i18n locale
*/| * 日本語 (ja) — CRM サンプル i18n ロケール | |
| * Japanese (ja) — CRM Example i18n locale |
| @@ -0,0 +1,174 @@ | |||
| /** | |||
| * Deutsch (de) — CRM-Beispiel i18n-Lokalisierung | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of German.
Change to:
/**
* German (de) — CRM Example i18n locale
*/| * Deutsch (de) — CRM-Beispiel i18n-Lokalisierung | |
| * German (de) — CRM Example i18n locale |
| @@ -0,0 +1,174 @@ | |||
| /** | |||
| * Français (fr) — CRM Exemple i18n locale | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of French.
Change to:
/**
* French (fr) — CRM Example i18n locale
*/| * Français (fr) — CRM Exemple i18n locale | |
| * French (fr) — CRM Example i18n locale |
| @@ -0,0 +1,116 @@ | |||
| /** | |||
| * Português (pt) — CRM Exemplo i18n locale | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Portuguese.
Change to:
/**
* Portuguese (pt) — CRM Example i18n locale
*/| * Português (pt) — CRM Exemplo i18n locale | |
| * Portuguese (pt) — CRM Example i18n locale |
| @@ -0,0 +1,116 @@ | |||
| /** | |||
| * العربية (ar) — CRM مثال i18n اللغة | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Arabic.
Change to:
/**
* Arabic (ar) — CRM Example i18n locale
*/| * العربية (ar) — CRM مثال i18n اللغة | |
| * Arabic (ar) — CRM Example i18n locale |
| @@ -0,0 +1,452 @@ | |||
| /** | |||
| * 中文 (zh) — CRM 示例国际化语言包 | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comments in non-English locale files should use English.
For example, this comment should be in English:
/**
* Chinese (zh) — CRM Example i18n locale
*/This applies to all non-English locale files: zh.ts, ja.ts, ko.ts, de.ts, fr.ts, es.ts, pt.ts, ru.ts, and ar.ts. While the translation content (the actual strings in the locale object) should be in the target language, the code comments describing the file must be in English for consistency across the international codebase.
| * 中文 (zh) — CRM 示例国际化语言包 | |
| * Chinese (zh) — CRM Example i18n locale |
| @@ -0,0 +1,116 @@ | |||
| /** | |||
| * Русский (ru) — CRM Пример i18n локализации | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Russian.
Change to:
/**
* Russian (ru) — CRM Example i18n locale
*/This is a best practice for maintaining consistency in an international open-source project.
| * Русский (ru) — CRM Пример i18n локализации | |
| * Russian (ru) — CRM Example i18n locale |
| @@ -0,0 +1,174 @@ | |||
| /** | |||
| * 한국어 (ko) — CRM 예제 i18n 로케일 | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Korean.
Change to:
/**
* Korean (ko) — CRM Example i18n locale
*/| * 한국어 (ko) — CRM 예제 i18n 로케일 | |
| * Korean (ko) — CRM Example i18n locale |
| @@ -0,0 +1,156 @@ | |||
| /** | |||
| * Español (es) — CRM Ejemplo i18n locale | |||
There was a problem hiding this comment.
According to the codebase guidelines (Rule #-1), ALL code comments and documentation MUST be written in English. The file header comment should use English instead of Spanish.
Change to:
/**
* Spanish (es) — CRM Example i18n locale
*/| * Español (es) — CRM Ejemplo i18n locale | |
| * Spanish (es) — CRM Example i18n locale |
Audit all CRM example metadata against
@objectstack/spectypes and add full internationalization coverage.Spec Compliance Fixes
variant: 'danger'→'destructive'in 4 action files —ActionSchema.variantenum doesn't include'danger'columns: '2'→2across all 10 view files (33 occurrences) —ObjectFormSection.columnsis1 | 2 | 3 | 4, not stringtype: 'dashboard'toCrmDashboard— required byDashboardSchemai18n (10 locales)
New
examples/crm/src/i18n/with en, zh, ja, ko, de, fr, es, pt, ru, ar covering:Exported as
crmLocalesfrom the CRM barrel.Tests
24 tests validating metadata spec conformance and i18n key parity across all locales.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.