Browse Source

chore: Add Claude Code rules for dashboard i18n (#4166)

Housein Abo Shaar 1 day ago
parent
commit
92f0d0cbe5
1 changed files with 28 additions and 0 deletions
  1. 28 0
      .claude/rules/dashboard.md

+ 28 - 0
.claude/rules/dashboard.md

@@ -0,0 +1,28 @@
+---
+paths:
+  - "packages/dashboard/**/*.tsx"
+  - "packages/dashboard/**/*.ts"
+---
+
+# Dashboard Development
+
+## i18n / Translations
+
+**All user-facing strings MUST be wrapped for translation.** Never hard-code English strings.
+
+```tsx
+import { Trans, useLingui } from '@lingui/react/macro';
+
+// JSX content
+<Trans>Your text here</Trans>
+
+// Dynamic strings (variables, props, toasts)
+const { t } = useLingui();
+toast.success(t`Operation completed`);
+```
+
+**When adding default config values** (dropdown options, reason lists, status labels):
+- Use `t\`...\`` at render time
+- Never hardcode English strings that display to users
+
+Translation files: `packages/dashboard/src/i18n/locales/*.po`