Gå til innholdet
Sonenta
← All capabilities

Tutorials · for developers

Translate your app with Sonenta

A scenario-based walkthrough. Every tutorial has two parts: Integration & init (get Sonenta wired into your repo) and a work sequence (the AI prompts and reviews that get the job done). The commands and prompts are exact, copy them straight in.

Fra agenten din til flatene dine
Agenten din MCP Sonenta HUB Språk CDN Tilgjengelighet Flater

v1 covers Translation. More scenarios (accessibility, evaluation, delivery) land after this format is validated.

Translation

Wire Sonenta into your repo, then run the generate, review, publish loop with your local AI.

Part A

Integration & init

  1. Install the CLI

    shell
    npm install -g @sonenta/cli      # provides the `sonenta` command
  2. Authenticate

    Create an API key in the dashboard (Settings → API keys) with the mcp:* scope so the local-AI agents can act.

    shell
    sonenta login --token vrb_live_<prefix>.<secret>
    # --host defaults to https://api.sonenta.dev
  3. Initialize the project

    Run in your repo root. This scaffolds sonenta.config.json, a managed block in CLAUDE.md / AGENTS.md so your local AI knows the project, and auto-wires the MCP server into .mcp.json (secret-free, the server reads credentials from your sonenta login).

    shell
    sonenta init --project <PROJECT_UUID>
    sonenta.config.json
    {
      "host": "https://api.sonenta.dev",
      "project_uuid": "<PROJECT_UUID>",
      "version_slug": "main"
    }
    .mcp.json
    {
      "mcpServers": {
        "sonenta": {
          "command": "npx",
          "args": ["-y", "@sonenta/mcp"],
          "env": {
            "SONENTA_BASE_URL": "https://api.sonenta.dev",
            "SONENTA_PROJECT": "<PROJECT_UUID>"
          }
        }
      }
    }
  4. Install the local-AI agent

    Writes .claude/agents/sonenta-i18n.md and ensures .mcp.json is wired. sonenta agents list shows all bundled agents, e.g. sonenta-a11y.

    shell
    sonenta agents add sonenta-i18n      # the translation agent
  5. Verify the setup

    shell
    sonenta doctor                       # checks MCP wired, reachable, scoped
  6. Add the runtime SDK

    Wrap your app once with the provider, then render strings with the t() hook as usual. Published translations arrive over the CDN with no code change.

    shell
    npm install @sonenta/react-i18next
    app entry
    import { SonentaProvider } from "@sonenta/react-i18next";
    
    <SonentaProvider
      apiBase="https://api.sonenta.dev"
      projectUuid="<PROJECT_UUID>"
      token="vrb_live_<prefix>.<secret>"   // a key with the missing:write scope
      defaultLocale="en"
      namespaces={["common"]}
    >
      <App />
    </SonentaProvider>
    any component
    const { t } = useTranslation();
    return <button>{t("checkout.pay")}</button>;
  7. Or set it all up in one prompt

    Hand the whole setup to your local AI:

    Prompt your AI
    Set up Sonenta in this repo: run sonenta login with my API key, then sonenta init --project <PROJECT_UUID> (wire the MCP server and write the CLAUDE.md block), install the sonenta-i18n agent, run sonenta doctor, and add the @sonenta/react-i18next SDK with a SonentaProvider around my app.
Part B

The translation workflow

A simple three-step loop: generate drafts, review, publish.

  1. 1. Generate translations (drafts)

    The agent runs locally (0 AI credits): coverage_reportlist_untranslated_keyspropose_translations_bulk, honoring your glossary and project context. The result is draft translations in Sonenta, nothing is live yet.

    Prompt your AI
    Using sonenta-i18n, translate my untranslated keys into French and Spanish, then submit them for my review.
  2. 2. Review in Sonenta

    Open the Translations editor in the dashboard (/translations). Approve or edit each draft. Only what you approve becomes publishable.

  3. 3. Publish to the CDN

    The agent calls publish_cdn. Published translations are served from the CDN and picked up automatically by your app through @sonenta/react-i18next, no code change, no redeploy.

    Prompt your AI
    Publish the approved translations to the CDN.

Publishing happens through the agent’s publish_cdn tool (or the prompt above). There is no separate sonenta publish command, the CLI’s push / pull sync local locale files, not the AI-driven flow above.