Platforms · Web and React

Localize your React or Next.js app

Keep the i18n library you already use. Glotra manages the JSON it reads: your coding agent adds keys as it builds features, Glotra machine-translates them, and someone on your team approves them before release.

Bring your existing files

Drop your JSON message files, such as en.json or web_en.json, into a project. Glotra reads the language from each filename, matches keys across languages and tags them in one pass. Your iOS and Android files can go into the same project.

Feed next-intl, i18next or react-intl

Fetch the export once per build, or cache it on your server, and hand the map to your library:

typescript
// GLOTRA_API_KEY is a read-only project API key.
const BASE = "https://api.glotra.app";

export async function loadMessages(platform = "web") {
  const res = await fetch(`${BASE}/sdk/export?platform=${platform}`, {
    headers: { "X-API-Key": process.env.GLOTRA_API_KEY! },
    // Strings change rarely: cache in your build or a short-lived server cache.
    next: { revalidate: 3600 },
  });
  if (!res.ok) throw new Error(`Glotra export failed: ${res.status}`);
  const { languages } = await res.json();
  return languages; // languages["en"].simple["auth.login.title"] -> "Sign in"
}

Simple strings and plurals come back separately. Flatten them into the dotted-key map most libraries expect, with plurals as ICU messages:

typescript
// One language as the "dotted key -> string" map most i18n libraries expect.
const lang = languages["en"];
const messages = {
  ...lang.simple,
  // Plurals as ICU, keyed on "count":
  ...Object.fromEntries(
    Object.entries(lang.plural).map(([key, forms]) => [
      key,
      `{count, plural, ${Object.entries(forms)
        .map(([form, text]) => `${form} {${text}}`)
        .join(" ")}}`,
    ]),
  ),
};

Keys that only ship to the web

Every key records the platforms it belongs to. A web export contains only the keys marked for web, so mobile-only strings stay out of your bundle.

Get the files into your repo

DeliveryWhat you getPlans
DownloadA zip with {lang}/strings.json per languageEvery plan
GitHub syncTranslation pull requests to locales/{lang}.json, or the path you chooseGrowth and Advanced
Over the airJSON from the export endpoint, fetched at build time or on your serverEvery plan

Or pull the current strings in a CI step and commit or bundle them:

bash
curl -fsS -H "X-API-Key: $GLOTRA_API_KEY" \
  "https://api.glotra.app/sdk/export?platform=web" -o messages.json

The full reference is in the web docs.

Let your agent add the strings

Connect Claude Code, Cursor or VS Code Copilot to Glotra over MCP, then ask for the work in plain words:

Find the hardcoded user-facing strings in src/checkout, add them to
my Glotra project as keys, and replace them with lookups using the
i18n setup this codebase already has. Then tell me which translations
need review.

The agent writes the base language and Glotra fills in the rest. No tool can approve a translation, so a person signs off under Needs review in the dashboard.

Questions

Any library that reads a map of keys to strings, such as next-intl, i18next and react-intl. Glotra doesn't replace your library; it manages the strings your library loads.

No. The language is read from the filename, so en.json and web_en.json both land in the right place. Anything Glotra can't recognise is reported rather than silently dropped.

About 30, per key. Machine translation is optional in the dashboard and on by default when an agent adds a key over MCP. Either way, the text is flagged for human review.

It can. Flagged text is included in exports and over-the-air delivery, so a review backlog never breaks a build. Clear the Needs review list before you release if you want every string checked.

Other platforms: iOS, Android. Set up your agent with Claude Code, Cursor or VS Code, or see pricing.