solid-translate weekly downloads statistics
By omniaura (4 listings) · npm · Vite plugins
AI-powered build-time translations for SolidJS. Full i18n with <T>, <Var>, <Num>, <Currency>, <Plural>, <DateTime>, locale detection, and a CLI — all BYOK.
solid-translate has 567 recorded weekly downloads on npm, ranking #1568 of 2,391 tracked listings.
About solid-translate
solid-translate
AI-powered i18n for SolidJS — full feature parity with General Translation, but open-source and BYOK (bring your own API key).
Write your app in one language. Wrap text in <T>. Get translations generated automatically at build time. No JSON key management. No external service required.
Features
<T>Component — wrap any text for translation. Source text = key (no JSON wrangling)<Var>— protect dynamic content from translation<Num>— locale-aware number formatting viaIntl.NumberFormat<Currency>— locale-aware currency formatting<DateTime>— locale-aware date/time formatting<Plural>— CLDR plural rules (zero/one/two/few/many/other)<LocaleSelector>— drop-in locale picker component- AI Context —
contextprop for disambiguation ("Save" = save file vs. save money) - Auto Locale Detection — detects from
navigator.languageswhenlocaleprop is omitted msg()— mark strings for extraction outside of JSX- CLI Tool — translate JSON, Markdown, and MDX files from the command line
checkCommand — CI freshness gate, no AI calls (exit 1 when translations are stale)- Vite Plugin — build-time translation with smart change detection
- Lazy Locale Chunks —
virtual:solid-translate/lazycode-splits each locale, loads on demand without suspending - Locale Persistence — opt-in
persistLocaleremembers the user's choice inlocalStorage - GitHub Action —
omniaura/solid-translate@v1for CI/CD translation automation - BYOK — use any Vercel AI SDK provider (OpenRouter, OpenAI, Anthropic, Google, etc.)
Install
bun add solid-translate
bun add -d ai @ai-sdk/openai # or any AI SDK provider
Quick Start
1. Configure the Vite plugin
// vite.config.ts
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import { solidTranslate } from "solid-translate/vite";
import { createOpenAI } from "@ai-sdk/openai";
const openrouter = createOpenAI({
baseURL: "https://openrouter.ai/api/v1",
apiKey: process.env.OPENROUTER_API_KEY,
});
export default defineConfig({
plugins: [
solidPlugin(),
solidTranslate({
sourceLocale: "en",
targetLocales: ["es", "fr", "de", "ja"],
localesDir: "./src/locales",
model: openrouter("openai/gpt-4o-mini"),
autoExtract: true, // auto-discover <T> and msg() strings
}),
],
});
2. Write your app
import { TranslationProvider, T, Var, Num, Plural, useTranslation, LocaleSelector } from "solid-translate";
import translations from "virtual:solid-translate";
function App() {
return (
<TranslationProvider
sourceLocale="en"
translations={translations}
// locale="es" ← optional! auto-detects from browser if omitted
>
<Page />
</TranslationProvider>
);
}
function Page() {
const { t } = useTranslation();
const [count, setCount] = createSignal(3);
const userName = () => "Alice";
return (
<div>
<h1><T>Welcome to our app!</T></h1>
{/* Dynamic content protected with <Var> */}
<p><T>Hello <Var>{userName()}</Var>, nice to see you!</T></p>
{/* AI context for disambiguation */}
<button><T context="save a document to disk">Save</T></button>
{/* Explicit key */}
<a><T id="nav.home">Home</T></a>
{/* Interpolation */}
<p>{t("items.count", { count: count() })}</p>
{/* Pluralization */}
<Plural n={count()}
zero="No items in your cart"
one="1 item in your cart"
other={`${count()} items in your cart`}
/>
{/* Locale-aware number */}
<p>Total: <Num>{1234567.89}</Num></p>
{/* Locale switcher */}
<LocaleSelector labels={{ en: "English", es: "Español", fr: "Français" }} />
</div>
);
}
3. Build
bun run build
On the first build, the plugin generates translation files:
src/locales/
├── en.json # Source (auto-generated or manual)
├── es.json # AI-generated
├── fr.json # AI-generated
├── de.json # AI-generated
├── ja.json # AI-generated
└── .solid-translate.lock # Change tracking
On subsequent builds, only changed/new keys are re-translated. Check everything into git.
API Reference
Components
<T> — Translatable Text
// Source text as key (no JSON file entry needed)
<T>Hello world</T>
// Explicit key
<T id="greeting">Hello world</T>
// With interpolation
<T params={{ name: userName() }}>Hello {{name}}</T>
// AI context for disambiguation
<T context="financial institution, not river bank">Bank</T>
// Mixed JSX with Var
<T>Welcome <Var>{userName()}</Var>, you have <Num>{count()}</Num> items</T>
<Var> — Variable Protection
Marks dynamic content that should NOT be translated. When used inside <T>, the surrounding text is translated but <Var> content is preserved.
<T>Hello <Var>{userName()}</Var></T>
// Spanish: "Hola {userName()}"
<Num> — Number Formatting
Locale-aware number formatting using Intl.NumberFormat.
<Num>{1000000}</Num> // "1,000,000" (en) / "1.000.000" (de)
<Num options={{ style: "percent" }}>{0.42}</Num> // "42%"
<Num options={{ notation: "compact" }}>{1500}</Num> // "1.5K"
<Currency> — Currency Formatting
<Currency currency="USD">{29.99}</Currency> // "$29.99" (en-US) / "29,99 $US" (fr)
<Currency currency="EUR">{1000}</Currency> // "€1,000.00" (en) / "1.000,00 €" (de)
<DateTime> — Date/Time Formatting
<DateTime>{new Date()}</DateTime>
<DateTime options={{ dateStyle: "long" }}>{new Date()}</DateTime>
<DateTime options={{ hour: "numeric", minute: "numeric" }}>{Date.now()}</DateTime>
<Plural> — Pluralization (CLDR)…
Description from the npm listing.
- solid
- solidjs
- i18n
- translate
- translation
- internationalization
- localization
- ai
- vite
- vite-plugin
- build-time
- openrouter
- vercel-ai-sdk
- general-translation
- gt-react
- pluralization
- intl
- locale
- currency
- datetime
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm Vite plugins plugins
All 20 solid-translate alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/solid-translate. First seen Oct 21, 2026; last successful collection Oct 21, 2026. See the methodology.