| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 25 | 23 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 2 | 5 | 13% |
What each file covers
Sections
0 shared · 25 only in A · 23 only in B- − Translation Guidelines
- − Internationalization (i18n) Overview
- − Supported Languages
- − i18n Architecture
- − File Structure
- − Translation Files
- − Translation Keys
- − Translation Implementation
- − React Components
- − Interpolation
- − Pluralization
- − Translation Management
- − Adding New Strings
- − Translation Validation
- − Best Practices
- − Key Naming
- − String Guidelines
- − Context Information
- − Workflow
- − Development Process
- − Translation Updates
- − Quality Assurance
- − Maintenance
- − Regular Tasks
- − Tools and Automation
- + Twenty Development Rules
- + Rules Overview
- + Core Guidelines
- + Code Quality
- + React Development
- + Testing & Quality
- + Internationalization
- + How Rules Work
- + Automatic Attachment
- + Manual Reference
- + Rule Types Used
- + Development Commands
- + Frontend Commands
- + Backend Commands
- + Usage Guidelines
- + For Developers
- + For AI Assistants
- + Contributing to Rules
- + Adding New Rules
- + Updating Existing Rules
- + Rule Format Reference
- + Rule Title
- + Migration from Legacy Format
Commands
neither file has anySection tags
1 shared · 2 only in A · 5 only in B- − code-style
- − agent-behaviour
- + test
- + lint-format
- + types
- + database
- + do-not
- architecture
Line diff
nowtec/nowCRM · .cursor/rules/translations.mdc
@@ −1 @@
1---
2description: Translation guidelines for NOWCRM
3alwaysApply: false
4---
5# Translation Guidelines
6
7## Internationalization (i18n) Overview
8
9### Supported Languages
10- English (en) - Primary language
11- French (fr) - Secondary language
12- Italian (it) - Secondary language
13- German (de) - Secondary language
14
15### i18n Architecture
16- Use next-intl for React components
17- Store translations in JSON files
18- Implement namespace-based organization
19- Support for interpolation and pluralization
20
21## File Structure
22
23### Translation Files
24```
25/apps/nowcrm/messages/
26├── en.json # English translations
27├── fr.json # French translations
28├── de.json # German translations
29└── it.json # Italian translations
30```
31
32### Translation Keys
33- Use nested objects for organization
34- Follow consistent naming patterns
35- Include context in key names
36 ```json
37 {
38 "auth": {
39 "login": {
40 "title": "Sign In",
41 "email": "Email Address",
42 "password": "Password",
43 "submit": "Sign In",
44 "forgotPassword": "Forgot Password?"
45 },
46 "register": {
47 "title": "Create Account",
48 "confirmPassword": "Confirm Password"
49 }
50 }
51 }
52 ```
53
54## Translation Implementation
55
56### React Components
57- Specify namespaces for better organization
58- Handle loading states properly
59
60#### Server Components
61
62```ts
63import { getTranslations } from 'next-intl';
64
65export default async function ContactsPage() {
66 const t = await getTranslations('Contacts');
67 return (
68 <main>
69 <h1>{t('contacts.header')}</h1>
70 {/* … */}
71 </main>
72 );
73}
74```
75
76#### Client Components
77
78```tsx
79'use client';
80import { useTranslations } from 'next-intl';
81
82export default function LoginForm() {
83 const t = useTranslations('auth');
84
85 return (
86 <form>
87 <h1>{t('login.title')}</h1>
88 <input placeholder={t('login.email')} type="email" />
89 <input placeholder={t('login.password')} type="password" />
90 <button type="submit">{t('login.submit')}</button>
91 </form>
92 );
93}
94```
95
96### Interpolation
97- Use interpolation for dynamic content
98- Pass variables through t() function
99- Keep interpolation simple and readable
100 ```typescript
101 // ✅ Correct
102 const WelcomeMessage = ({ userName }: { userName: string }) => {
103 const { t } = useTranslations('common');
104
105 return (
106 <h1>{t('welcome.message', { name: userName })}</h1>
107 );
108 };
109
110 // Translation file
111 {
112 "welcome": {
113 "message": "Welcome back, {{name}}!"
114 }
115 }
116 ```
117
118### Pluralization
119- Handle singular/plural forms correctly
120- Use count-based pluralization
121- Support different plural rules per language
122 ```typescript
123 // ✅ Correct
124 const ItemCount = ({ count }: { count: number }) => {
125 const { t } = useTranslations('common');
126
127 return (
128 <span>{t('items.count', { count })}</span>
129 );
130 };
131
132 // Translation file
133 {
134 "items": {
135 "count_one": "{{count}} item",
136 "count_other": "{{count}} items"
137 }
138 }
139 ```
140
141## Translation Management
142
143### Adding New Strings
1441. Add English translation first
1452. Use descriptive keys that indicate context
1463. Include comments for translators when needed
1474. Test with long translations to ensure UI flexibility
148 ```json
149 {
150 "user": {
151 "profile": {
152 // Displayed in user profile header
153 "displayName": "Display Name",
154 // Used in forms when editing profile
155 "editDisplayName": "Edit Display Name",
156 // Confirmation message after profile update
157 "updateSuccess": "Profile updated successfully"
158 }
159 }
160 }
161 ```
162
163### Translation Validation
164- Use TypeScript for translation key validation
165- Implement automated checks for missing translations
166- Validate interpolation parameters
167 ```typescript
168 // ✅ Correct - Type-safe translations
169 type TranslationKey =
170 | 'auth.login.title'
171 | 'auth.login.email'
172 | 'auth.login.password'
173 | 'common.welcome.message';
174
175 const t = (key: TranslationKey, options?: any) => {
176 // Translation implementation
177 };
178 ```
179
180## Best Practices
181
182### Key Naming
183- Use descriptive, hierarchical keys
184- Avoid abbreviations
185- Group related translations
186- Keep keys consistent across languages
187 ```json
188 // ✅ Correct
189 {
190 "dashboard": {
191 "header": {
192 "title": "Dashboard",
193 "subtitle": "Welcome to your workspace"
194 },
195 "actions": {
196 "createNew": "Create New",
197 "refresh": "Refresh Data",
198 "export": "Export"
199 }
200 }
201 }
202
203 // ❌ Incorrect
204 {
205 "dash_title": "Dashboard",
206 "newBtn": "New",
207 "refreshData": "Refresh"
208 }
209 ```
210
211### String Guidelines
212- Write clear, concise text
213- Use consistent terminology
214- Consider character limits for UI elements
215- Avoid concatenating translated strings
216 ```json
217 // ✅ Correct
218 {
219 "user": {
220 "status": {
221 "online": "Online",
222 "offline": "Offline",
223 "away": "Away"
224 }
225 }
226 }
227
228 // ❌ Incorrect - Don't concatenate
229 {
230 "user": {
231 "statusPrefix": "User is ",
232 "statusOnline": "online"
233 }
234 }
235 ```
236
237### Context Information
238- Provide context for translators
239- Include character limits when relevant
240- Explain when/where text appears
241- Note any technical constraints
242 ```json
243 {
244 "button": {
245 // Primary action button, max 20 characters
246 "save": "Save Changes",
247 // Secondary button in modal footer
248 "cancel": "Cancel",
249 // Destructive action, should sound cautious
250 "delete": "Delete Permanently"
251 }
252 }
253 ```
254
255## Workflow
256
257### Development Process
2581. Develop features with English translations
2592. Use placeholder keys during development
2603. Finalize translation keys before feature completion
2614. Add translations to all supported languages
2625. Test with different language strings
263
264### Translation Updates
2651. Create translation tasks for new features
2662. Provide context and screenshots to translators
2673. Review translations for consistency
2684. Test UI with translated strings
2695. Update documentation when needed
270
271### Quality Assurance
272- Review translations in context
273- Test with longest expected translations
274- Verify formatting with interpolation
275- Check for cultural appropriateness
276- Ensure accessibility with screen readers
277
278## Maintenance
279
280### Regular Tasks
281- Review and update outdated translations
282- Check for unused translation keys
283- Maintain consistency across languages
284- Monitor for missing translations in new features
285
286### Tools and Automation
287- Use automated translation validation
288- Implement missing translation detection
289- Set up continuous integration checks
290- Use translation management platforms when needed
nowtec/nowCRM · .cursor/rules/readme.mdc
@@ +1 @@
1---
2description: NOWCRM development rules and best practices
3globs: []
4alwaysApply: true
5---
6# Twenty Development Rules
7
8This directory contains NOWCRM's development guidelines and best practices in the modern Cursor Rules format (MDC). These rules are automatically applied based on file patterns and provide context-aware guidance to AI assistants.
9
10## Rules Overview
11
12### Core Guidelines
13- **architecture.mdc** - Project overview, technology stack, and infrastructure setup (Always Applied)
14
15### Code Quality
16- **typescript-guidelines.mdc** - TypeScript best practices and conventions (Auto-attached to .ts/.tsx files)
17- **code-style.mdc** - General coding standards and style guide (Auto-attached to code files)
18- **file-structure.mdc** - File and directory organization patterns (Auto-attached to config files)
19
20### React Development
21- **react-general-guidelines.mdc** - Core React development principles (Auto-attached to React files)
22
23### Testing & Quality
24- **testing-guidelines.mdc** - Testing strategies and best practices (Auto-attached to test files)
25
26### Internationalization
27- **translations.mdc** - Translation workflow and i18n setup (Auto-attached to locale files)
28
29## How Rules Work
30
31### Automatic Attachment
32Rules are automatically included in your AI context based on file patterns (globs). When you work on TypeScript files, the TypeScript guidelines are automatically loaded.
33
34### Manual Reference
35You can manually reference any rule using the `@ruleName` syntax:
36- `@react-general-guidelines` - Load React best practices
37- `@testing-guidelines` - Get testing recommendations
38
39### Rule Types Used
40- **Always Applied** - Loaded in every context (architecture.mdc, README.mdc)
41- **Auto Attached** - Loaded when matching file patterns are referenced
42- **Agent Requested** - Available for AI to include when relevant
43- **Manual** - Only included when explicitly mentioned
44
45## Development Commands
46
47### Frontend Commands
48
49todo:
50
51### Backend Commands
52
53todo:
54
55## Usage Guidelines
56
57### For Developers
58- Rules are automatically applied based on file context
59- Check rule descriptions to understand when they're activated
60- Use manual references (`@ruleName`) for additional context
61- Keep rules updated as the codebase evolves
62
63### For AI Assistants
64- Rules provide consistent guidance across conversations
65- Use rule context to maintain coding standards
66- Reference specific rules when making recommendations
67- Apply rule principles in code suggestions and reviews
68
69## Contributing to Rules
70
71### Adding New Rules
721. Create a new `.mdc` file in this directory
732. Include proper metadata headers with description and globs
743. Write clear, actionable guidelines with examples
754. Test the rule with relevant file patterns
765. Update this README if needed
77
78### Updating Existing Rules
791. Modify the rule content while preserving metadata
802. Test changes with affected file patterns
813. Ensure consistency with other rules
824. Update examples and best practices as needed
83
84## Rule Format Reference
85
86Each rule file uses the MDC format with metadata:
87
88```markdown
89---
90description: Brief description of the rule's purpose
91globs: ["**/*.ts", "**/*.tsx"] # File patterns for auto-attachment
92alwaysApply: false # Whether to always include this rule
93---
94
95# Rule Title
96
97Rule content in Markdown format...
98```
99
100## Migration from Legacy Format
101
102The rules have been migrated from the legacy `.md` format to the modern `.mdc` format, providing:
103- Better context awareness through file pattern matching
104- Improved organization with metadata headers
105- More flexible rule application strategies
106- Enhanced integration with Cursor's AI features
107
108For the most up-to-date version of these guidelines, always refer to the files in this directory.
@@ −1 +1 @@
11 ---
2−description: Translation guidelines for NOWCRM
3−alwaysApply: false
2+description: NOWCRM development rules and best practices
3+globs: []
4+alwaysApply: true
45 ---
5−# Translation Guidelines
6+# Twenty Development Rules
67
7−## Internationalization (i18n) Overview
8+This directory contains NOWCRM's development guidelines and best practices in the modern Cursor Rules format (MDC). These rules are automatically applied based on file patterns and provide context-aware guidance to AI assistants.
89
9−### Supported Languages
10−- English (en) - Primary language
11−- French (fr) - Secondary language
12−- Italian (it) - Secondary language
13−- German (de) - Secondary language
10+## Rules Overview
1411
15−### i18n Architecture
16−- Use next-intl for React components
17−- Store translations in JSON files
18−- Implement namespace-based organization
19−- Support for interpolation and pluralization
12+### Core Guidelines
13+- **architecture.mdc** - Project overview, technology stack, and infrastructure setup (Always Applied)
2014
21−## File Structure
15+### Code Quality
16+- **typescript-guidelines.mdc** - TypeScript best practices and conventions (Auto-attached to .ts/.tsx files)
17+- **code-style.mdc** - General coding standards and style guide (Auto-attached to code files)
18+- **file-structure.mdc** - File and directory organization patterns (Auto-attached to config files)
2219
23−### Translation Files
24−```
25−/apps/nowcrm/messages/
26−├── en.json # English translations
27−├── fr.json # French translations
28−├── de.json # German translations
29−└── it.json # Italian translations
30−```
20+### React Development
21+- **react-general-guidelines.mdc** - Core React development principles (Auto-attached to React files)
3122
32−### Translation Keys
33−- Use nested objects for organization
34−- Follow consistent naming patterns
35−- Include context in key names
36− ```json
37− {
38− "auth": {
39− "login": {
40− "title": "Sign In",
41− "email": "Email Address",
42− "password": "Password",
43− "submit": "Sign In",
44− "forgotPassword": "Forgot Password?"
45− },
46− "register": {
47− "title": "Create Account",
48− "confirmPassword": "Confirm Password"
49− }
50− }
51− }
52− ```
23+### Testing & Quality
24+- **testing-guidelines.mdc** - Testing strategies and best practices (Auto-attached to test files)
5325
54−## Translation Implementation
26+### Internationalization
27+- **translations.mdc** - Translation workflow and i18n setup (Auto-attached to locale files)
5528
56−### React Components
57−- Specify namespaces for better organization
58−- Handle loading states properly
29+## How Rules Work
5930
60−#### Server Components
31+### Automatic Attachment
32+Rules are automatically included in your AI context based on file patterns (globs). When you work on TypeScript files, the TypeScript guidelines are automatically loaded.
6133
62−```ts
63−import { getTranslations } from 'next-intl';
34+### Manual Reference
35+You can manually reference any rule using the `@ruleName` syntax:
36+- `@react-general-guidelines` - Load React best practices
37+- `@testing-guidelines` - Get testing recommendations
6438
65−export default async function ContactsPage() {
66− const t = await getTranslations('Contacts');
67− return (
68− <main>
69− <h1>{t('contacts.header')}</h1>
70− {/* … */}
71− </main>
72− );
73−}
74−```
39+### Rule Types Used
40+- **Always Applied** - Loaded in every context (architecture.mdc, README.mdc)
41+- **Auto Attached** - Loaded when matching file patterns are referenced
42+- **Agent Requested** - Available for AI to include when relevant
43+- **Manual** - Only included when explicitly mentioned
7544
76−#### Client Components
45+## Development Commands
7746
78−```tsx
79−'use client';
80−import { useTranslations } from 'next-intl';
47+### Frontend Commands
8148
82−export default function LoginForm() {
83− const t = useTranslations('auth');
49+todo:
8450
85− return (
86− <form>
87− <h1>{t('login.title')}</h1>
88− <input placeholder={t('login.email')} type="email" />
89− <input placeholder={t('login.password')} type="password" />
90− <button type="submit">{t('login.submit')}</button>
91− </form>
92− );
93−}
94−```
51+### Backend Commands
9552
96−### Interpolation
97−- Use interpolation for dynamic content
98−- Pass variables through t() function
99−- Keep interpolation simple and readable
100− ```typescript
101− // ✅ Correct
102− const WelcomeMessage = ({ userName }: { userName: string }) => {
103− const { t } = useTranslations('common');
53+todo:
10454
105− return (
106− <h1>{t('welcome.message', { name: userName })}</h1>
107− );
108− };
55+## Usage Guidelines
10956
110− // Translation file
111− {
112− "welcome": {
113− "message": "Welcome back, {{name}}!"
114− }
115− }
116− ```
57+### For Developers
58+- Rules are automatically applied based on file context
59+- Check rule descriptions to understand when they're activated
60+- Use manual references (`@ruleName`) for additional context
61+- Keep rules updated as the codebase evolves
11762
118−### Pluralization
119−- Handle singular/plural forms correctly
120−- Use count-based pluralization
121−- Support different plural rules per language
122− ```typescript
123− // ✅ Correct
124− const ItemCount = ({ count }: { count: number }) => {
125− const { t } = useTranslations('common');
63+### For AI Assistants
64+- Rules provide consistent guidance across conversations
65+- Use rule context to maintain coding standards
66+- Reference specific rules when making recommendations
67+- Apply rule principles in code suggestions and reviews
12668
127− return (
128− <span>{t('items.count', { count })}</span>
129− );
130− };
69+## Contributing to Rules
13170
132− // Translation file
133− {
134− "items": {
135− "count_one": "{{count}} item",
136− "count_other": "{{count}} items"
137− }
138− }
139− ```
71+### Adding New Rules
72+1. Create a new `.mdc` file in this directory
73+2. Include proper metadata headers with description and globs
74+3. Write clear, actionable guidelines with examples
75+4. Test the rule with relevant file patterns
76+5. Update this README if needed
14077
141−## Translation Management
78+### Updating Existing Rules
79+1. Modify the rule content while preserving metadata
80+2. Test changes with affected file patterns
81+3. Ensure consistency with other rules
82+4. Update examples and best practices as needed
14283
143−### Adding New Strings
144−1. Add English translation first
145−2. Use descriptive keys that indicate context
146−3. Include comments for translators when needed
147−4. Test with long translations to ensure UI flexibility
148− ```json
149− {
150− "user": {
151− "profile": {
152− // Displayed in user profile header
153− "displayName": "Display Name",
154− // Used in forms when editing profile
155− "editDisplayName": "Edit Display Name",
156− // Confirmation message after profile update
157− "updateSuccess": "Profile updated successfully"
158− }
159− }
160− }
161− ```
84+## Rule Format Reference
16285
163−### Translation Validation
164−- Use TypeScript for translation key validation
165−- Implement automated checks for missing translations
166−- Validate interpolation parameters
167− ```typescript
168− // ✅ Correct - Type-safe translations
169− type TranslationKey =
170− | 'auth.login.title'
171− | 'auth.login.email'
172− | 'auth.login.password'
173− | 'common.welcome.message';
86+Each rule file uses the MDC format with metadata:
17487
175− const t = (key: TranslationKey, options?: any) => {
176− // Translation implementation
177− };
178− ```
88+```markdown
89+---
90+description: Brief description of the rule's purpose
91+globs: ["**/*.ts", "**/*.tsx"] # File patterns for auto-attachment
92+alwaysApply: false # Whether to always include this rule
93+---
17994
180−## Best Practices
95+# Rule Title
18196
182−### Key Naming
183−- Use descriptive, hierarchical keys
184−- Avoid abbreviations
185−- Group related translations
186−- Keep keys consistent across languages
187− ```json
188− // ✅ Correct
189− {
190− "dashboard": {
191− "header": {
192− "title": "Dashboard",
193− "subtitle": "Welcome to your workspace"
194− },
195− "actions": {
196− "createNew": "Create New",
197− "refresh": "Refresh Data",
198− "export": "Export"
199− }
200− }
201− }
97+Rule content in Markdown format...
98+```
20299
203− // ❌ Incorrect
204− {
205− "dash_title": "Dashboard",
206− "newBtn": "New",
207− "refreshData": "Refresh"
208− }
209− ```
100+## Migration from Legacy Format
210101
211−### String Guidelines
212−- Write clear, concise text
213−- Use consistent terminology
214−- Consider character limits for UI elements
215−- Avoid concatenating translated strings
216− ```json
217− // ✅ Correct
218− {
219− "user": {
220− "status": {
221− "online": "Online",
222− "offline": "Offline",
223− "away": "Away"
224− }
225− }
226− }
102+The rules have been migrated from the legacy `.md` format to the modern `.mdc` format, providing:
103+- Better context awareness through file pattern matching
104+- Improved organization with metadata headers
105+- More flexible rule application strategies
106+- Enhanced integration with Cursor's AI features
227107
228− // ❌ Incorrect - Don't concatenate
229− {
230− "user": {
231− "statusPrefix": "User is ",
232− "statusOnline": "online"
233− }
234− }
235− ```
236−
237−### Context Information
238−- Provide context for translators
239−- Include character limits when relevant
240−- Explain when/where text appears
241−- Note any technical constraints
242− ```json
243− {
244− "button": {
245− // Primary action button, max 20 characters
246− "save": "Save Changes",
247− // Secondary button in modal footer
248− "cancel": "Cancel",
249− // Destructive action, should sound cautious
250− "delete": "Delete Permanently"
251− }
252− }
253− ```
254−
255−## Workflow
256−
257−### Development Process
258−1. Develop features with English translations
259−2. Use placeholder keys during development
260−3. Finalize translation keys before feature completion
261−4. Add translations to all supported languages
262−5. Test with different language strings
263−
264−### Translation Updates
265−1. Create translation tasks for new features
266−2. Provide context and screenshots to translators
267−3. Review translations for consistency
268−4. Test UI with translated strings
269−5. Update documentation when needed
270−
271−### Quality Assurance
272−- Review translations in context
273−- Test with longest expected translations
274−- Verify formatting with interpolation
275−- Check for cultural appropriateness
276−- Ensure accessibility with screen readers
277−
278−## Maintenance
279−
280−### Regular Tasks
281−- Review and update outdated translations
282−- Check for unused translation keys
283−- Maintain consistency across languages
284−- Monitor for missing translations in new features
285−
286−### Tools and Automation
287−- Use automated translation validation
288−- Implement missing translation detection
289−- Set up continuous integration checks
290−- Use translation management platforms when needed
108+For the most up-to-date version of these guidelines, always refer to the files in this directory.
