JavaScript and React
Translate content on a server, render message catalogs in React, and connect locale routing to your application.
JavaScript applications use translation in two places. A server sends content to a localization engine and stores the result. A user interface loads translated messages and renders them with the right values, grammar, and formatting. Choose the package for the part you are building.
Translate from your server #
Use the JavaScript API guide to create translation jobs with native fetch, follow their progress, and download completed files. Keep the API key on the server and retain each job's identity with the source revision it translates.
Applications using LingoDotDevEngine have a separate SDK v0 reference. Its sync API and client-side batching remain documented there.
Render messages in React #
React keeps the source message and its context in the component. A catalog supplies the translated template; the runtime inserts values and creates the React elements your application controls. Rendering needs no translation API key.
Start with one translated component, using a local catalog. Then extract and load catalogs as the application grows. The Next.js Pages and TanStack Start recipes connect those catalogs to requests, routes, and language switching. For your own router, locale-router provides the underlying URL and language-preference decisions.
Connect a Payload application #
The Payload CMS plugin exposes the field schema and notifies Lingo.dev when source content changes. The Payload integration configures which content to translate and where to write it back.
Example projects #
These repositories show how source files and application loading fit together. Read each project's dependency versions and configuration before adapting it; some use a different package generation from these manuals. In a fork, connect your own Lingo.dev project before submitting translation work.
| Project | Useful starting point |
|---|---|
| React + Vite | Component messages, extraction, and catalog loading. |
| Next.js Pages | Page messages and locale-aware routes. |
| TypeScript modules | Static exported locale data. Use the TypeScript handler's supported default-export shape; unsupported exports can yield no translation units. |
| iOS | Apple resources and native locale selection. |
| Android | Resource directories and string lookup. |
| Flutter | ARB metadata and generated messages. |
| Markdown | Document paths and frontmatter. |
| Markdoc + Next.js | Translatable tag properties and document rendering. |
| OpenAPI | Human-readable descriptions within an API specification. |
| Rails | Locale-root YAML and framework lookup. |
| Laravel | Resource files and framework loading. |
Native resources and documents use the CLI and their format handlers. They do not need the React runtime merely because they appear in this example collection.