> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/frameworks-and-ai/react.md).

# React

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

The [`@weglot/translate-react`](https://www.npmjs.com/package/@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.

{% hint style="info" %}
The package requires a **Weglot 2.0** project. It is currently in preview.
{% endhint %}

{% hint style="warning" %}
The visitor's language is stored in a cookie, so all languages share the same URLs. Search engines index your website in its source language only.
{% endhint %}

## In this section

* [Getting started](/frameworks-and-ai/react/getting-started.md): install the package on Next.js or Vite.
* [Settings](/frameworks-and-ai/react/settings.md): configure what gets translated and how builds behave.
* [Dynamic content](/frameworks-and-ai/react/dynamic-content.md): translate content from a CMS, an API or your users.
* [Use cases](/frameworks-and-ai/react/use-cases.md): exclude content, translate your own component props, build a language switcher.
* [Troubleshooting](/frameworks-and-ai/react/troubleshooting.md): fix common issues.

## Guides

* [Sanity](/frameworks-and-ai/react/guides/sanity.md): translate a Sanity website built with Next.js.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.weglot.com/frameworks-and-ai/react.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
