Skip to main content

Tolgee for Svelte provides simple API to create multi-lingual Svelte application. With Tolgee i18n library for Svelte you can enjoy all Tolgee i18n features.

To see Svelte with Tolgee in action, check this example app.

npm i @tolgee/svelte

Get started!

1. Create project in Tolgee platform

Go to Tolgee Cloud app or access your self-hosted instance and create a project. Then obtain your API key.

2. Setup Tolgee integration

Install the npm packages.

npm i @tolgee/svelte

Then wrap your code with TolgeeProvider

import { TolgeeProvider } from "@tolgee/svelte";

const tolgeeConfig = {
preloadFallback: true,
apiUrl: '',
apiKey: '<your API key>',

<TolgeeProvider config={tolgeeConfig}>
<div slot="loading-fallback">Loading...</div>
<slot />

3. Use T component to translate your texts

import { T } from "@tolgee/svelte";
<T keyName="translate_me" defaultValue="Translate me!" />

Now you are able to Alt + Click & translate your texts!

More integrations

Show all