chore(docs): split 11 CLAUDE.md sections into .claude/rules/
This commit is contained in:
1 parent
78aacc09e1
commit
7a75974dc3
13 files changed
+175
-139
No files matched your search
@@ -0,0 +1,13 @@
|
||||
---
|
||||
paths: ["apps/app/src/i18n/**", "apps/app/src/state/localeStore.ts", "apps/app/src/pdf/labels.ts", "apps/app/src/auth/validation.ts", "apps/app/src/account/validation.ts"]
|
||||
---
|
||||
|
||||
# i18n
|
||||
- All user-facing strings live in `src/i18n/fr.ts` and `src/i18n/en.ts` (flat `Record<string, string>`)
|
||||
- Key convention: `<area>.<key>` — e.g. `common.cancel`, `home.new_report.title`, `pdf.subject`
|
||||
- Both dicts must share the exact same key set; a key missing in one dict logs a warning in DEV
|
||||
- Get the translate function in any component: `const t = useT()` then `t('common.cancel')`
|
||||
- `src/state/localeStore.ts` holds current `Locale` (`'fr' | 'en'`), persisted to `localStorage` key `osteo:locale`; default: navigator-detected `fr`/`en`, or `'fr'` if no match; while signed in, `services/localeSync.ts` writes it to `profiles.locale` and applies the account locale on sign-in
|
||||
- Form validation messages are i18n keys returned by the Zod schemas (`src/auth/validation.ts`, `src/account/validation.ts`), translated next to the field; GoTrue messages never reach the screen (`auth.failure.*`)
|
||||
- Zone and finding names shown in the editor and the PDF come from the sheet document (`{ fr, en }` labels) and from the report's snapshots, not from the dict
|
||||
- PDF static labels (section headings, metadata) live in `apps/app/src/pdf/labels.ts` (`defaultPdfLabels`, 25 keys, moved verbatim from the engine at R4.6) and are archived in the envelope; the app dicts hold no `pdf.*` key
|
||||
Reference in new issue
Block a user