Solid i18n · TypeScript
Solid i18n that stays native to Solid.
Palamedes pairs a Vite build integration with dedicated Solid authoring and runtime packages. Solid-native components and hook-free lookups share one catalog model across request-local SSR and hydration.
Palamedes 2.0 is out. Read the release notes.
- UI integration
- @palamedes/solid
- Verified against
- Solid 2 RC.16
- Rendering
- SSR + client
- Locale models
- 4 examples
Solid macros, formatters, and locale primitives.
Start Mode, Vite Environment API, Nitro v3, and Vite 8.
Isomorphic routes with one locale per document.
Cookie, route, subdomain, and top-level domain.
@palamedes/solidv2.2.0977 downloads / month01 — The framework problem
Solid i18n has to cross the server boundary without importing a React mental model.
A Solid application should not need provider patterns designed for another renderer. Locale state must still agree across the server response, hydration, and a later document navigation.
02 — The Palamedes model
Share catalog semantics, not renderer internals.
The native core and Vite adapter stay common across hosts. @palamedes/solid owns rich-message rendering while the active locale remains framework-neutral document bootstrap state.
Solid-native authoring
Use t, plural, and the Solid Trans macro beside JSX. Rich messages compile for Solid instead of passing through a React adapter.
Hook-free document locale
Translations read one active instance through a plain getter. Locale controls navigate the document so Solid state and external caches restart together.
One catalog pipeline
The same extraction, ICU diagnostics, PO or FCL storage, audits, and semantic merging apply before the renderer sees a message.
03 — In TypeScript
Configure the transform once, then author messages as Solid code.
vite.config.ts + routes/[locale].tsx
// vite.config.ts
import { nitro } from "nitro/vite"
import { defineConfig } from "vite"
import solid from "@solidjs/vite-plugin"
import { fileRoutes } from "filesystem-routing/vite"
import { palamedes } from "@palamedes/vite-plugin"
export default defineConfig({
ssr: { noExternal: ["@palamedes/runtime", "@palamedes/vite-plugin"] },
plugins: [
palamedes({ framework: "solid" }),
solid({
extensions: [".jsx", ".tsx"],
serverFunctions: true,
ssr: true,
start: { middleware: "./src/middleware.ts" },
}),
fileRoutes(),
nitro(),
],
})
// routes/[locale].tsx
import { Trans } from "@palamedes/solid/macro"
export default function LocalePage() {
return <h1><Trans>Welcome to Palamedes</Trans></h1>
}The route example resolves request-local state for SSR. The adapter initializes the document locale and loads compiled browser fragments before translated modules run. Normal links navigate to a new document when the locale changes.
04 — Locale strategy
Choose the URL model that fits your Solid product.
Solid's file routes and request APIs decide where the locale lives. Each checked Palamedes example keeps the Solid authoring and runtime surface unchanged while swapping the detection and switching policy.
Cookie
One URL for all locales. Useful for signed-in apps; an explicit language choice is persisted and opens a new document in that locale.
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.
05 — Proof and boundaries
Solid behavior is verified, not inferred from the React adapter.
The Solid matrix uses @palamedes/solid directly. Browser checks exercise the rendered page, the locale switch, and localized server work for every URL strategy.
- Renderer
- Solid-native
- Initial response
- SSR checked
- Interaction
- Navigation checked
- Server behavior
- Handler checked
No React provider or React translation component.
The selected catalog renders before hydration.
A new document renders consistently in the selected locale.
Translated server output is exercised in CI.
06 — Questions
Solid i18n questions, answered
The short version of the decisions that usually block an implementation.
- Is Palamedes for Solid a React wrapper?
- No. @palamedes/solid provides Solid-specific macros, components, formatters, runtime wiring, and client locale helpers. Only the lower catalog and transformation model is shared.
- Does Solid i18n work during server-side rendering?
- Yes on the verified Solid 2 RC path. Server rendering uses request-local state and shared immutable catalog messages. The adapter loads compiled browser dependencies for the matching document locale before hydration.
- Can I use route-based locales such as /de/products?
- Yes. The route example derives the locale from a dynamic Solid segment. Cookie, subdomain, and top-level-domain examples use the same messages and Solid runtime with different resolution policies.
- Is the Solid 2 release candidate verified?
- Yes. The matrix pins Solid 2.0.0-rc.16 and exercises Start Mode plus Nitro v3 across all four locale strategies.
07 — Keep exploring