generated from ModusCreateOrg/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
30 lines (23 loc) · 1012 Bytes
/
.cursorrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Cursor Rules
## Always Use i18n for Text in React Files
Always use the internationalization (i18n) system for any text displayed to users in React components.
```typescript
// ❌ AVOID hardcoded text
<label>Email</label>
<span>Don't have an account?</span>
<button>Log in</button>
// ✅ PREFERRED - Use t() function from react-i18next
<label>{t('label.email', { ns: 'auth' })}</label>
<span>{t('no-account', { ns: 'auth' })}</span>
<button>{t('signin', { ns: 'auth' })}</button>
```
### Translation Key Guidelines:
- Use namespaces to organize translations (e.g., { ns: 'auth' })
- Use hierarchical keys with dots for organization (e.g., 'label.email')
- Ensure all keys are defined in the appropriate translation files
### Common Namespaces:
- 'common' - app-wide common labels and messages
- 'auth' - authentication related texts
- 'errors' - error messages
- 'validation' - form validation messages
This rule ensures our application supports multiple languages and facilitates future translations.