1.4 KiB
1.4 KiB
paths
| paths | |||||
|---|---|---|---|---|---|
|
i18n
- All user-facing strings live in
src/i18n/fr.tsandsrc/i18n/en.ts(flatRecord<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()thent('common.cancel') src/state/localeStore.tsholds currentLocale('fr' | 'en'), persisted tolocalStoragekeyosteo:locale; default: navigator-detectedfr/en, or'fr'if no match; while signed in,services/localeSync.tswrites it toprofiles.localeand 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 nopdf.*key