Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example repository showing how to transform React to introduce i18n

License

NotificationsYou must be signed in to change notification settings

lingualdev/react-i18n-transformations

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 diff between pre and post 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.

How to test

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:

pnpmtest

About

Example repository showing how to transform React to introduce i18n

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp