product icon

Paraglide JS

App

Paraglide JS Vite setup

Paraglide JS provides a plugin for Vite.

If you use Vite in your project, Paraglide JS is almost certainly the best i18n library you can adopt. Check out the comparison page:

  • Simple one plugin setup.
  • Automatic re-compilation with HMR.
  • Supports any framework (React, Vue, Svelte, Solid JS, Preact, Lit).
  • Supports any Vite-based metaframework (React Router, TanStack Start, SvelteKit, Nuxt, ...).

Getting started

npx @inlang/paraglide-js@latest init

Add the vite plugin to your vite.config.ts:

import { defineConfig } from "vite";
+import { paraglideVitePlugin } from "@inlang/paraglide-js";

export default defineConfig({
  plugins: [
+    paraglideVitePlugin({
+      project: "./project.inlang",
+      outdir: "./src/paraglide",
+    }),
  ],
});

Usage

See the basics documentation for more information on how to use Paraglide's messages, parameters, and locale management.

I18n routing

Check out Paraglide JS on the server for i18n routing.

Example

A full example can be found here.