Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

React

Translate your React and Next.js apps with the Weglot package.

The @weglot/translate-react package translates your React and Next.js apps with your Weglot project. There are no translation files and no components to wrap your text in:

  • Text written in your code (JSX) is detected and translated when your app is built.

  • Content your code never sees, such as CMS content, is translated server-side when the page renders.

Your Weglot project API key is the only required configuration. Source and target languages come from your Weglot project, and translations appear in your Weglot dashboard, where you can review and edit them.

The package requires a Weglot 2.0 project. It is currently in preview.

In this section

  • Getting started: install the package on Next.js or Vite.

  • Settings: configure what gets translated and how builds behave.

  • Dynamic content: translate content from a CMS, an API or your users.

  • Use cases: exclude content, translate your own component props, build a language switcher.

  • Troubleshooting: fix common issues.

Guides

  • Sanity: translate a Sanity website built with Next.js.

Last updated