News โ
Redesigned DevTools in Nuxt I18n Micro v1.73.0 ๐ โ
Date: 2025-01-27
Version: v1.73.0
Weโre excited to unveil the fully revamped DevTools in v1.73.0, bringing a modern, intuitive experience to your i18n workflow! The update introduces powerful new features, improved usability, and a host of enhancements to streamline localization and translation management.
Whatโs New? โ
- New Editor
- File Tree Viewer
- Online Translator
- Enhanced Settings
- Advanced Statistics
Nuxt I18n Micro v1.65.0 โ
Date: 2025-01-20
Version: v1.65.0
Weโre thrilled to announce v1.65.0, featuring a complete rewrite of core logic for better performance and maintainability! This release includes enhanced TypeScript support, client-side locale redirection, and streamlined translation handling. Upgrade now for a smoother, faster experience! ๐
Optimized Translation Loading Algorithm Released โ
Date: 2025-01-10
Version Introduced: v1.58.0
We are thrilled to announce the release of a new algorithm for loading translations in Nuxt I18n Micro. This update introduces significant performance improvements, a cleaner architecture, and more efficient memory usage.
Whatโs New? โ
The new translation-loading algorithm focuses on:
- Optimized File Merging: Enhanced the deep merge functionality to handle translations more efficiently.
- Caching Enhancements: Leveraged server storage for pre-rendered translations, reducing redundant computations.
- Streamlined Code: Simplified file paths and structure for better maintainability.
Key Benefits โ
1. Faster Build Times โ
The new algorithm reduces build times by efficiently handling translation files and minimizing memory overhead.
- Old Build Time: 7.20 seconds
- New Build Time: 6.91 seconds
- Improvement: 4.03% faster
2. Reduced CPU Usage โ
Lower maximum and average CPU usage during builds and stress tests:
- Build Max CPU: From 257.60% โ 198.20% (23.06% lower)
- Stress Test Avg CPU: From 93.85% โ 89.14% (5.01% lower)
3. Lower Memory Usage โ
Memory consumption has been significantly optimized across builds and runtime stress tests:
- Build Max Memory: From 1286.00 MB โ 885.19 MB (31.15% lower)
- Stress Test Max Memory: From 624.22 MB โ 429.52 MB (31.20% lower)
4. Enhanced Response Times โ
Stress test response times saw drastic improvement:
- Average Response Time: From 411.50 ms โ 9.30 ms (97.74% faster)
- Max Response Time: From 2723.00 ms โ 187.00 ms (93.13% faster)
5. Increased Request Throughput โ
The new algorithm boosts the number of handled requests per second:
- Requests per Second: From 288.00 โ 305.00 (5.90% increase)
Why Itโs Important โ
Localization is essential for global applications, and improving translation-loading performance can have a direct impact on:
- User Experience: Faster response times lead to a smoother user experience.
- Scalability: Lower resource usage allows better handling of high traffic.
- Developer Productivity: Reduced build times and a simplified codebase streamline workflows.
How It Works โ
- Efficient Deep Merging
- The algorithm has been rewritten to handle translation merging more intelligently, ensuring minimal memory overhead and faster operations.
- Smart Caching
- Server-side storage is now used to cache translations during pre-rendering, which are then reused during runtime. This avoids repetitive reads and merges.
- Streamlined File Loading
- Translation files are loaded in a more predictable and maintainable way by unifying fallback handling and caching.
New CLI Feature: text-to-i18n
โ
Date: 2024-12-24
Cli Version Introduced: v1.1.0
Weโre excited to announce the new text-to-i18n
command in the Nuxt I18n Micro CLI! This powerful feature automates the process of extracting hardcoded text strings from your codebase and converting them into i18n translation keys. Itโs designed to save time, reduce errors, and streamline your localization workflow.
Key Benefits โ
- Automated Text Extraction: Scans Vue templates, JavaScript, and TypeScript files.
- Seamless Key Generation: Creates structured translation keys based on file paths and content.
- Efficient Translation Management: Updates your translation files while preserving existing entries.
How It Works โ
- File Scanning: Processes files in key directories like
pages
,components
, andplugins
. - Text Processing: Identifies and extracts translatable strings, generating unique keys.
- Translation Updates: Automatically inserts new keys into your translation files and maintains their nested structure.
Usage โ
i18n-micro text-to-i18n [options]
Example:
i18n-micro text-to-i18n --translationFile locales/en.json --context auth
Example Transformations โ
Before โ
<template>
<div>
<h1>Welcome to our site</h1>
<p>Please sign in to continue</p>
</div>
</template>
After โ
<template>
<div>
<h1>{{ $t('pages.home.welcome_to_our_site') }}</h1>
<p>{{ $t('pages.home.please_sign_in') }}</p>
</div>
</template>
For more details, check out the documentation.