Cursor rule
.cursor/rules/translations.mdcTranslation guidelines for NOWCRM
Cursor rules
Quality
62/100
Scores the file, not the repository.Length
825 words
27 headings · 11 code blocksRepository
26
— · pushed 116 days agoLast changed
3 days ago
First indexed 3 days ago.12345# Translation Guidelines67## Internationalization (i18n) Overview89### Supported Languages10- English (en) - Primary language11- French (fr) - Secondary language12- Italian (it) - Secondary language13- German (de) - Secondary language1415### i18n Architecture16- Use next-intl for React components17- Store translations in JSON files18- Implement namespace-based organization19- Support for interpolation and pluralization2021## File Structure2223### Translation Files24```25/apps/nowcrm/messages/26├── en.json # English translations27├── fr.json # French translations28├── de.json # German translations29└── it.json # Italian translations30```3132### Translation Keys33- Use nested objects for organization34- Follow consistent naming patterns35- Include context in key names36```json37 {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```5354## Translation Implementation5556### React Components57- Specify namespaces for better organization58- Handle loading states properly5960#### Server Components6162```ts63import { getTranslations } from 'next-intl';6465export 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```7576#### Client Components7778```tsx79'use client';80import { useTranslations } from 'next-intl';8182export default function LoginForm() {83 const t = useTranslations('auth');8485 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```9596### Interpolation97- Use interpolation for dynamic content98- Pass variables through t() function99- Keep interpolation simple and readable100```typescript101 // ✅ Correct102 const WelcomeMessage = ({ userName }: { userName: string }) => {103 const { t } = useTranslations('common');104105 return (106 <h1>{t('welcome.message', { name: userName })}</h1>107 );108 };109110 // Translation file111 {112 "welcome": {113 "message": "Welcome back, {{name}}!"114 }115 }116```117118### Pluralization119- Handle singular/plural forms correctly120- Use count-based pluralization121- Support different plural rules per language122```typescript123 // ✅ Correct124 const ItemCount = ({ count }: { count: number }) => {125 const { t } = useTranslations('common');126127 return (128 <span>{t('items.count', { count })}</span>129 );130 };131132 // Translation file133 {134 "items": {135 "count_one": "{{count}} item",136 "count_other": "{{count}} items"137 }138 }139```140141## Translation Management142143### Adding New Strings1441. Add English translation first1452. Use descriptive keys that indicate context1463. Include comments for translators when needed1474. Test with long translations to ensure UI flexibility148```json149 {150 "user": {151 "profile": {152 // Displayed in user profile header153 "displayName": "Display Name",154 // Used in forms when editing profile155 "editDisplayName": "Edit Display Name",156 // Confirmation message after profile update157 "updateSuccess": "Profile updated successfully"158 }159 }160 }161```162163### Translation Validation164- Use TypeScript for translation key validation165- Implement automated checks for missing translations166- Validate interpolation parameters167```typescript168 // ✅ Correct - Type-safe translations169 type TranslationKey =170 | 'auth.login.title'171 | 'auth.login.email'172 | 'auth.login.password'173 | 'common.welcome.message';174175 const t = (key: TranslationKey, options?: any) => {176 // Translation implementation177 };178```179180## Best Practices181182### Key Naming183- Use descriptive, hierarchical keys184- Avoid abbreviations185- Group related translations186- Keep keys consistent across languages187```json188 // ✅ Correct189 {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 }202203 // ❌ Incorrect204 {205 "dash_title": "Dashboard",206 "newBtn": "New",207 "refreshData": "Refresh"208 }209```210211### String Guidelines212- Write clear, concise text213- Use consistent terminology214- Consider character limits for UI elements215- Avoid concatenating translated strings216```json217 // ✅ Correct218 {219 "user": {220 "status": {221 "online": "Online",222 "offline": "Offline",223 "away": "Away"224 }225 }226 }227228 // ❌ Incorrect - Don't concatenate229 {230 "user": {231 "statusPrefix": "User is ",232 "statusOnline": "online"233 }234 }235```236237### Context Information238- Provide context for translators239- Include character limits when relevant240- Explain when/where text appears241- Note any technical constraints242```json243 {244 "button": {245 // Primary action button, max 20 characters246 "save": "Save Changes",247 // Secondary button in modal footer248 "cancel": "Cancel",249 // Destructive action, should sound cautious250 "delete": "Delete Permanently"251 }252 }253```254255## Workflow256257### Development Process2581. Develop features with English translations2592. Use placeholder keys during development2603. Finalize translation keys before feature completion2614. Add translations to all supported languages2625. Test with different language strings263264### Translation Updates2651. Create translation tasks for new features2662. Provide context and screenshots to translators2673. Review translations for consistency2684. Test UI with translated strings2695. Update documentation when needed270271### Quality Assurance272- Review translations in context273- Test with longest expected translations274- Verify formatting with interpolation275- Check for cultural appropriateness276- Ensure accessibility with screen readers277278## Maintenance279280### Regular Tasks281- Review and update outdated translations282- Check for unused translation keys283- Maintain consistency across languages284- Monitor for missing translations in new features285286### Tools and Automation287- Use automated translation validation288- Implement missing translation detection289- Set up continuous integration checks290- Use translation management platforms when needed
Also in nowtec/nowCRM
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nowtec/nowCRM.cursor/rules/architecture.mdc · 26 | Cursor rules | arch | 54/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/code-style.mdc · 26 | Cursor rules | lint-formatstylearchdocs | 62/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/file-structure.mdc · 26 | Cursor rules | buildstylearch | 70/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/react-general-guidelines.mdc · 26 | Cursor rules | archuiperformancedo-not | 61/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/readme.mdc · 26 | Cursor rules | testlint-formatarchtypes+2 | 73/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/testing-guidelines.mdc · 26 | Cursor rules | setupteststylearch+3 | 73/100 | 3 days ago | |
| nowtec/nowCRM.cursor/rules/typescript-guidelines.mdc · 26 | Cursor rules | styletypesui | 58/100 | 3 days ago | |
| nowtec/nowCRMCLAUDE.md · 26 | CLAUDE.md | buildstyledeployment | 21/100 | 3 days ago |
Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/code-style.mdc Diff against .cursor/rules/file-structure.mdc Diff against .cursor/rules/react-general-guidelines.mdc Diff against .cursor/rules/readme.mdc Diff against .cursor/rules/testing-guidelines.mdc Diff against .cursor/rules/typescript-guidelines.mdc Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
