/** * Lift hard-coded English out of components and into the catalogue. * * node scripts/i18n-extract.mjs --dry src/components/krow * node scripts/i18n-extract.mjs src/components/krow/SomeCard.tsx * * An AST codemod rather than a regex pass, because the hard part is not finding * the string — it is knowing which component encloses it, so `const { t } = * useTranslation()` lands in the right function and not in a module-level * constant where hooks cannot run. * * WHAT IT WILL TOUCH * - JSX text children that are entirely static words * - string literals on a short list of text-bearing attributes * * WHAT IT LEAVES ALONE, and why each one would be a bug: * - anything inside a module-level object or array; those are built once at * import, so a t() there freezes the first language the app loaded * - strings with no letters, single characters, and pure punctuation * - `className`, `id`, `key`, `type`, `name`, routes, urls, test ids * - text inside ,
,