| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 8 | 25 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 2 | 1 | 1 | 50% |
What each file covers
Sections
0 shared · 8 only in A · 25 only in B- − File Structure Guidelines
- − Directory Organization
- − File Naming
- − Index Files & Barrel Exports
- − File Size Guidelines
- − Configuration Files
- − Project Configuration
- − Build Configuration
- + 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
Commands
neither file has anySection tags
2 shared · 1 only in A · 1 only in B- − build
- + agent-behaviour
- code-style
- architecture
Line diff
nowtec/nowCRM · .cursor/rules/file-structure.mdc
@@ −1 @@
1---
2description: File structure guidelines for NOWCRM
3globs: []
4alwaysApply: true
5---
6# File Structure Guidelines
7
8## Directory Organization
9```
10apps/nowcrm/
11├── components/ # Reusable UI components
12├── app/ # Route components
13├── i18n/ # I18N configuration
14├── lib/ # Handling server actions and different utils
15├── hooks/ # Custom hooks
16├── types/ # Type definitions
17└── messages/ # I18N jsons for each language
18
19apps/composer/src/
20├── api/ # Api routes
21├── api-docs/ # Handling api routes setup
22├── common/ # Common and reused utils
23├── lib/ # Functions, types and workers
24└── scheduler/ # Scheduler which are integrated with composer calendar
25
26apps/journeys/src/
27├── api/ # Handling webhooks api routes for journeys
28├── common/ # Common and reused utils
29├── consumers/ # All journeys consumers setup
30├── cron/ # Cron jobs which acts as a producer to create new jobs
31├── jobs/ # All job configuration
32├── lib/ # Functions, types and workers
33└── rabbitmq/ # Rabbitmq setup
34```
35
36## File Naming
37- **kebab-case** for all files and directories
38- **Descriptive suffixes** for clarity
39```
40// ✅ Correct naming
41user.tsx
42user.component.tsx
43user.service.ts
44user.test.tsx
45```
46
47## Index Files & Barrel Exports
48```typescript
49// ✅ Clean barrel exports in index.ts
50export { UserCard } from './user-card.component';
51export { UserList } from './user-list.component';
52export type { UserCardProps, UserListProps } from './types';
53
54// ✅ Usage - clean imports
55import { UserCard, UserList } from '@/components/user';
56```
57
58## File Size Guidelines
59- **Components**: Under 300 lines if possible
60- **Services**: Under 500 lines if possible
61- **Extract logic** into hooks/utilities when files grow large
62- **Use composition** over large monolithic components
63
64## Configuration Files
65
66### Project Configuration
67```
68.vscode/ # VSCode settings
69├── settings.json
70├── extensions.json
71└── launch.json
72
73.github/ # GitHub workflows
74├── workflows/
75└── templates/
76
77.cursor/ # Cursor rules
78├── rules/
79└── environment.json
80```
81
82### Build Configuration
83- Keep build configs in root or package directories
84- Use consistent naming for config files
85- Comment complex configurations
86- Version control all configuration files
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
@@ −1 +1 @@
11 ---
2−description: File structure guidelines for NOWCRM
3−globs: []
4−alwaysApply: true
2+description: Translation guidelines for NOWCRM
3+alwaysApply: false
54 ---
6−# File Structure Guidelines
5+# Translation Guidelines
76
8−## Directory Organization
9−```
10−apps/nowcrm/
11−├── components/ # Reusable UI components
12−├── app/ # Route components
13−├── i18n/ # I18N configuration
14−├── lib/ # Handling server actions and different utils
15−├── hooks/ # Custom hooks
16−├── types/ # Type definitions
17−└── messages/ # I18N jsons for each language
7+## Internationalization (i18n) Overview
188
19−apps/composer/src/
20−├── api/ # Api routes
21−├── api-docs/ # Handling api routes setup
22−├── common/ # Common and reused utils
23−├── lib/ # Functions, types and workers
24−└── scheduler/ # Scheduler which are integrated with composer calendar
9+### Supported Languages
10+- English (en) - Primary language
11+- French (fr) - Secondary language
12+- Italian (it) - Secondary language
13+- German (de) - Secondary language
2514
26−apps/journeys/src/
27−├── api/ # Handling webhooks api routes for journeys
28−├── common/ # Common and reused utils
29−├── consumers/ # All journeys consumers setup
30−├── cron/ # Cron jobs which acts as a producer to create new jobs
31−├── jobs/ # All job configuration
32−├── lib/ # Functions, types and workers
33−└── rabbitmq/ # Rabbitmq setup
34−```
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
3520
36−## File Naming
37−- **kebab-case** for all files and directories
38−- **Descriptive suffixes** for clarity
21+## File Structure
22+
23+### Translation Files
3924 ```
40−// ✅ Correct naming
41−user.tsx
42−user.component.tsx
43−user.service.ts
44−user.test.tsx
25+/apps/nowcrm/messages/
26+├── en.json # English translations
27+├── fr.json # French translations
28+├── de.json # German translations
29+└── it.json # Italian translations
4530 ```
4631
47−## Index Files & Barrel Exports
48−```typescript
49−// ✅ Clean barrel exports in index.ts
50−export { UserCard } from './user-card.component';
51−export { UserList } from './user-list.component';
52−export type { UserCardProps, UserListProps } from './types';
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+ ```
5353
54−// ✅ Usage - clean imports
55−import { UserCard, UserList } from '@/components/user';
56−```
54+## Translation Implementation
5755
58−## File Size Guidelines
59−- **Components**: Under 300 lines if possible
60−- **Services**: Under 500 lines if possible
61−- **Extract logic** into hooks/utilities when files grow large
62−- **Use composition** over large monolithic components
56+### React Components
57+- Specify namespaces for better organization
58+- Handle loading states properly
6359
64−## Configuration Files
60+#### Server Components
6561
66−### Project Configuration
62+```ts
63+import { getTranslations } from 'next-intl';
64+
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+}
6774 ```
68−.vscode/ # VSCode settings
69−├── settings.json
70−├── extensions.json
71−└── launch.json
7275
73−.github/ # GitHub workflows
74−├── workflows/
75−└── templates/
76+#### Client Components
7677
77−.cursor/ # Cursor rules
78−├── rules/
79−└── environment.json
78+```tsx
79+'use client';
80+import { useTranslations } from 'next-intl';
81+
82+export 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+}
8094 ```
8195
82−### Build Configuration
83−- Keep build configs in root or package directories
84−- Use consistent naming for config files
85−- Comment complex configurations
86−- Version control all configuration files
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
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+ ```
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
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
