Using jscodeshift for the transformation.
Start with no local changes or staged changes.
Open a terminal in packages/twenty-i18n
yarn codemod
git add -A
cd ../twenty-front
yarn format:staged
cd ../twenty-i18n
- Current version doesn't always properly add useTranslation at the correct spot. Sometimes it end in a useCallback (hooks can't be used in callbacks) ==> Maybe
always use
import i18n from '~/utils/translation-utils';
with maybe a custom tspath.
Hooks in react component: Outside: i18next/react-i18next#909
- Constants in packages/twenty-front/src/modules/settings/integrations/constants/*
Transformer based on https://github.com/BartoszJarocki/jscodeshift-react-i18next and modified
- To better handle emotion tagged template
- To handle function components without return statements