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

Weglot Developer Documentation

Translate your project with Weglot, and customize the Weglot plugins and libraries.

GitBook Assistant

Translate your project

Translate a React app in minutes

Install the Weglot package on your Next.js or Vite app. Text written in your code is translated when your app is built, and languages and translations are managed in your Weglot 2.0 project.

Get started Troubleshooting

1

Create your project

Sign in to Weglot 2.0, create a project with its source and target languages, then copy its API key, from your project settings.

Sign in to Weglot 2.0

2

Install the package

npm install @weglot/translate-react
echo "WEGLOT_API_KEY=pk_your_weglot_api_key" >> .env
3

Add the plugin

// next.config.ts
import { withWeglot } from "@weglot/translate-react/next";

export default async function () {
  return await withWeglot({}, { sourceRoot: "./app" });
}
// vite.config.ts
import { defineConfig } from "vite";
import { weglotPlugin } from "@weglot/translate-react/vite";

export default defineConfig({
  plugins: [weglotPlugin({ sourceRoot: "src" })],
});

Then wrap your app with WeglotProvider. See the full setup.

Customize your integration

Coming soon: the Weglot MCP server, to add Weglot to your project and manage your translations from your LLM, and the reference for the new Weglot API 2.0.

Join the Weglot developer community

Ask questions, share feedback and follow what we build.

Last updated