Introduction & Features
Relevant source files
The following files were used as context for generating this wiki page:
Nuxt I18n Micro provides a performance-focused internationalization (i18n) solution specifically for Nuxt 3. It prioritizes small bundle sizes, fast build times, and low runtime overhead, making it suitable for large-scale projects and high-traffic environments where traditional modules like @nuxtjs/i18n may cause bottlenecks.
The system operates as a monorepo containing a core Nuxt module and various framework-agnostic packages. It focuses on minimizing memory consumption during build and runtime while providing essential features such as strategy-based routing, SEO meta tag generation, and streamlined translation loading.
Sources: README.md:9-16, AGENTS.md:8-15
Core Architecture & Packages
The project follows a modular architecture where the Nuxt module serves as the primary entry point, supported by shared libraries for logic and framework-specific adapters.
System Package Structure
The diagram above illustrates the internal dependencies within the nuxt-i18n-micro ecosystem. Shared logic is encapsulated in core, types, and utils, while routing behavior is split between build-time strategies and runtime path resolution.
Sources: AGENTS.md:12-23
Key Features
The module implements several critical features to support internationalization without compromising performance:
| Feature | Description |
|---|---|
| Strategy-Based Routing | Handles locale prefixes via build-time (route-strategy) and runtime (path-strategy) logic. Supported strategies include prefix, no_prefix, prefix_except_default, and prefix_and_default. |
| Optimized Payloads | Splits translations between global files and page-specific files to reduce initial load sizes. |
| SEO Integration | Automatically generates meta tags for localized pages, including hreflang and og:locale alternates. |
| Automatic Detection | Detects user locale based on browser settings or cookies and performs necessary redirects. |
| Framework Adapters | Extends support beyond Nuxt to Astro, SolidJS, Preact, and standard Node.js environments. |
| Developer Tooling | Includes Hot Module Replacement (HMR) support and a dedicated DevTools UI for translation management. |
Sources: README.md:85-95, packages/route-strategy/CHANGELOG.md:130-140, packages/astro/CHANGELOG.md:10-20
Performance Comparison
Nuxt I18n Micro is benchmarked against standard Nuxt (baseline) and @nuxtjs/i18n to ensure resource efficiency.
Resource Consumption (Mean of 3 runs)
| Project | Build Time | Code Bundle | Max Memory | RPS (Artillery) |
|---|---|---|---|---|
| plain-nuxt | 5.07s | 1.22 MB | 859 MB | 102 |
| i18n-micro | 5.01s | 1.44 MB | 997 MB | 230 |
| @nuxtjs/i18n v10.6 | 8.23s | 1.9 MB | 1,292 MB | 126 |
Sources: README.md:47-60, scripts/src/perf/report.ts:130-145
Module Options & Configuration
Configuration is grouped into logical sections to manage locales, translations, and runtime behavior.
Configuration Groups
This structure organizes how the Nuxt module processes user-defined settings in nuxt.config.ts.
Sources: scripts/src/commands/docs-generate.ts:24-65
Development & Build Workflow
The repository requires a specific build order to ensure that shared packages are available to the Nuxt runtime and playgrounds.
- Install Dependencies: Use
pnpm install(version 9.14.2 required). - Build Core Packages: Build all packages in the
packages/directory except playgrounds. - Prepare Dev Environment: Run
pnpm run dev:prepareto generate.nuxt/tsconfig.jsonand load module stubs. - Build Playgrounds: Build package-specific playgrounds to generate virtual configuration declarations.
Sources: AGENTS.md:32-45
Conclusion
Nuxt I18n Micro serves as a high-performance alternative to standard Nuxt i18n modules. By decoupling routing strategies from core translation logic and providing optimized adapters for multiple frameworks, it enables developers to build localized applications with minimal impact on build speeds or server resources. Its integration with standard tools like Vitest and Playwright ensures reliability across its various framework bindings.
Sources: README.md:10-25, AGENTS.md:20-30