Documentation Index
Complete documentation for the sveltekit-i18n ecosystem, covering v3: one
reactive instance built on Svelte 5 runes, no stores, and the parser wired in β
npm install sveltekit-i18n is the whole install.
Upgrading from v2? Go straight to Upgrading from v2 and the migration table.
π Getting Started
New to sveltekit-i18n? Start here:
Getting Started Guide
A SvelteKit app from nothing to multilingual, in eight steps
- Requirements and installation β Svelte 5, Node 22 / Bun 1.2 / Deno 2, ESM-only
- Basic concepts β locales, keys, loaders, namespaces, the instance
- Your first multilingual app β translation files, exporting the config, resolving the visitor's locale, one instance per request, the snapshot, Svelte context, components
- Route-based loading and switching locales
- Placeholders and modifiers,
including
parserOptions - TypeScript and testing components
Perfect for: first-time users, quick setup
π Core Documentation
Architecture Overview
Understanding how everything works
- Package overview and relationships β core, parser, this package; composition rather than inheritance, and the parser extension
- The reactive engine β runes, and why the core ships its rune modules uncompiled
- Data flow β construction, loading, translation, locale switch
- Loading strategy β route matching, load-once, deduplication, cache and invalidation
- Instance lifetime β per-request
instances,
snapshot(),destroy() - Core concepts, when to use each package, performance
Perfect for: understanding internals, making architecture decisions
API Documentation
Complete reference for sveltekit-i18n
- Installation and packaging β ESM-only, one install, bundler requirements
- Configuration β
loaders,translations,initLocale,fallbackLocale,fallbackValue,preprocess,sanitizeLocales,cache,log,schema,extensions - Parser options β
modifierDefaults,customModifiers,onReport - The instance β reactive properties, reactive functions, promise-returning methods, synchronous methods
- Message format, exported types, utilities
- TypeScript, extensions, SSR, testing
- Migrating from v2
Perfect for: day-to-day development, looking up specific APIs
@sveltekit-i18n/base API Documentation
The canonical reference for every member this package inherits
- Configuration and loaders
- Instance properties and methods
- Server-side rendering
- The parser contract β for building on the core with a different parser
- TypeScript
Perfect for: member-level detail, or using the core with a custom parser
β¨ Best Practices
Best Practices Guide
Recommended patterns for production apps
- Instance ownership β per-request
instances, the module-level singleton hazard,
destroy(), why value properties must not be destructured - Awaiting loads β await the matching
load instead of polling
loading - SSR and CSR β snapshot, hydration, no flash of untranslated content
- Organization and key naming
- Performance β lazy loading,
preloading,
cacheandinvalidate() - TypeScript β
schema, one payload type, locale completion, custom modifier props - Extensions β the pipe, and getting the
$tsurface back - Component-scoped β isolated translation contexts
- Library authors β shipping translations with a package
- Dynamic routes β locale-based routing patterns
- Content management β CMS, API and database sources
- Testing β a real instance instead of a mock
- Production β logging, parser reports, loader failures, monitoring
Perfect for: building production applications, scaling your i18n implementation
π§ Troubleshooting
Troubleshooting & FAQ
Solutions to common problems
- Upgrading from v2 β
$tis not a store, destructured values that never update, the removal of.get()/.set()/.subscribe()/toPromise()/getTranslationProps(), andinstanceof - Setup and packaging β
$state is not defined, two copies of the core,ERR_REQUIRE_ESM - Common issues β translations not loading, keys instead of values, flashing content, route matching, locale not changing, stale translations, one visitor's locale in another's page, silent parser reports, TypeScript errors, tests, performance
- Debugging tips β inspect translations, enable debug logging, open the report channel, test a loader
- FAQ β 17 common questions
- Known limitations β what to be aware of
Perfect for: fixing issues, understanding limitations
π¨ Parser Documentation
Message interpolation lives in a parser. This package wires one; the core takes any parser that satisfies base's parser contract.
@sveltekit-i18n/parser-curly
The parser wired into this package
- Placeholders
{{name}}, default values, nested placeholders, escaping - Modifiers (
number,date,currency,ago, β¦) and comparisons - Custom modifiers, modifier defaults and the report channel β all reachable
here through
parserOptions - Implements the Curly Message Format
@sveltekit-i18n/parser-icu
ICU message format
For an application that wants ICU syntax, built on
@sveltekit-i18n/base directly β this
package fills the parser slot itself and cannot take another parser.
Parsers Overview
The parser monorepo, and writing your own
π‘ Examples
All Examples
Working code you can learn from
Eight standalone applications on v3: locale routing (URL parameter, path
prefix, static adapter, default locale unprefixed), per-request negotiation
from a cookie and Accept-Language, component-scoped translations rendered on
the client and seeded through snapshot(), and t() inside Markdown routes.
π¦ Package Documentation
This Package
- sveltekit-i18n README β overview and quick start
- Contributing guide β repository layout, workflow, tests
- Releases β version history
The Family
- @sveltekit-i18n/base β the core; state, loading, caching, route matching, preprocessing (releases)
- @sveltekit-i18n/parser-curly and @sveltekit-i18n/parser-icu (releases)
- Extensions β official
adapters for the
config.extensionspipe, including @sveltekit-i18n/extension-stores (the$t/$locale/$loadingsurface) - Curly Message Format β the message format specification
base, parsers and extensions release aligned at 3.0.0; sveltekit-i18n
last.
π― Quick Links by Task
I want to...
Learn the basics
Upgrade an app from v2
β Upgrading from v2 and the migration table
Get $t back
β Best Practices: Extensions
Understand how it works
Look up an API
β API Documentation or base API Documentation
Render on the server without leaking a visitor's locale
β API Docs: SSR or Best Practices: Instance Ownership
Build a production app
Fix an issue
See working code
β Examples
Write a custom modifier or open the report channel
β API Docs: Parser options or parser-curly
Use a different message format
β Architecture: When to Use Each Package
Create locale-based URLs
β Best Practices: Dynamic Routes
Optimize performance
β Best Practices: Performance or Architecture: Performance
Type my keys and payloads
β Best Practices: TypeScript or API Docs: TypeScript
Load from an API or database
β Best Practices: Content Management or base API: Loaders
Test components that translate
β Best Practices: Testing or Getting Started: Testing
Deploy to production
β Best Practices: Production
π Reading Order
For Beginners
- Getting Started Guide β learn by building
- API Documentation β the surface, member by member
- Best Practices β level up your implementation
For Upgraders
- Upgrading from v2 β the first-day errors
- Migrating from v2 β the old member, the new one
- Best Practices: Instance Ownership β what per-request instances change
For Advanced Users
- Architecture Overview β understand the system
- base API Documentation β deep dive
- Parsers and Extensions β custom message formats and custom surfaces
For Troubleshooting
- Troubleshooting Guide β find your issue
- FAQ β common questions
- GitHub Issues β get help
π€ Contributing
Interested in contributing to sveltekit-i18n?
- Contributing Guide β setup, workflow, tests, PRs
- GitHub Repository β main library, and the shared issue tracker for the whole family
- Issues β report bugs, request features
- Discussions β ask questions, share ideas
π License
MIT License β See individual repositories for details.
Can't find what you're looking for? Check the Troubleshooting Guide for how to get help.