i18ntk 1.0.2 โ 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -2
- package/README.md +31 -117
- package/docs/README.md +17 -15
- package/docs/api/API_REFERENCE.md +9 -2
- package/docs/development/AGENTS.md +1 -3
- package/docs/release-notes/RELEASE_NOTES_v1.0.4.md +151 -0
- package/main/i18ntk-complete.js +0 -19
- package/main/i18ntk-manage.js +1 -0
- package/main/i18ntk-usage.js +3 -3
- package/main/i18ntk-validate.js +9 -9
- package/package.json +12 -12
- package/settings/user-config.json +1 -1
- package/utils/i18n-helper.js +8 -0
- package/utils/security.js +2 -1
- package/utils/test-complete-system.js +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,71 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the I18N Management Toolkit are documented here. This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
**Current Version:** 1.0.
|
|
5
|
+
**Current Version:** 1.0.5 (2025-01-27) - **PATCH RELEASE** ๐งน
|
|
6
6
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
-
## [1.0.
|
|
10
|
+
## [1.0.5] - 2025-01-27
|
|
11
|
+
|
|
12
|
+
### ๐งน System Cleanup and Organization
|
|
13
|
+
- **Cleaned**: Removed test-specific translation files (validationStep.json, reportGenerator.json) from user locale directories
|
|
14
|
+
- **Fixed**: Removed hardcoded validationStep and reportGenerator keys from i18ntk-complete.js
|
|
15
|
+
- **Improved**: Moved npm test reports to dev/debug/reports directory for better organization
|
|
16
|
+
- **Enhanced**: Prevented pollution of user systems with non-applicable translation files
|
|
17
|
+
- **Fixed**: Syntax error in i18ntk-complete.js after key removal operations
|
|
18
|
+
|
|
19
|
+
### ๐ฏ Production Readiness Improvements
|
|
20
|
+
- **Ensured**: Only essential files (auth.json, common.json, pagination.json) remain in user locales
|
|
21
|
+
- **Enhanced**: System cleanliness and prevented test artifacts in production environments
|
|
22
|
+
- **Improved**: Project organization with proper separation of test and production concerns
|
|
23
|
+
- **Updated**: Documentation to reflect cleanup and organizational improvements
|
|
24
|
+
|
|
25
|
+
### ๐ก๏ธ Quality Assurance
|
|
26
|
+
- **Isolated**: Test-specific files no longer pollute user installations during npm test
|
|
27
|
+
- **Cleaned**: Initialization process now only creates necessary translation files
|
|
28
|
+
- **Enhanced**: System stability through better file management practices
|
|
29
|
+
- **Secured**: Eliminated risk of test artifacts affecting production deployments
|
|
30
|
+
|
|
31
|
+
### โ
Validation Results
|
|
32
|
+
- **Tests**: All 25 tests passing with 0 errors and 0 warnings
|
|
33
|
+
- **Locales**: Clean structure with 3 files and 17 keys per language (down from 5 files and 30 keys)
|
|
34
|
+
- **System**: Ready for production deployment with enhanced cleanliness
|
|
35
|
+
- **Status**: Fully functional with improved organizational structure
|
|
36
|
+
|
|
37
|
+
## [1.0.4] - 2025-01-27
|
|
38
|
+
|
|
39
|
+
### ๐ง Critical Translation System Fixes
|
|
40
|
+
- **Fixed**: Translation system initialization issues causing "Translation not found" errors
|
|
41
|
+
- **Fixed**: Dynamic value replacement in validation summary ({{langs}}, {{lang}}, {count}, {{percentage}})
|
|
42
|
+
- **Fixed**: Parameter name mismatches between translation function calls and template placeholders
|
|
43
|
+
- **Enhanced**: Auto-loading of English translations when t() function is first called
|
|
44
|
+
- **Added**: uiLanguage to allowed security configuration keys to prevent warnings
|
|
45
|
+
- **Improved**: Translation system robustness across all modules
|
|
46
|
+
- **Updated**: Documentation to reflect latest fixes and improvements
|
|
47
|
+
|
|
48
|
+
### ๐ Specific Issues Resolved
|
|
49
|
+
- Resolved "Translation not found for key: hardcodedTexts.securityUnknownConfigKey" error
|
|
50
|
+
- Fixed template placeholders not being replaced with actual values in validation output
|
|
51
|
+
- Corrected parameter naming inconsistencies (languagesโlangs, languageโlang, *Countโcount, translationPercentageโpercentage)
|
|
52
|
+
- Added isInitialized flag to prevent redundant translation loading
|
|
53
|
+
- Enhanced i18n-helper.js with automatic translation initialization
|
|
54
|
+
|
|
55
|
+
### โ
Quality Assurance
|
|
56
|
+
- **Tests**: All validation scripts now run without translation errors
|
|
57
|
+
- **Dynamic Values**: Proper replacement of all template placeholders confirmed
|
|
58
|
+
- **Security**: No more unknown configuration key warnings
|
|
59
|
+
- **Status**: Translation system fully operational and robust
|
|
60
|
+
|
|
61
|
+
## [1.0.3] - 2025-07-27
|
|
62
|
+
|
|
63
|
+
### ๐ง Patch Release
|
|
64
|
+
- **Fixed**: CLI `--help` command hanging issue - now properly exits after displaying help
|
|
65
|
+
- **Updated**: README.md to be more accurate, concise, and informative
|
|
66
|
+
- **Improved**: Documentation clarity regarding 95% console UI translation coverage
|
|
67
|
+
- **Note**: Translation keys `hardcodedTexts.noSourceFilesFound` and `hardcodedTexts.analyzingTranslationCompleteness` are present in all language files
|
|
68
|
+
|
|
69
|
+
## [1.0.2] - 2025-07-27
|
|
11
70
|
|
|
12
71
|
### ๐ง Patch Release
|
|
13
72
|
- **Fixed**: Added missing `settings/` directory to package files
|
package/README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# i18ntk - Enterprise i18n Management Toolkit
|
|
2
2
|
|
|
3
|
-
**Version:** 1.0.
|
|
4
|
-
**Release Date:** 27/07/2025
|
|
5
|
-
**Maintainer:** Vladimir Noskov
|
|
3
|
+
**Version:** 1.0.5 โ System cleanup and organizational improvements. Enhanced production readiness! ๐
|
|
6
4
|
|
|
7
5
|
[](https://badge.fury.io/js/i18ntk)
|
|
8
6
|
[](https://opensource.org/licenses/MIT)
|
|
9
7
|
[](https://nodejs.org/)
|
|
10
8
|
|
|
11
|
-
**i18ntk** (i18n Toolkit) is a comprehensive, enterprise-grade internationalization management toolkit for JavaScript/TypeScript projects.
|
|
9
|
+
**i18ntk** (i18n Toolkit) is a comprehensive, enterprise-grade internationalization management toolkit for JavaScript/TypeScript projects. It provides a complete CLI suite with multi-language support and advanced analysis capabilities for managing translations efficiently.
|
|
12
10
|
|
|
13
11
|
## ๐ Quick Start
|
|
14
12
|
|
|
@@ -49,64 +47,38 @@ i18ntk-complete
|
|
|
49
47
|
|
|
50
48
|
### Available Commands
|
|
51
49
|
|
|
52
|
-
Once installed, you have access to
|
|
50
|
+
Once installed globally, you have access to the main CLI command:
|
|
53
51
|
|
|
54
52
|
```bash
|
|
55
|
-
i18ntk
|
|
56
|
-
i18ntk
|
|
57
|
-
i18ntk
|
|
58
|
-
i18ntk-validate # โ
Validate translation quality
|
|
59
|
-
i18ntk-usage # ๐ Analyze translation key usage
|
|
60
|
-
i18ntk-complete # ๐ง Complete missing translations
|
|
61
|
-
i18ntk-sizing # ๐ Generate sizing reports
|
|
62
|
-
i18ntk-summary # ๐ Generate summary reports
|
|
63
|
-
i18ntk-autorun # โก Automated workflow execution
|
|
64
|
-
i18ntk-debug # ๐ Debug and diagnostics
|
|
53
|
+
i18ntk # ๐๏ธ Main management interface (interactive menu)
|
|
54
|
+
i18ntk --help # โ Show help and available options
|
|
55
|
+
i18ntk --version # ๐ Show version information
|
|
65
56
|
```
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
####
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
- **
|
|
77
|
-
- **
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- **
|
|
82
|
-
- **
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **
|
|
88
|
-
- **
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- **Detailed Reporting System**: Generate comprehensive analysis reports
|
|
92
|
-
- **Quality Assurance**: 25/25 tests passing with complete validation
|
|
93
|
-
- **Security Features**: Admin authentication and secure configuration management
|
|
94
|
-
- **Debug Tools**: Advanced debugging capabilities for troubleshooting
|
|
95
|
-
|
|
96
|
-
#### ๐ Quality Metrics
|
|
97
|
-
- โ
**100% Test Coverage**: All 25 tests passing
|
|
98
|
-
- โ
**Zero Critical Issues**: No known bugs or security vulnerabilities
|
|
99
|
-
- โ
**Complete Translation Coverage**: 573/573 keys in all supported languages
|
|
100
|
-
- โ
**Production Ready**: Thoroughly tested and validated for enterprise use
|
|
101
|
-
|
|
102
|
-
### ๐ Language Coverage Status
|
|
103
|
-
- ๐บ๐ธ **English**: 573/573 keys (100%)
|
|
104
|
-
- ๐ฉ๐ช **German**: 573/573 keys (100%) - Added 173 keys
|
|
105
|
-
- ๐ช๐ธ **Spanish**: 573/573 keys (100%) - Added 173 keys
|
|
106
|
-
- ๐ซ๐ท **French**: 573/573 keys (100%) - Added 173 keys
|
|
107
|
-
- ๐ฏ๐ต **Japanese**: 573/573 keys (100%) - Added 173 keys
|
|
108
|
-
- ๐ท๐บ **Russian**: 573/573 keys (100%) - Added 173 keys
|
|
109
|
-
- ๐จ๐ณ **Chinese**: 573/573 keys (100%) - Added 173 keys
|
|
58
|
+
**Note:** Console UI translation support is at approximately 95%. Some hardcoded English text remains and will be addressed in upcoming updates, but this doesn't affect core functionality.
|
|
59
|
+
|
|
60
|
+
## โจ What's New in v1.0.5
|
|
61
|
+
|
|
62
|
+
### ๐งน System Cleanup and Organization
|
|
63
|
+
|
|
64
|
+
#### ๐ง Major Improvements
|
|
65
|
+
- **Cleaned Translation Files**: Removed test-specific translation files from user locale directories
|
|
66
|
+
- **Fixed Code Issues**: Removed hardcoded validationStep and reportGenerator keys from i18ntk-complete.js
|
|
67
|
+
- **Better Organization**: Moved npm test reports to dev/debug/reports directory
|
|
68
|
+
- **Enhanced Cleanliness**: Prevented pollution of user systems with non-applicable translation files
|
|
69
|
+
- **Syntax Fixes**: Resolved syntax errors after key removal operations
|
|
70
|
+
|
|
71
|
+
#### ๐ฏ Production Readiness
|
|
72
|
+
- **Essential Files Only**: Ensured only essential file (common.json) remain in locales
|
|
73
|
+
- **Clean System**: Enhanced system cleanliness and prevented test artifacts in production
|
|
74
|
+
- **Better Structure**: Improved project organization with proper separation of concerns
|
|
75
|
+
- **Documentation Updates**: Updated documentation to reflect cleanup and organizational improvements
|
|
76
|
+
|
|
77
|
+
#### ๐ก๏ธ Quality Assurance
|
|
78
|
+
- **Test Isolation**: Test-specific files no longer pollute user installations
|
|
79
|
+
- **Clean Initialization**: Only necessary translation files are created during project setup
|
|
80
|
+
- **Improved Reliability**: Enhanced system stability through better file management
|
|
81
|
+
- **Production Safety**: Eliminated risk of test artifacts affecting production deployments
|
|
110
82
|
|
|
111
83
|
## ๐ Documentation
|
|
112
84
|
|
|
@@ -122,26 +94,6 @@ After extensive development and testing, we're excited to announce the first sta
|
|
|
122
94
|
|
|
123
95
|
**๐ [Changelog](./CHANGELOG.md)** - Version history and release notes
|
|
124
96
|
|
|
125
|
-
## ๐ Major Release (v1.5.0) - Stable Release
|
|
126
|
-
|
|
127
|
-
### ๐ New Features
|
|
128
|
-
- **๐ 100% Console Translation Support**: All console output is now fully internationalized in all supported languages
|
|
129
|
-
- **๐ Enhanced Admin PIN Security**: Upgraded encryption with session-based authentication and timeout management
|
|
130
|
-
- **โญ PIN Display Security**: Admin PINs are properly masked with asterisks (****) in all interfaces
|
|
131
|
-
- **๐ Session Management**: PIN authentication persists until session timeout or application exit
|
|
132
|
-
- **๐ก๏ธ Improved Security**: Replaced deprecated crypto functions with modern secure alternatives
|
|
133
|
-
|
|
134
|
-
### ๐ Critical Bug Fixes
|
|
135
|
-
- **Fixed crypto deprecation warnings**: Updated to use `createCipheriv` and `createDecipheriv`
|
|
136
|
-
- **Fixed PIN display issues**: Proper masking and secure display of admin PINs
|
|
137
|
-
- **Fixed readline interface**: Resolved all interactive input issues with proper session handling
|
|
138
|
-
- **Fixed authentication flow**: Streamlined admin PIN verification and session management
|
|
139
|
-
|
|
140
|
-
### ๐ง Stability Improvements
|
|
141
|
-
- **Enhanced security architecture**: Modern encryption standards and secure PIN storage
|
|
142
|
-
- **Better session handling**: Automatic timeout and re-authentication when needed
|
|
143
|
-
- **Improved error handling**: Graceful degradation and user-friendly error messages
|
|
144
|
-
- **Robust authentication**: Reliable PIN verification with proper session state management
|
|
145
97
|
|
|
146
98
|
## ๐ Features
|
|
147
99
|
|
|
@@ -270,42 +222,6 @@ i18n-management-toolkit/
|
|
|
270
222
|
โโโ README.md # This file
|
|
271
223
|
```
|
|
272
224
|
|
|
273
|
-
## ๐ Quick Start
|
|
274
|
-
|
|
275
|
-
### 1. Installation
|
|
276
|
-
```bash
|
|
277
|
-
npm install -g i18n-management-toolkit
|
|
278
|
-
# or for local project
|
|
279
|
-
npm install
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### 2. Initialize i18n Setup
|
|
283
|
-
```bash
|
|
284
|
-
npm run i18ntk:init
|
|
285
|
-
# or directly
|
|
286
|
-
node main/i18ntk-init.js
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
### 3. Run Main Management Interface
|
|
290
|
-
```bash
|
|
291
|
-
npm run i18ntk
|
|
292
|
-
# or directly
|
|
293
|
-
node main/i18ntk-manage.js
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### 4. Automated Workflow (Recommended)
|
|
297
|
-
```bash
|
|
298
|
-
npm run i18ntk:autorun
|
|
299
|
-
# or directly
|
|
300
|
-
node main/i18ntk-autorun.js
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### New Features
|
|
304
|
-
|
|
305
|
-
- **๐ง Debug Tools**: Access comprehensive debugging tools via option 13 in the main menu
|
|
306
|
-
- **โ๏ธ Advanced Settings**: Enhanced settings interface with validation and helper text
|
|
307
|
-
- **๐ Admin PIN Protection**: Secure sensitive settings with encrypted PIN authentication
|
|
308
|
-
- **๐ Better Organization**: UI internationalization moved to main folder for cleaner structure
|
|
309
225
|
|
|
310
226
|
### ๐ TODO
|
|
311
227
|
|
|
@@ -349,8 +265,6 @@ node main/i18ntk-autorun.js
|
|
|
349
265
|
}
|
|
350
266
|
```
|
|
351
267
|
|
|
352
|
-
- **๐๏ธ Delete Reports and Backups (New)**: Add option to delete backups alongside reports with selection options: by folder, keep last 3, or delete all.
|
|
353
|
-
|
|
354
268
|
> **๐ For detailed setup and usage instructions, see [Documentation](./docs/README.md)**
|
|
355
269
|
|
|
356
270
|
## ๐ ๏ธ Core Commands
|
|
@@ -501,7 +415,7 @@ node dev/tests/test-features.js
|
|
|
501
415
|
|
|
502
416
|
---
|
|
503
417
|
|
|
504
|
-
**Version:** 1.0.
|
|
418
|
+
**Version:** 1.0.5 โ System cleanup and organizational improvements. Enhanced production readiness! ๐
|
|
505
419
|
## ๐ License
|
|
506
420
|
|
|
507
421
|
This project is licensed under the MIT License - see the `LICENSE` file for details.
|
package/docs/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# I18N Management Toolkit - Documentation Hub
|
|
2
2
|
|
|
3
|
-
**Version:** 1.0.
|
|
4
|
-
**Last Updated:**
|
|
3
|
+
**Version:** 1.0.4
|
|
4
|
+
**Last Updated:** January 27, 2025
|
|
5
5
|
**Maintainer:** Vladimir Noskov
|
|
6
6
|
|
|
7
7
|
## ๐ Welcome to the Documentation Hub
|
|
@@ -14,7 +14,7 @@ This is your central hub for all I18N Management Toolkit documentation. Whether
|
|
|
14
14
|
Start with these essential documents:
|
|
15
15
|
|
|
16
16
|
1. **[Main README](../README.md)** - Overview, installation, and quick start guide
|
|
17
|
-
2. **[Release Notes v1.0.
|
|
17
|
+
2. **[Release Notes v1.0.4](./release-notes/RELEASE_NOTES_v1.0.4.md)** - Latest translation system fixes
|
|
18
18
|
3. **[API Reference](./api/API_REFERENCE.md)** - Complete command and API documentation
|
|
19
19
|
4. **[Configuration Guide](./api/CONFIGURATION.md)** - Detailed configuration options
|
|
20
20
|
|
|
@@ -143,12 +143,13 @@ All languages maintain **100% translation coverage** with **573/573 keys** trans
|
|
|
143
143
|
|
|
144
144
|
## ๐ Quality Assurance
|
|
145
145
|
|
|
146
|
-
### Current Status (v1.0.
|
|
146
|
+
### Current Status (v1.0.4)
|
|
147
147
|
```
|
|
148
148
|
โ
Tests Passing: 25/25 (100%)
|
|
149
149
|
โ
Translation Coverage: 573/573 keys (100%)
|
|
150
|
-
โ
|
|
151
|
-
โ
Dynamic
|
|
150
|
+
โ
Translation Errors: 0 (fixed)
|
|
151
|
+
โ
Dynamic Value Replacement: Working
|
|
152
|
+
โ
Security Configuration: Valid
|
|
152
153
|
๐ Overall Status: ๐ข READY
|
|
153
154
|
```
|
|
154
155
|
|
|
@@ -176,10 +177,11 @@ For enterprise support, custom integrations, or consulting services, please cont
|
|
|
176
177
|
## ๐ Version History
|
|
177
178
|
|
|
178
179
|
### Recent Releases
|
|
179
|
-
- **[v1.0.
|
|
180
|
-
- **[v1.
|
|
181
|
-
- **[v1.
|
|
182
|
-
- **[v1.
|
|
180
|
+
- **[v1.0.4](./release-notes/RELEASE_NOTES_v1.0.4.md)** - Critical Translation System Fixes (Current)
|
|
181
|
+
- **[v1.0.3](../CHANGELOG.md#103---2025-01-27)** - CLI and Packaging Fixes
|
|
182
|
+
- **[v1.0.2](../CHANGELOG.md#102---2025-01-27)** - Module Resolution Fixes
|
|
183
|
+
- **[v1.0.1](../CHANGELOG.md#101---2025-07-27)** - CLI Usability Improvements
|
|
184
|
+
- **[v1.0.0](../CHANGELOG.md#100---2025-07-27)** - First Stable Release
|
|
183
185
|
|
|
184
186
|
### Migration Guides
|
|
185
187
|
- **[Upgrading to v1.0.0](../RELEASE_NOTES_v1.0.0.md#-migration-guide)** - Seamless upgrade from dev versions
|
|
@@ -187,12 +189,12 @@ For enterprise support, custom integrations, or consulting services, please cont
|
|
|
187
189
|
|
|
188
190
|
## ๐ What's Next
|
|
189
191
|
|
|
190
|
-
### Upcoming Features (v1.
|
|
191
|
-
- Enhanced
|
|
192
|
-
- Advanced
|
|
192
|
+
### Upcoming Features (v1.1.0)
|
|
193
|
+
- Enhanced AI-powered translation suggestions
|
|
194
|
+
- Advanced framework integrations
|
|
193
195
|
- Performance optimizations
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
+
- Extended language support
|
|
197
|
+
- Enterprise security features
|
|
196
198
|
|
|
197
199
|
### Long-term Roadmap
|
|
198
200
|
- Multi-language object format for translation keys
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
# I18N Management Toolkit - API Reference
|
|
2
2
|
|
|
3
|
-
**Version:** 1.0.
|
|
4
|
-
**Last Updated:** 27/
|
|
3
|
+
**Version:** 1.0.4
|
|
4
|
+
**Last Updated:** 27/01/2025
|
|
5
5
|
**Maintainer:** Vladimir Noskov
|
|
6
6
|
|
|
7
7
|
## ๐ Overview
|
|
8
8
|
|
|
9
9
|
This document provides a comprehensive API reference for the I18N Management Toolkit, including all available commands, configuration options, and programmatic interfaces.
|
|
10
10
|
|
|
11
|
+
### ๐ง Latest Updates (v1.0.4)
|
|
12
|
+
- **Fixed**: Translation system initialization issues
|
|
13
|
+
- **Enhanced**: Dynamic value replacement in all outputs
|
|
14
|
+
- **Improved**: Security configuration validation
|
|
15
|
+
- **Added**: Auto-loading translation support
|
|
16
|
+
- **Resolved**: All "Translation not found" errors
|
|
17
|
+
|
|
11
18
|
## ๐ Command Line Interface (CLI)
|
|
12
19
|
|
|
13
20
|
### Core Commands
|
|
@@ -148,9 +148,7 @@ locales/ # Your project's translation files
|
|
|
148
148
|
โโโ en/ # English (source language)
|
|
149
149
|
โ โโโ common.json
|
|
150
150
|
โ โโโ auth.json
|
|
151
|
-
โ
|
|
152
|
-
โ โโโ reportGenerator.json
|
|
153
|
-
โ โโโ validationStep.json
|
|
151
|
+
โ โโโ pagination.json
|
|
154
152
|
โโโ de/ # German translations
|
|
155
153
|
โโโ es/ # Spanish translations
|
|
156
154
|
โโโ fr/ # French translations
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Release Notes - i18ntk v1.0.4
|
|
2
|
+
|
|
3
|
+
**Release Date:** January 27, 2025
|
|
4
|
+
**Release Type:** Patch Release ๐ง
|
|
5
|
+
**Status:** Critical Translation System Fixes
|
|
6
|
+
|
|
7
|
+
## ๐ฏ Overview
|
|
8
|
+
|
|
9
|
+
Version 1.0.4 is a critical patch release that addresses significant translation system issues discovered in previous versions. This release focuses on fixing translation initialization problems, dynamic value replacement issues, and parameter naming inconsistencies that were causing "Translation not found" errors and incorrect template rendering.
|
|
10
|
+
|
|
11
|
+
## ๐ง Critical Translation System Fixes
|
|
12
|
+
|
|
13
|
+
### ๐ Major Bug Fixes
|
|
14
|
+
|
|
15
|
+
#### Translation System Initialization
|
|
16
|
+
- **Fixed**: Translation system initialization issues causing "Translation not found" errors
|
|
17
|
+
- **Enhanced**: Auto-loading of English translations when `t()` function is first called
|
|
18
|
+
- **Added**: `isInitialized` flag to prevent redundant translation loading
|
|
19
|
+
- **Improved**: Translation system robustness across all modules
|
|
20
|
+
|
|
21
|
+
#### Dynamic Value Replacement
|
|
22
|
+
- **Fixed**: Template placeholders not being replaced with actual values in validation summary
|
|
23
|
+
- **Resolved**: Issues with `{{langs}}`, `{{lang}}`, `{count}`, and `{{percentage}}` placeholders
|
|
24
|
+
- **Corrected**: Parameter name mismatches between translation function calls and template placeholders
|
|
25
|
+
- **Enhanced**: Full support for all template placeholder formats
|
|
26
|
+
|
|
27
|
+
#### Security Configuration
|
|
28
|
+
- **Added**: `uiLanguage` to allowed security configuration keys
|
|
29
|
+
- **Resolved**: "Security: Unknown config key: uiLanguage" warnings
|
|
30
|
+
- **Improved**: Security validation to include all valid configuration options
|
|
31
|
+
|
|
32
|
+
### ๐ Specific Issues Resolved
|
|
33
|
+
|
|
34
|
+
1. **Translation Not Found Error**
|
|
35
|
+
- **Issue**: `Translation not found for key: hardcodedTexts.securityUnknownConfigKey`
|
|
36
|
+
- **Root Cause**: Translation system not initialized when security module was loaded
|
|
37
|
+
- **Solution**: Added auto-initialization in `i18n-helper.js` `t()` function
|
|
38
|
+
|
|
39
|
+
2. **Dynamic Value Replacement**
|
|
40
|
+
- **Issue**: Template placeholders like `{{langs}}`, `{{lang}}`, `{count}` not replaced
|
|
41
|
+
- **Root Cause**: Parameter name mismatches in `i18ntk-validate.js`
|
|
42
|
+
- **Solution**: Corrected parameter names to match template expectations
|
|
43
|
+
- `languages` โ `langs`
|
|
44
|
+
- `language` โ `lang`
|
|
45
|
+
- `*Count` parameters โ `count`
|
|
46
|
+
- `translationPercentage` โ `percentage`
|
|
47
|
+
|
|
48
|
+
3. **Security Configuration Warnings**
|
|
49
|
+
- **Issue**: `uiLanguage` flagged as unknown configuration key
|
|
50
|
+
- **Root Cause**: Missing from allowed keys list in security validation
|
|
51
|
+
- **Solution**: Added `uiLanguage` to `allowedKeys` array in `security.js`
|
|
52
|
+
|
|
53
|
+
## ๐ Files Modified
|
|
54
|
+
|
|
55
|
+
### Core Translation System
|
|
56
|
+
- `utils/i18n-helper.js`
|
|
57
|
+
- Added auto-initialization of translations in `t()` function
|
|
58
|
+
- Added `isInitialized` flag for proper state management
|
|
59
|
+
- Enhanced `loadTranslations()` to set initialization flag
|
|
60
|
+
|
|
61
|
+
### Validation System
|
|
62
|
+
- `main/i18ntk-validate.js`
|
|
63
|
+
- Fixed parameter name mismatches in translation calls
|
|
64
|
+
- Corrected template placeholder alignment
|
|
65
|
+
- Enhanced dynamic value replacement
|
|
66
|
+
|
|
67
|
+
### Security System
|
|
68
|
+
- `utils/security.js`
|
|
69
|
+
- Added `uiLanguage` to allowed configuration keys
|
|
70
|
+
- Improved security validation coverage
|
|
71
|
+
|
|
72
|
+
### Documentation
|
|
73
|
+
- `package.json` - Updated version to 1.0.4
|
|
74
|
+
- `CHANGELOG.md` - Added comprehensive v1.0.4 release notes
|
|
75
|
+
- `README.md` - Updated to reflect latest fixes and improvements
|
|
76
|
+
|
|
77
|
+
## โ
Quality Assurance
|
|
78
|
+
|
|
79
|
+
### Testing Results
|
|
80
|
+
- **Translation Errors**: โ
Resolved - No more "Translation not found" errors
|
|
81
|
+
- **Dynamic Values**: โ
Working - All template placeholders properly replaced
|
|
82
|
+
- **Security Warnings**: โ
Fixed - No more unknown configuration key warnings
|
|
83
|
+
- **Validation Scripts**: โ
Operational - All tools run without translation errors
|
|
84
|
+
|
|
85
|
+
### Verification Commands
|
|
86
|
+
```bash
|
|
87
|
+
# Test validation with proper dynamic values
|
|
88
|
+
node main/i18ntk-validate.js --source-dir=./locales
|
|
89
|
+
|
|
90
|
+
# Verify no translation errors
|
|
91
|
+
node main/i18ntk-analyze.js --help
|
|
92
|
+
|
|
93
|
+
# Check security configuration
|
|
94
|
+
node main/i18ntk-manage.js
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## ๐ Upgrade Instructions
|
|
98
|
+
|
|
99
|
+
### For Global Installation
|
|
100
|
+
```bash
|
|
101
|
+
npm update -g i18ntk
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### For Local Installation
|
|
105
|
+
```bash
|
|
106
|
+
npm update i18ntk
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Verification
|
|
110
|
+
```bash
|
|
111
|
+
i18ntk --version # Should show 1.0.4
|
|
112
|
+
i18ntk-validate --help # Should exit properly without errors
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## ๐ Breaking Changes
|
|
116
|
+
|
|
117
|
+
**None** - This is a patch release with no breaking changes. All existing functionality remains compatible.
|
|
118
|
+
|
|
119
|
+
## ๐ฏ Impact
|
|
120
|
+
|
|
121
|
+
### Before v1.0.4
|
|
122
|
+
- Translation errors in console output
|
|
123
|
+
- Dynamic values not replaced in validation summary
|
|
124
|
+
- Security warnings for valid configuration
|
|
125
|
+
- Inconsistent translation system behavior
|
|
126
|
+
|
|
127
|
+
### After v1.0.4
|
|
128
|
+
- โ
Clean console output without translation errors
|
|
129
|
+
- โ
Proper dynamic value replacement in all outputs
|
|
130
|
+
- โ
No security warnings for valid configurations
|
|
131
|
+
- โ
Robust and reliable translation system
|
|
132
|
+
|
|
133
|
+
## ๐ Next Steps
|
|
134
|
+
|
|
135
|
+
After upgrading to v1.0.4:
|
|
136
|
+
1. Run your existing i18n workflows to verify improvements
|
|
137
|
+
2. Check that all dynamic values display correctly
|
|
138
|
+
3. Confirm no translation errors in console output
|
|
139
|
+
4. Update any custom scripts that may depend on the fixed behavior
|
|
140
|
+
|
|
141
|
+
## ๐ Support
|
|
142
|
+
|
|
143
|
+
If you encounter any issues with v1.0.4:
|
|
144
|
+
- Check the [troubleshooting guide](../debug/DEBUG_TOOLS.md)
|
|
145
|
+
- Review the [configuration documentation](../api/CONFIGURATION.md)
|
|
146
|
+
- Report issues on [GitHub Issues](https://github.com/vladnoskv/i18n-management-toolkit/issues)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
**Previous Release:** [v1.0.3](./RELEASE_NOTES_v1.0.3.md)
|
|
151
|
+
**Full Changelog:** [CHANGELOG.md](../../CHANGELOG.md)
|
package/main/i18ntk-complete.js
CHANGED
|
@@ -60,22 +60,6 @@ const COMMON_MISSING_KEYS = {
|
|
|
60
60
|
'pagination.items': 'items',
|
|
61
61
|
'pagination.rowsPerPage': 'Rows per page',
|
|
62
62
|
|
|
63
|
-
// Report Generator
|
|
64
|
-
'reportGenerator:reportTypes.prospects': 'Prospects Report',
|
|
65
|
-
'reportGenerator:reportTypes.activities': 'Activities Report',
|
|
66
|
-
'reportGenerator:reportTypes.goals': 'Goals Report',
|
|
67
|
-
'reportGenerator:reportTypes.team': 'Team Report',
|
|
68
|
-
'reportGenerator:reportTypes.hotLeads': 'Hot Leads Report',
|
|
69
|
-
|
|
70
|
-
'reportGenerator:timePeriods.allTime': 'All Time',
|
|
71
|
-
'reportGenerator:timePeriods.last7days': 'Last 7 Days',
|
|
72
|
-
'reportGenerator:timePeriods.last30days': 'Last 30 Days',
|
|
73
|
-
'reportGenerator:timePeriods.thisYear': 'This Year',
|
|
74
|
-
|
|
75
|
-
'reportGenerator:layouts.summary': 'Summary Layout',
|
|
76
|
-
'reportGenerator:layouts.detailed': 'Detailed Layout',
|
|
77
|
-
'reportGenerator:layouts.visual_charts': 'Visual Charts Layout',
|
|
78
|
-
|
|
79
63
|
// Common time periods
|
|
80
64
|
'common:timePeriods.customRange': 'Custom Range',
|
|
81
65
|
|
|
@@ -86,9 +70,6 @@ const COMMON_MISSING_KEYS = {
|
|
|
86
70
|
'common:unknownUser': 'Unknown User',
|
|
87
71
|
'common:notSet': 'Not Set',
|
|
88
72
|
|
|
89
|
-
// Validation
|
|
90
|
-
'validationStep.invalidEmailFormat': 'Invalid email format',
|
|
91
|
-
|
|
92
73
|
// Admin
|
|
93
74
|
'announcement_id': 'Announcement ID',
|
|
94
75
|
'last_sign_in_at': 'Last Sign In'
|
package/main/i18ntk-manage.js
CHANGED
package/main/i18ntk-usage.js
CHANGED
|
@@ -625,7 +625,7 @@ class I18nUsageAnalyzer {
|
|
|
625
625
|
|
|
626
626
|
// If no files found, exit gracefully
|
|
627
627
|
if (sourceFiles.length === 0) {
|
|
628
|
-
console.warn(t('hardcodedTexts.noSourceFilesFound'));
|
|
628
|
+
console.warn(this.t('hardcodedTexts.noSourceFilesFound'));
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
631
|
|
|
@@ -678,11 +678,11 @@ class I18nUsageAnalyzer {
|
|
|
678
678
|
// NEW: Analyze translation completeness across all languages
|
|
679
679
|
async analyzeTranslationCompleteness() {
|
|
680
680
|
try {
|
|
681
|
-
console.log('\n' + t('hardcodedTexts.analyzingTranslationCompleteness'));
|
|
681
|
+
console.log('\n' + this.t('hardcodedTexts.analyzingTranslationCompleteness'));
|
|
682
682
|
|
|
683
683
|
// Check if i18n directory exists
|
|
684
684
|
if (!fs.existsSync(this.i18nDir)) {
|
|
685
|
-
console.warn(t('hardcodedTexts.i18nDirectoryNotFound', { i18nDir: this.i18nDir }));
|
|
685
|
+
console.warn(this.t('hardcodedTexts.i18nDirectoryNotFound', { i18nDir: this.i18nDir }));
|
|
686
686
|
return;
|
|
687
687
|
}
|
|
688
688
|
|
package/main/i18ntk-validate.js
CHANGED
|
@@ -580,24 +580,24 @@ class I18nValidator {
|
|
|
580
580
|
throw new Error('Specified language not found');
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
-
console.log(this.t('validateTranslations.validatingLanguages', {
|
|
583
|
+
console.log(this.t('validateTranslations.validatingLanguages', { langs: targetLanguages.join(', ') }));
|
|
584
584
|
|
|
585
585
|
const results = {};
|
|
586
586
|
|
|
587
587
|
// Validate each language
|
|
588
588
|
for (const language of targetLanguages) {
|
|
589
|
-
console.log(this.t('validateTranslations.validatingLanguage', {
|
|
589
|
+
console.log(this.t('validateTranslations.validatingLanguage', { lang: language }));
|
|
590
590
|
|
|
591
591
|
const validation = await this.validateLanguage(language);
|
|
592
592
|
results[language] = validation;
|
|
593
593
|
|
|
594
594
|
// Display summary
|
|
595
595
|
const { summary } = validation;
|
|
596
|
-
console.log(this.t('validateTranslations.filesCount', {
|
|
597
|
-
console.log(this.t('validateTranslations.keysCount', {
|
|
598
|
-
console.log(this.t('validateTranslations.missingFilesCount', {
|
|
599
|
-
console.log(this.t('validateTranslations.syntaxErrorsCount', {
|
|
600
|
-
console.log(this.t('validateTranslations.translationPercentage', {
|
|
596
|
+
console.log(this.t('validateTranslations.filesCount', { count: summary.validFiles }));
|
|
597
|
+
console.log(this.t('validateTranslations.keysCount', { count: summary.totalKeys }));
|
|
598
|
+
console.log(this.t('validateTranslations.missingFilesCount', { count: summary.missingFiles.length }));
|
|
599
|
+
console.log(this.t('validateTranslations.syntaxErrorsCount', { count: summary.syntaxErrors.length }));
|
|
600
|
+
console.log(this.t('validateTranslations.translationPercentage', { percentage: summary.percentage, translated: summary.translatedKeys, total: summary.totalKeys }));
|
|
601
601
|
console.log('');
|
|
602
602
|
}
|
|
603
603
|
|
|
@@ -606,8 +606,8 @@ class I18nValidator {
|
|
|
606
606
|
const hasWarnings = this.warnings.length > 0;
|
|
607
607
|
|
|
608
608
|
console.log(this.t("validateTranslations.n_validation_summary"));
|
|
609
|
-
console.log(this.t("validateTranslations.total_errors", {
|
|
610
|
-
console.log(this.t("validateTranslations.total_warnings", {
|
|
609
|
+
console.log(this.t("validateTranslations.total_errors", { count: this.errors.length }));
|
|
610
|
+
console.log(this.t("validateTranslations.total_warnings", { count: this.warnings.length }));
|
|
611
611
|
|
|
612
612
|
// Show errors
|
|
613
613
|
if (hasErrors) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18ntk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "i18ntk (i18n Toolkit) - A comprehensive, enterprise-grade internationalization (i18n) management toolkit for JavaScript/TypeScript projects with advanced analysis, validation, and automation features",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -124,22 +124,22 @@
|
|
|
124
124
|
},
|
|
125
125
|
"preferGlobal": true,
|
|
126
126
|
"versionInfo": {
|
|
127
|
-
"version": "1.0.
|
|
128
|
-
"releaseDate": "27/
|
|
129
|
-
"lastUpdated": "27/
|
|
127
|
+
"version": "1.0.5",
|
|
128
|
+
"releaseDate": "27/01/2025",
|
|
129
|
+
"lastUpdated": "27/01/2025",
|
|
130
130
|
"maintainer": "Vladimir Noskov",
|
|
131
131
|
"changelog": "./CHANGELOG.md",
|
|
132
132
|
"documentation": "./README.md",
|
|
133
133
|
"apiReference": "./docs/api/API_REFERENCE.md",
|
|
134
134
|
"majorChanges": [
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"๐
|
|
135
|
+
"๐งน Cleaned up test-specific translation files from user locale directories",
|
|
136
|
+
"๐ง Removed hardcoded validationStep and reportGenerator keys from i18ntk-complete.js",
|
|
137
|
+
"๐ Moved npm test reports to dev/debug/reports directory for better organization",
|
|
138
|
+
"โ
Fixed syntax error in i18ntk-complete.js after key removal",
|
|
139
|
+
"๐ก๏ธ Prevented pollution of user systems with non-applicable translation files",
|
|
140
|
+
"๐ฏ Ensured only essential files (auth.json, common.json, pagination.json) remain in locales",
|
|
141
|
+
"๐ Enhanced system cleanliness and prevented test artifacts in production",
|
|
142
|
+
"๐ Updated documentation to reflect cleanup and organizational improvements"
|
|
143
143
|
],
|
|
144
144
|
"breakingChanges": [],
|
|
145
145
|
"deprecations": [],
|
package/utils/i18n-helper.js
CHANGED
|
@@ -13,6 +13,7 @@ function getConfig() {
|
|
|
13
13
|
// Global translations object
|
|
14
14
|
let translations = {};
|
|
15
15
|
let currentLanguage = 'en';
|
|
16
|
+
let isInitialized = false;
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Load translations from the ui-locales directory
|
|
@@ -28,6 +29,7 @@ function loadTranslations(language = 'en') {
|
|
|
28
29
|
if (fs.existsSync(translationFile)) {
|
|
29
30
|
const content = fs.readFileSync(translationFile, 'utf8');
|
|
30
31
|
translations = JSON.parse(content);
|
|
32
|
+
isInitialized = true;
|
|
31
33
|
} else {
|
|
32
34
|
console.warn(`Translation file not found: ${translationFile}`);
|
|
33
35
|
translations = {};
|
|
@@ -45,6 +47,12 @@ function loadTranslations(language = 'en') {
|
|
|
45
47
|
* @returns {string} - Translated string or the key if translation not found
|
|
46
48
|
*/
|
|
47
49
|
function t(key, params = {}) {
|
|
50
|
+
// Auto-initialize translations if not already loaded
|
|
51
|
+
if (!isInitialized) {
|
|
52
|
+
loadTranslations('en');
|
|
53
|
+
isInitialized = true;
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
// Split the key into parts (e.g., 'module.subkey' -> ['module', 'subkey'])
|
|
49
57
|
const keyParts = key.split('.');
|
|
50
58
|
let value = translations;
|
package/utils/security.js
CHANGED
|
@@ -264,7 +264,8 @@ class SecurityUtils {
|
|
|
264
264
|
'sourceDir', 'outputDir', 'defaultLanguage', 'supportedLanguages',
|
|
265
265
|
'filePattern', 'excludePatterns', 'reportFormat', 'logLevel',
|
|
266
266
|
'i18nDir', 'sourceLanguage', 'excludeDirs', 'includeExtensions',
|
|
267
|
-
'translationPatterns', 'notTranslatedMarker', 'excludeFiles', 'strictMode'
|
|
267
|
+
'translationPatterns', 'notTranslatedMarker', 'excludeFiles', 'strictMode',
|
|
268
|
+
'uiLanguage'
|
|
268
269
|
];
|
|
269
270
|
|
|
270
271
|
for (const [key, value] of Object.entries(config)) {
|
|
@@ -227,7 +227,13 @@ class SystemTester {
|
|
|
227
227
|
recommendations: this.generateRecommendations()
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
// Ensure the reports directory exists
|
|
231
|
+
const reportsDir = path.join(__dirname, '..', 'dev', 'debug', 'reports');
|
|
232
|
+
if (!fs.existsSync(reportsDir)) {
|
|
233
|
+
fs.mkdirSync(reportsDir, { recursive: true });
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const reportPath = path.join(reportsDir, 'test-report.json');
|
|
231
237
|
fs.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
232
238
|
this.logSuccess(`Report saved to ${reportPath}`);
|
|
233
239
|
}
|