You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Nuxt I18n Micro is a fast, simple, and lightweight internationalization (i18n) module for Nuxt. Despite its compact size, it's designed with large projects in mind, offering significant performance improvements over traditional i18n solutions likenuxt-i18n. The module was built from the ground up to be highly efficient, focusing on minimizing build times, reducing server load, and shrinking bundle sizes.
Why Nuxt I18n Micro?
TheNuxt I18n Micro module was created to address critical performance issues found in the originalnuxt-i18n module, particularly in high-traffic environments and projects with large translation files. Key issues withnuxt-i18n include:
High Memory Consumption: Consumes significant memory during both build and runtime, leading to performance bottlenecks.
Slow Performance: Especially with large translation files, it causes noticeable slowdowns in build times and server response.
Large Bundle Size: Generates a large bundle, negatively impacting application performance.
Memory Leaks and Bugs: Known for memory leaks and unpredictable behavior under heavy load.
Performance Comparison
To showcase the efficiency ofNuxt I18n Micro, we conducted tests under identical conditions. Both modules were tested with a 10MB translation file on the same hardware.
Build Time and Resource Consumption
i18n-micro: 8.57 seconds, Max Memory: 1080.31 MB, Max CPU: 209.50%
i18n v10: 100.20 seconds, Max Memory: 8827.23 MB, Max CPU: 321.40%
Time Difference: -91.63 seconds
Memory Difference: -7746.92 MB
CPU Usage Difference: -111.90%
Comparison between i18n v10 and i18n-micro
Max Memory Used Difference: -107.61 MB
Min Memory Used Difference: -1.33 MB
Avg Memory Used Difference: -14.33 MB
Max CPU Usage Difference: -14.70%
Min CPU Usage Difference: 0.00%
Avg CPU Usage Difference: 3.76%
Stress Test Time Difference: 0.00 seconds
Average Response Time Difference: 1239.80 ms
Min Response Time Difference: 112.00 ms
Max Response Time Difference: -53.00 ms
Requests Per Second Difference: 3.00
Error Rate Difference: 0.00%
These results clearly demonstrate thatNuxt I18n Micro significantly outperforms the original module in every critical area.
Key Features
🌐Compact Yet Powerful: Despite its small size,Nuxt I18n Micro is designed for large-scale projects, focusing on performance and efficiency.
⚡Optimized Build and Runtime: Reduces build times, memory usage, and server load, making it ideal for high-traffic applications.
🛠Minimalist Design: The module is structured around just 5 components (1 module and 4 plugins), making it easy to understand, extend, and maintain.
📏Efficient Routing: Generates only 2 routes regardless of the number of locales, thanks to dynamic regex-based routing, unlike other i18n modules that generate separate routes for each locale.
🗂Streamlined Translation Loading: Only JSON files are supported, with translations split between a global file for common texts (e.g., menus) and page-specific files, which are auto-generated in thedev mode if not present.