Skip to content

Vite i18n · React and Solid

Vite i18n for React and Solid, in one plugin.

Add Palamedes beside your renderer plugin and keep translation authoring inside TypeScript. The Vite adapter transforms macros, compiles imported PO catalogs, and reports catalog problems during development and production builds.

Integration
@palamedes/vite-plugin

One transform and catalog loader for Vite projects.

Renderer packages
React + Solid

Choose the runtime module that matches the UI.

Version range
Vite 3–8

The current matrix itself runs on Vite 8.

Catalog workflow
PO + FCL

PO imports today; PO or FCL for CLI catalog storage.

npm package@palamedes/vite-pluginv1.17.32.4K downloads / month

01 — The framework problem

Vite supplies a fast module pipeline, not an internationalization architecture.

A useful Vite i18n setup still needs an authoring model, extraction, catalogs, ICU validation, renderer integration, and an active runtime. Adding unrelated plugins for each step creates boundaries that fail at different times.

02 — The Palamedes model

Use Vite as the host for a complete local i18n workflow.

The plugin is only the build boundary. Palamedes connects it to the same native transform, catalog engine, runtime contract, and CLI used by the framework adapters.

Transform before the renderer

Place palamedes() before the React plugin, or add it to SolidStart's Vite configuration with the Solid runtime module.

Choose a renderer, not a new model

@palamedes/react and @palamedes/solid expose renderer-specific macros and client helpers over the same catalog semantics.

Keep extraction out of the browser build

The native pmds CLI extracts and updates catalogs explicitly, while Vite focuses on turning application modules into runnable code.

03 — In TypeScript

The only difference between React and Solid is the renderer boundary.

vite.config.ts

// React
import react from "@vitejs/plugin-react"
import { palamedes } from "@palamedes/vite-plugin"
import { defineConfig } from "vite"

export default defineConfig({
  plugins: [
    palamedes(),
    react(),
  ],
})

// Solid
import solid from "vite-plugin-solid"

export default defineConfig({
  plugins: [
    palamedes({ framework: "solid" }),
    solid(),
  ],
})

Both paths use TypeScript macros, the same palamedes.yaml format, and the same extraction CLI. The renderer package supplies rich-message and client-locale primitives where the UI models differ.

04 — Locale strategy

Choose the URL model that fits your Vite product.

Vite does not prescribe routing or server request APIs. Cookie, route, subdomain, and top-level-domain locale policies remain application concerns; Palamedes keeps the translation pipeline stable underneath whichever policy your React or Solid host implements.

Cookie

One URL for all locales. Best for apps behind login where SEO is irrelevant and switching should be instant.

Route segment

/de/checkout-style paths. The SEO-friendly default for public content with indexable localized pages.

Subdomain

de.example.com. Clean separation per market, works well with regional CDNs and analytics splits.

Top-level domain

example.de vs example.com. Maximum market trust; Palamedes maps each domain to its locale.

Compare the four locale strategies →

05 — Proof and boundaries

The plugin is exercised through several full-stack hosts, not just a fixture.

TanStack Start, SolidStart, Waku, and React Router use @palamedes/vite-plugin throughout the browser-verified framework matrix. Package tests cover the transform and loader boundary directly.

React hosts
3 families

TanStack Start, Waku, and React Router.

Solid hosts
1 family

SolidStart uses the Solid runtime integration.

Build behavior
Dev + build

The same plugin handles transforms and PO imports.

Diagnostics
Native

Macro, placeholder, and ICU problems surface early.

06 — Questions

Vite i18n questions, answered

The short version of the decisions that usually block an implementation.

Does Vite have built-in internationalization?
No. Vite supplies a development server, module transforms, and production builds. Palamedes adds message authoring, catalog loading, extraction, validation, runtime access, and renderer integrations on top of that pipeline.
Should the Palamedes plugin run before the React or Solid plugin?
Yes. Put palamedes() before the renderer plugin so message macros are transformed while their original TypeScript and JSX structure is still available.
Does Palamedes type-check my Vite application?
No. Like Vite itself, the plugin transforms source modules rather than running whole-program type checking. Keep tsc --noEmit or your existing type-check command in development and CI.
Can I use Palamedes with Vue or Svelte?
Not as a supported end-to-end UI integration today. The build plugin is Vite-based, but public authoring and client runtime packages currently target React and Solid.

07 — Keep exploring

See how the same model meets a different host.

Add one Vite plugin, then keep the whole translation workflow coherent.