Documentation Index

December 2, 2025 ยท View on GitHub

Complete documentation for the sveltekit-i18n ecosystem. Whether you're just getting started or need detailed API references, you'll find everything here.

๐Ÿš€ Getting Started

New to sveltekit-i18n? Start here:

Getting Started Guide

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


๐Ÿ“š Core Documentation

Architecture Overview

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

API Documentation

Complete reference for sveltekit-i18n

Includes:

  • All configuration options with examples
  • Parser options (modifierDefaults, customModifiers)
  • Instance properties and methods (t,t, locale, etc.)
  • Message format syntax
  • TypeScript usage

Perfect for: Day-to-day development, looking up specific APIs

@sveltekit-i18n/base API Documentation

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


โœจ Best Practices

Best Practices Guide

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


๐Ÿ”ง Troubleshooting

Troubleshooting & FAQ

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


๐ŸŽจ Parser Documentation

Parsers Overview

Available parsers and creating custom ones

Learn about:

  • Choosing between parsers
  • Parser comparison
  • Creating custom parsers
  • Parser integration with base

@sveltekit-i18n/parser-default

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

@sveltekit-i18n/parser-icu

ICU message format parser

Features:

  • Industry-standard ICU syntax
  • Advanced pluralization
  • Select format (gender, etc.)
  • Number/date/time formatting
  • Comprehensive Intl support

๐Ÿ’ก Examples

All Examples

Working code you can learn from

Browse examples by use case:

Basic Examples

Routing Examples

Advanced Examples

Parser Examples

Configuration Examples

  • Loaders โ€“ Different loader configurations
  • Preprocess โ€“ Preprocessing strategies

Each example includes:

  • Complete working code
  • Live demo on Netlify
  • README with explanations

๐Ÿ“ฆ Package Documentation

Main Library

Core Package

Parsers


I want to...

Learn the basics

โ†’ Getting Started Guide

Understand how it works

โ†’ Architecture Overview

Look up an API

โ†’ API Documentation or Base API Documentation

Build a production app

โ†’ Best Practices Guide

Fix an issue

โ†’ Troubleshooting Guide

See working code

โ†’ Examples

Use a different parser

โ†’ Parsers Overview

Create locale-based URLs

โ†’ Locale Router Example or Best Practices: Dynamic Routes

Optimize performance

โ†’ Best Practices: Performance or Architecture: Performance

Add TypeScript

โ†’ Best Practices: TypeScript or API Docs: TypeScript

Load from API/database

โ†’ Best Practices: Content Management or Base API: Loaders

Test my translations

โ†’ Best Practices: Testing

Deploy to production

โ†’ Best Practices: Production


๐Ÿ“– Reading Order

For Beginners

  1. Getting Started Guide โ€“ Learn by building
  2. Examples โ€“ See more use cases
  3. Best Practices โ€“ Level up your implementation

For Advanced Users

  1. Architecture Overview โ€“ Understand the system
  2. Base API Documentation โ€“ Deep dive into APIs
  3. Parsers โ€“ Custom message formats

For Troubleshooting

  1. Troubleshooting Guide โ€“ Find your issue
  2. FAQ โ€“ Common questions
  3. GitHub Issues โ€“ Get help

๐Ÿค Contributing

Interested in contributing to sveltekit-i18n?

Note: We're currently looking for maintainers. If you're interested in helping maintain this project, please see this issue.


๐Ÿ“„ 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.