Skip to main content

Tolgee for Svelte provides a 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 package:

npm i @tolgee/svelte

Then initialize Tolgee and wrap your code with TolgeeProvider

import { TolgeeProvider, Tolgee, DevTools, FormatSimple } from '@tolgee/svelte';

const tolgee = Tolgee()
language: 'en',
apiUrl: import.meta.env.VITE_TOLGEE_API_URL,
apiKey: import.meta.env.VITE_TOLGEE_API_KEY,

<TolgeeProvider tolgee={tolgee}>
<div slot="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