- Notifications
You must be signed in to change notification settings - Fork0
Example repository showing how to transform React to introduce i18n
License
lingualdev/react-i18n-transformations
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository contains examples on how to transform your React code to replace hard coded strings with translation functions. The setup can be seen as a starting point for building your own transformers to scaffold yourreact-i18next orreact-intl internationalization. These examples are used in the blog postScaffolding your internatlization in React with automation.
The examples usets-morph but this can be replaced by either working directly with theTypscript compiler API or using another AST parser.
There are more transformations than can be useful like automatically replacing any alt tags text with a translation function. Thetransform function can be extended to handle more automatic transformations.
Thetransformers can be found in thesrc/transformers folder, and the tests in thetests folder.
Install all required dependencies:
pnpm install
Then run all the tests:
pnpmtestAbout
Example repository showing how to transform React to introduce i18n
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
