Przejdź do treści
Sonenta
← All documentation

Quickstart · Svelte

Use Sonenta in Svelte

The official @sonenta/svelte-i18n SDK loads your released translations live from the Sonenta CDN, resolved by the same shared engine as every other framework, so keys behave identically across React, Vue, Svelte and Next.js.

1 · Create a project & get your keys

Sign in, create a project, copy its UUID. Manage keys and translations from your AI editor over MCP, the CLI, or the dashboard.

Open the dashboard →

2 · Install the SDK

npm i @sonenta/svelte-i18n i18next svelte

3 · Initialize Sonenta

Wire the SDK with your project token, UUID and namespaces. Available languages come from the published CDN manifest, so there is no locales array. It fetches the released bundles and resolves them through the shared engine.

// src/lib/i18n.ts
import { createSonentaI18n } from "@sonenta/svelte-i18n";

export const i18n = createSonentaI18n({
  token: import.meta.env.VITE_SONENTA_TOKEN,
  projectUuid: "<your-project-uuid>",
  defaultLocale: "fr",
  namespaces: ["common"],
});

4 · Translate in your components

Use the framework-native binding: your usual translation call, backed by Sonenta:

<script>
  import { i18n } from "$lib/i18n";
  const { t, ready } = i18n; // Svelte stores, $-prefixed
</script>

{#if $ready}<h1>{$t("home.title")}</h1>{/if}

Manage keys and translations from your editor: ask your agent over the Sonenta MCP, or use the CLI. No manual key entry.

Add-ons

Same SDK family, framework-native: @sonenta/realtime/svelte, @sonenta/in-context/svelte, @sonenta/feedback/svelte.