Skip to content

CRM example: spec compliance fixes and i18n (10 locales)#783

Merged
hotlong merged 3 commits intomainfrom
copilot/evaluate-metadata-standards
Feb 23, 2026
Merged

CRM example: spec compliance fixes and i18n (10 locales)#783
hotlong merged 3 commits intomainfrom
copilot/evaluate-metadata-standards

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 23, 2026

Audit all CRM example metadata against @objectstack/spec types and add full internationalization coverage.

Spec Compliance Fixes

  • variant: 'danger''destructive' in 4 action files — ActionSchema.variant enum doesn't include 'danger'
  • columns: '2'2 across all 10 view files (33 occurrences) — ObjectFormSection.columns is 1 | 2 | 3 | 4, not string
  • Added type: 'dashboard' to CrmDashboard — required by DashboardSchema
- variant: 'danger' as const,
+ variant: 'destructive' as const,

- columns: '2' as const,
+ columns: 2,

  export const CrmDashboard = {
+   type: 'dashboard' as const,
    name: 'crm_dashboard',

i18n (10 locales)

New examples/crm/src/i18n/ with en, zh, ja, ko, de, fr, es, pt, ru, ar covering:

  • Object labels/descriptions, field labels, field option values
  • Navigation, action labels/confirmText/successMessage, view labels
  • Form section labels, dashboard widgets, report columns, page content

Exported as crmLocales from the CRM barrel.

Tests

24 tests validating metadata spec conformance and i18n key parity across all locales.

Original prompt

example crm 评估所有元数据符合规范,并新增国际化


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 23, 2026 10:22am
objectui-demo Error Error Feb 23, 2026 10:22am
objectui-storybook Error Error Feb 23, 2026 10:22am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Evaluate all metadata for compliance and add internationalization CRM example: spec compliance fixes and i18n (10 locales) Feb 23, 2026
Copilot AI requested a review from hotlong February 23, 2026 10:08
@hotlong hotlong marked this pull request as ready for review February 23, 2026 10:33
Copilot AI review requested due to automatic review settings February 23, 2026 10:33
@hotlong hotlong merged commit a3471e4 into main Feb 23, 2026
2 of 4 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, converted columns from string to number type in 33 form sections across 10 view files, and added required type: '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 ロケール
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* 日本語 (ja) CRM サンプル i18n ロケール
* Japanese (ja) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,174 @@
/**
* Deutsch (de) — CRM-Beispiel i18n-Lokalisierung
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* Deutsch (de) CRM-Beispiel i18n-Lokalisierung
* German (de) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,174 @@
/**
* Français (fr) — CRM Exemple i18n locale
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* Français (fr) CRM Exemple i18n locale
* French (fr) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,116 @@
/**
* Português (pt) — CRM Exemplo i18n locale
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* Português (pt) CRM Exemplo i18n locale
* Portuguese (pt) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,116 @@
/**
* العربية (ar) — CRM مثال i18n اللغة
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* العربية (ar) CRM مثال i18n اللغة
* Arabic (ar) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,452 @@
/**
* 中文 (zh) — CRM 示例国际化语言包
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* 中文 (zh) CRM 示例国际化语言包
* Chinese (zh) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,116 @@
/**
* Русский (ru) — CRM Пример i18n локализации
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* Русский (ru) CRM Пример i18n локализации
* Russian (ru) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,174 @@
/**
* 한국어 (ko) — CRM 예제 i18n 로케일
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* 한국어 (ko) CRM 예제 i18n 로케일
* Korean (ko) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,156 @@
/**
* Español (es) — CRM Ejemplo i18n locale
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
 */
Suggested change
* Español (es) CRM Ejemplo i18n locale
* Spanish (es) CRM Example i18n locale

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants