Complete documentation for the sveltekit-i18n ecosystem. Whether you're just getting started or need detailed API references, you'll find everything here.
New to sveltekit-i18n? Start here:
Time to complete: 15 minutes
Step-by-step tutorial that walks you through:
- Installing the library
- Creating your first translations
- Loading translations in your app
- Using translations in components
- Switching between languages
Perfect for: First-time users, quick setup
Understanding how everything works
Learn about:
- Package relationships (base, lib, parsers)
- Data flow (configuration β loading β translation)
- Loading strategies (route-based, SSR/CSR)
- When to use each package
- Performance considerations
Perfect for: Understanding internals, making architecture decisions
Complete reference for sveltekit-i18n
Includes:
- All configuration options with examples
- Parser options (modifierDefaults, customModifiers)
- Instance properties and methods ($t, $locale, etc.)
- Message format syntax
- TypeScript usage
Perfect for: Day-to-day development, looking up specific APIs
API reference for base package
Detailed documentation for:
- Core configuration options
- Loaders (local files, APIs, databases)
- Preprocessing strategies
- All stores and methods
- Advanced use cases
Perfect for: Using base package with custom parsers
Recommended patterns for production apps
Covers:
- Organization β File structure, naming conventions
- Performance β Lazy loading, caching, bundle optimization
- TypeScript β Typed configuration, custom type-safe patterns
- SSR/CSR β Server-side rendering considerations
- Component-scoped β Isolated translation contexts
- Dynamic routes β Locale-based routing patterns
- Content management β CMS and database integration
- Testing β Mocking translations, test strategies
- Production β Deployment, monitoring, error handling
Perfect for: Building production applications, scaling your i18n implementation
Solutions to common problems
Includes:
- Common Issues with step-by-step solutions:
- Translations not loading
- Keys displayed instead of values
- Flashing content (FOUC)
- Route-based loading problems
- Locale not changing
- TypeScript errors
- SSR errors
- Performance issues
- Debugging tips β Inspect stores, test loaders, enable logging
- FAQ β 15+ frequently asked questions
- Known limitations β What to be aware of
Perfect for: Fixing issues, understanding limitations
Available parsers and creating custom ones
Learn about:
- Choosing between parsers
- Parser comparison
- Creating custom parsers
- Parser integration with base
Default parser with placeholders and modifiers
Features:
- Simple placeholder syntax:
{{name}} - Built-in modifiers: number, date, currency, ago
- Conditionals:
{{count; 1:item; default:items;}} - Comparison operators: eq, ne, lt, gt, lte, gte
- Custom modifiers
- No external dependencies
ICU message format parser
Features:
- Industry-standard ICU syntax
- Advanced pluralization
- Select format (gender, etc.)
- Number/date/time formatting
- Comprehensive Intl support
Working code you can learn from
Browse examples by use case:
- Single Load β Load all translations at once
- One Page β Simple one-page app
- Multi Page β Multiple routes (most common)
- Locale Parameter β URL parameter (
?lang=en) - Locale Router β Path-based (
/en/about) - Locale Router Advanced β Default locale without prefix
- Locale Router Static β Static adapter optimized
- Component Scoped CSR β Client-side component translations
- Component Scoped SSR β Server-side component translations
- Fallback Locale β Handling missing translations
- Parser Default β Default parser features
- Parser ICU β ICU message format
- Loaders β Different loader configurations
- Preprocess β Preprocessing strategies
Each example includes:
- Complete working code
- Live demo on Netlify
- README with explanations
- sveltekit-i18n β Main library README
- Changelog β Version history
- @sveltekit-i18n/base β Base package README
- Base Changelog β Version history
- Parsers β Parsers overview
- parser-default β Default parser
- parser-icu β ICU parser
- Parser Changelogs β Version history
β API Documentation or Base API Documentation
β Examples
β Parsers Overview
β Locale Router Example or Best Practices: Dynamic Routes
β Best Practices: Performance or Architecture: Performance
β Best Practices: TypeScript or API Docs: TypeScript
β Best Practices: Content Management or Base API: Loaders
β Best Practices: Production
- Getting Started Guide β Learn by building
- Examples β See more use cases
- Best Practices β Level up your implementation
- Architecture Overview β Understand the system
- Base API Documentation β Deep dive into APIs
- Parsers β Custom message formats
- Troubleshooting Guide β Find your issue
- FAQ β Common questions
- GitHub Issues β Get help
Interested in contributing to sveltekit-i18n?
- GitHub Repository β Main library
- Issues β Report bugs, request features
- Discussions β Ask questions, share ideas
Note: We're currently looking for maintainers. If you're interested in helping maintain this project, please see this issue.
MIT License β See individual repositories for details.
Can't find what you're looking for? Check the Troubleshooting Guide for how to get help.