Implements i18n with Paraglide JS, a compiler-based library that turns translation files into tree-shakable JS functions. Covers setup, message compilation, locale detection, URL-based routing, SSR/SSG middleware, pluralization, and framework integration.
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Compiler-based i18n library. Compiles translation files (JSON/inlang) into tree-shakable JS functions. Each message becomes a function — only used messages are bundled.
messages/ ← Translation source files (JSON)
en.json
de.json
project.inlang/
settings.json ← Inlang project config (locales, plugins, sourceLanguageTag)
src/paraglide/ ← Compiler output (generated, gitignored)
messages.js ← Compiled message functions
runtime.js ← getLocale(), setLocale(), locales, sourceLocale
server.js ← paraglideMiddleware() for SSR
Compiler runs via bundler plugin (Vite/Webpack/Rollup) or CLI. Output is always ./src/paraglide/.
import * as m from "./paraglide/messages.js";
// Simple message — no params
m.hello_world(); // "Hello World"
// Parameterized message
m.greeting({ name: "Alice" }); // "Hello, Alice!"
Messages are defined in JSON translation files:
// messages/en.json
{
"hello_world": "Hello World",
"greeting": "Hello, {name}!"
}
import { getLocale, setLocale, locales, sourceLocale } from "./paraglide/runtime.js";
getLocale(); // Current locale, e.g. "en"
setLocale("de"); // Change locale (triggers re-render in frameworks)
locales; // ["en", "de", "fr"] — all configured locales
sourceLocale; // "en" — the source language
Message functions automatically use getLocale(). Override per-call:
m.greeting({ name: "Alice" }, { locale: "de" }); // Force German
getLocale (Critical for SSR)getLocale and setLocale must be overridden in the inlang project settings for any real app. The default is a simple global variable — not suitable for SSR (concurrent requests share state).
// project.inlang/settings.json
{
"baseLocale": "en",
"locales": ["en", "de", "fr"],
"plugin": "https://cdn.jsdelivr.net/npm/@inlang/paraglide-js@2/dist/plugin.js",
"$imports": {
"default": "https://cdn.jsdelivr.net/npm/@anthropic-ai/sdk@latest/dist/index.js"
}
}
Override via compilerOptions.emitGitIgnore, compilerOptions.outputStructure, etc. in settings.
For SSR, use paraglideMiddleware() which handles request-scoped locale via AsyncLocalStorage. See references/rendering.md.
Strategy is an ordered fallback chain that determines the locale. Configure via compiler options.
import { defineCompilerOptions } from "@inlang/paraglide-js";
export default defineCompilerOptions({
strategy: ["url", "cookie", "preferredLanguage", "baseLocale"],
urlPatterns: [{ pattern: "/:locale(en|de|fr)/:path*" }],
cookieName: "NEXT_LOCALE",
});
Common strategies: url, cookie, preferredLanguage, globalVariable, localStorage, baseLocale.
For full strategy configuration, URL patterns, custom strategies, and middleware setup, see references/routing-and-strategy.md.
// vite.config.ts
import { paraglideVitePlugin } from "@inlang/paraglide-js";
export default defineConfig({
plugins: [paraglideVitePlugin()],
});
Also available: paraglideWebpackPlugin(), paraglideRollupPlugin(), paraglideRolldownPlugin().
For full setup, CLI compilation, and TypeScript config, see references/setup.md.
import { paraglideMiddleware } from "./paraglide/server.js";
app.use((req, res, next) => {
paraglideMiddleware(req, ({ request, locale }) => {
// locale is detected, getLocale() works in this scope
return next();
});
});
For SSR, SSG, page discovery, and hreflang, see references/rendering.md.
Read these as needed based on the task:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
34 skills in this plugin
/ai-sdkAnswer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat"./baseline-uiQuickly deslop UI code by fixing spacing, hierarchy, typography, and small layout issues. Use when the interface needs a fast cleanup or polish pass./Other plugins' skills for the same job
/frontend:paraglide-jsfrom frontend
npx claudepluginhub fellipeutaka/leon --plugin frontend