i18ntk 1.2.2 → 1.3.1

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +75 -2
  2. package/LICENSE +3 -1
  3. package/README.md +48 -47
  4. package/docs/README.md +42 -19
  5. package/docs/SCRIPT_DIRECTORY_GUIDE.md +278 -0
  6. package/docs/release-notes/v1.3.0.md +162 -0
  7. package/docs/release-notes/v1.3.1.md +136 -0
  8. package/main/i18ntk-analyze.js +14 -6
  9. package/main/i18ntk-autorun.js +37 -36
  10. package/main/i18ntk-complete.js +9 -5
  11. package/main/i18ntk-init.js +16 -12
  12. package/main/i18ntk-manage.js +6 -4
  13. package/main/i18ntk-sizing.js +12 -12
  14. package/main/i18ntk-summary.js +6 -2
  15. package/main/i18ntk-usage.js +5 -5
  16. package/main/i18ntk-validate.js +9 -5
  17. package/package.json +20 -19
  18. package/scripts/copy-translations.js +90 -0
  19. package/settings/i18ntk-config.json +10 -0
  20. package/settings/settings-cli.js +201 -77
  21. package/settings/settings-manager.js +19 -0
  22. package/ui-locales/de/autorun.json +69 -64
  23. package/ui-locales/de/common.json +14 -1
  24. package/ui-locales/de/errors.json +11 -1
  25. package/ui-locales/de/menu.json +10 -1
  26. package/ui-locales/de/operations.json +11 -0
  27. package/ui-locales/de/security.json +2 -1
  28. package/ui-locales/de/settings.json +67 -9
  29. package/ui-locales/de/sizing.json +14 -1
  30. package/ui-locales/de/status.json +18 -1
  31. package/ui-locales/de/test-complete-system.json +13 -1
  32. package/ui-locales/en/autorun.json +68 -65
  33. package/ui-locales/en/common.json +15 -1
  34. package/ui-locales/en/init.json +20 -5
  35. package/ui-locales/en/menu.json +1 -0
  36. package/ui-locales/en/operations.json +11 -1
  37. package/ui-locales/en/settings.json +158 -35
  38. package/ui-locales/en/validate.json +1 -0
  39. package/ui-locales/es/autorun.json +68 -65
  40. package/ui-locales/es/common.json +14 -1
  41. package/ui-locales/es/errors.json +11 -1
  42. package/ui-locales/es/menu.json +10 -1
  43. package/ui-locales/es/operations.json +11 -0
  44. package/ui-locales/es/security.json +2 -1
  45. package/ui-locales/es/settings.json +60 -9
  46. package/ui-locales/es/sizing.json +14 -1
  47. package/ui-locales/es/status.json +18 -1
  48. package/ui-locales/es/test-complete-system.json +13 -1
  49. package/ui-locales/fr/autorun.json +69 -64
  50. package/ui-locales/fr/common.json +14 -1
  51. package/ui-locales/fr/errors.json +11 -1
  52. package/ui-locales/fr/menu.json +10 -1
  53. package/ui-locales/fr/operations.json +11 -0
  54. package/ui-locales/fr/security.json +2 -1
  55. package/ui-locales/fr/settings.json +60 -9
  56. package/ui-locales/fr/sizing.json +14 -1
  57. package/ui-locales/fr/status.json +18 -1
  58. package/ui-locales/fr/test-complete-system.json +13 -1
  59. package/ui-locales/ja/autorun.json +69 -64
  60. package/ui-locales/ja/common.json +14 -1
  61. package/ui-locales/ja/errors.json +11 -1
  62. package/ui-locales/ja/menu.json +10 -1
  63. package/ui-locales/ja/operations.json +11 -0
  64. package/ui-locales/ja/security.json +2 -1
  65. package/ui-locales/ja/settings.json +60 -9
  66. package/ui-locales/ja/sizing.json +14 -1
  67. package/ui-locales/ja/status.json +18 -1
  68. package/ui-locales/ja/test-complete-system.json +13 -1
  69. package/ui-locales/pt/analyze.json +2 -1
  70. package/ui-locales/pt/autorun.json +69 -64
  71. package/ui-locales/pt/common.json +14 -1
  72. package/ui-locales/pt/errors.json +11 -1
  73. package/ui-locales/pt/init.json +5 -1
  74. package/ui-locales/pt/menu.json +10 -1
  75. package/ui-locales/pt/operations.json +11 -0
  76. package/ui-locales/pt/security.json +2 -1
  77. package/ui-locales/pt/settings.json +60 -9
  78. package/ui-locales/pt/sizing.json +14 -1
  79. package/ui-locales/pt/status.json +18 -1
  80. package/ui-locales/pt/test-complete-system.json +13 -1
  81. package/ui-locales/ru/autorun.json +69 -64
  82. package/ui-locales/ru/common.json +14 -1
  83. package/ui-locales/ru/errors.json +11 -1
  84. package/ui-locales/ru/menu.json +10 -1
  85. package/ui-locales/ru/operations.json +11 -0
  86. package/ui-locales/ru/security.json +2 -1
  87. package/ui-locales/ru/settings.json +60 -9
  88. package/ui-locales/ru/sizing.json +14 -1
  89. package/ui-locales/ru/status.json +18 -1
  90. package/ui-locales/ru/test-complete-system.json +13 -1
  91. package/ui-locales/zh/autorun.json +69 -64
  92. package/ui-locales/zh/common.json +14 -1
  93. package/ui-locales/zh/errors.json +11 -1
  94. package/ui-locales/zh/menu.json +10 -1
  95. package/ui-locales/zh/operations.json +11 -0
  96. package/ui-locales/zh/security.json +2 -1
  97. package/ui-locales/zh/settings.json +67 -9
  98. package/ui-locales/zh/sizing.json +13 -1
  99. package/ui-locales/zh/status.json +25 -8
  100. package/ui-locales/zh/test-complete-system.json +13 -1
  101. package/utils/test-complete-system.js +178 -162
  102. package/settings/backups/i18ntk-config-backup-2025-08-01T23-38-43-753Z.json +0 -117
  103. package/ui-locales/de-old.json +0 -705
  104. package/ui-locales/de.json +0 -15
  105. package/ui-locales/en-old.json +0 -709
  106. package/ui-locales/en.json +0 -15
  107. package/ui-locales/es-old.json +0 -654
  108. package/ui-locales/es.json +0 -15
  109. package/ui-locales/fr-old.json +0 -606
  110. package/ui-locales/fr.json +0 -15
  111. package/ui-locales/ja-old.json +0 -660
  112. package/ui-locales/ja.json +0 -15
  113. package/ui-locales/pt.json +0 -15
  114. package/ui-locales/ru-old.json +0 -655
  115. package/ui-locales/ru.json +0 -15
  116. package/ui-locales/zh-old.json +0 -647
  117. package/ui-locales/zh.json +0 -15
package/CHANGELOG.md CHANGED
@@ -1,11 +1,84 @@
1
1
  # Changelog
2
2
 
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
3
 
5
- **Current Version:** 1.2.2 (2025-08-02) - **CRITICAL BUG FIX FOR CUSTOM LOCALE SUPPORT** 🚨
4
+ **Current Version:** 1.3.1 (2025-12-2024) - **RESET TO DEFAULT VALUES & ENHANCED SETTINGS CLI** 🔄
5
+
6
+ ### 🆕 New Features
7
+ - **Reset to Default Values**: Added `r) Reset to Default Values` option to settings CLI menu for quick configuration reset
8
+ - **Enhanced Settings CLI**: Improved user experience with clear reset confirmation prompts
9
+ - **Safety Features**: Added confirmation prompt before resetting all directory configurations
10
+
11
+ ### 🔧 Configuration Improvements
12
+ - **One-Click Reset**: Reset all 8 script directory configurations to system defaults
13
+ - **Preserved Functionality**: All existing configurations remain intact until reset is confirmed
14
+ - **Audit Logging**: Reset operations are logged for troubleshooting purposes
15
+
16
+ ### 📋 Menu Enhancement
17
+ - **New Menu Option**: Added `r) Reset to Default Values` alongside existing `b) Back to main menu`
18
+ - **Enhanced Default Handling**: Users can type "default" to restore individual settings to system defaults
19
+ - **User-Specific Defaults**: Defaults adapt to actual project directory structure
20
+ - **Clear Navigation**: Users can now reset configurations without navigating through individual settings
21
+ - **Safe Defaults**: System defaults provide reliable starting points for new projects
22
+
23
+ ### 🔧 Script Output Improvements
24
+ - **Enhanced Script Output**: Added clear display of source directory, source language, and strict mode status at the beginning of analyze and sizing script runs
25
+ - **Absolute Path Display**: Scripts now show resolved absolute paths for better debugging and verification
26
+ - **Improved Sizing Analysis**: Enhanced translation length difference warnings with more actionable guidance and specific recommendations
27
+ - **Configuration Transparency**: Users can immediately see what configuration is being used for each script
28
+
29
+ ---
30
+
31
+ **Previous Version:** 1.3.0 (2025-08-02) - **SCRIPT DIRECTORY CONFIGURATION & PATH RESOLUTION FIXES** 🚀
32
+
33
+ ### 🆕 New Features
34
+ - **Per-Script Directory Configuration**: Added support for custom directory overrides for each script type (analyze, complete, init, manage, sizing, summary, usage, validate)
35
+ - **Enhanced Path Guidance**: Added current working directory display and relative path examples in CLI prompts
36
+ - **Improved Internationalization**: Added comprehensive translation keys for all new configuration options
37
+
38
+ ### 🐛 Bug Fixes
39
+ - **Fixed Path Resolution**: Corrected directory path resolution to properly use relative paths from project root instead of script directory
40
+ - **Fixed Settings Loading**: Scripts now correctly follow configured directory settings instead of defaulting to hardcoded paths
41
+ - **Translation Key Completeness**: Added missing translation keys for new configuration options
42
+
43
+ ### 📁 Configuration Improvements
44
+ - **Custom Script Directories**: Each script can now have its own source directory configured independently
45
+ - **Settings CLI Enhancement**: Added new menu option for configuring script-specific directories
46
+ - **Backward Compatibility**: All existing configurations continue to work without changes
47
+
48
+ ### ⚠️ Deployment Notes
49
+ - **Testing Recommended**: Test on a development branch before deploying to production
50
+ - **No Breaking Changes**: Existing configurations remain compatible
51
+ - **Path Resolution**: Relative paths now resolve correctly from project root directory
52
+
53
+ **Previous Version:** 1.2.3 (2025-08-02) - **KEY USAGE & UPDATE FEATURE**
54
+
55
+ ## [1.2.3] - 2025-08-02
56
+ **⚠️ DEPRECATED:**
57
+ ### 🚀 New Features
58
+ - **Added**: Update package feature to settings CLI for easy `npm update i18ntk`
59
+ - **Enhanced**: Key usage checking now correctly scans directories based on settings
60
+ - **Improved**: Complete coverage scanning ensures all relevant files are processed
61
+
62
+ ### 🐛 Bug Fixes
63
+ - **Fixed**: Key usage and complete coverage tools now respect configured `sourceDir` and `i18nDir`
64
+ - **Fixed**: Removed any potential hardcoded directory paths in key scanning logic
65
+
66
+ ### 🔧 Technical Details
67
+ - **Issue**: Key usage and complete coverage tools were not always respecting user-defined directory settings.
68
+ - **Root Cause**: Inconsistent directory resolution logic in `i18ntk-usage.js` and `i18ntk-complete.js`.
69
+ - **Resolution**: Ensured both tools consistently retrieve `sourceDir` and `i18nDir` from `settingsManager.getSettings()`.
70
+ - **Impact**: Accurate key usage analysis and complete translation coverage based on user configuration.
6
71
 
7
72
  ## [1.2.2] - 2025-08-02
8
73
 
74
+ **⚠️ DEPRECATED:** This version contains a critical bug affecting custom locale directory configuration. Please upgrade to v1.2.3 immediately.
75
+
76
+ ### 🚨 Critical Bug Fix
77
+ - **Fixed**: Resolved `settingsManager.setDirectories is not a function` error when adding custom locale support
78
+ - **Fixed**: Corrected settings management to use proper `getSettings()` and `saveSettings()` methods instead of non-existent `setDirectories()`
79
+ - **Enhanced**: Improved stability when configuring custom translation directories
80
+ - **Fixed**: Directory configuration now properly persists across sessions
81
+
9
82
  ### 🚨 Critical Bug Fix
10
83
  - **Fixed**: Resolved `settingsManager.setDirectories is not a function` error when adding custom locale support
11
84
  - **Fixed**: Corrected settings management to use proper `getSettings()` and `saveSettings()` methods instead of non-existent `setDirectories()`
package/LICENSE CHANGED
@@ -18,4 +18,6 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
22
+
23
+ Last Updated: 02/08/2025
package/README.md CHANGED
@@ -1,21 +1,26 @@
1
- # i18ntk - Enterprise i18n Management Toolkit
1
+ # i18ntk - i18n Management Toolkit
2
2
 
3
- **Version:** 1.2 – **PRODUCTION READY** with enhanced documentation and npm metadata cleanup! 🌍
4
-
5
- **⚠️ Important Notice:** All previous versions (< 1.2) are now deprecated due to critical bugs and issues. Please upgrade to v1.1.5 for the most stable experience. We recommend backing up your project before upgrading.
6
-
7
- **🎉 Thank You:** 200+ downloads in the first week! Thank you for your support and patience as we resolved the functional issues. My First Published Project.
8
-
9
- [![version](https://badge.fury.io/js/i18ntk.svg)](https://badge.fury.io/js/i18ntk)
10
3
  [![npm](https://img.shields.io/npm/dt/i18ntk.svg)](https://www.npmjs.com/package/i18ntk)
11
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org/)
13
6
 
14
- **i18ntk** (i18n Toolkit) is a comprehensive, 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.
7
+ **Version:** 1.3.1 – **i18ntk** (i18n Toolkit) is a comprehensive, 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.
8
+
9
+ ## 🔧 Key Features
10
+
11
+ - **Flexible Configuration**: Customize script directories and file formats in `settings.json`
12
+ - **Path Resolution**: Automatically resolves relative paths based on project structure
13
+ - **Comprehensive Commands**: Includes analyze, complete, manage, validate, and more
14
+ - **Multi-Language Support**: UI available in 7 languages with partial internationalization
15
+ - **Production-Ready**: Tested extensively in various environments
16
+
17
+ **⚠️ Important Notice:** All previous versions (< 1.3.1) are now deprecated due to critical bugs and issues. Please upgrade to v1.3.1 for the most stable experience. We recommend backing up your project before upgrading and testing on a development branch first.
18
+
19
+ **🎉 Thank You:** 500+ downloads in the first week! Thank you for your support and patience as I resolve the functional issues. My First Published Package, please update to the latest version as any previous bugs were probably fixed.
15
20
 
16
21
  ## ⚠️ Important Disclaimer
17
22
 
18
- **Important: This is an independent, community-driven toolkit** - not affiliated with any official i18n organization or team. Originally developed as a personal solution for translation management, i18ntk has evolved into a feature-rich internationalization toolkit available to the broader development community. The toolkit is designed to be framework-agnostic and highly adaptable:
23
+ **Important: This is an independent, community-driven toolkit** generated with the help of AI tools therefore, bugs and errors are prone to happen, please report an issue if you find one. Also, this package is not affiliated with any official i18n organization or team. Originally developed as a personal solution for my own translation management, i18ntk has evolved into a feature-rich internationalization toolkit available to the broader development community. The toolkit is designed to be framework-agnostic and highly adaptable:
19
24
 
20
25
  - Works with any translation file format configured in the settings
21
26
  - Operates independently (no i18n framework required)
@@ -23,7 +28,8 @@
23
28
  - Easily extensible through code modifications or AI-assisted configuration
24
29
  - Flexible enough to accommodate diverse project requirements
25
30
 
26
- While maintaining its independence, i18ntk strives to follow i18n best practices and standards to ensure compatibility with existing workflows. Although we test thoroughly, we cannot guarantee 100% compatibility with all i18n frameworks or systems. Users are encouraged to test i18ntk with their specific setup and adjust settings as needed or find an alternative solution.
31
+ While maintaining its independence, i18ntk strives to follow i18n best practices and standards to ensure compatibility with existing workflows. Although we test thoroughly, we cannot guarantee 100% compatibility with all i18n frameworks or systems and don't accept liability if there are any issues, we recommend running this toolkit on a fresh project. Users are encouraged to test i18ntk with their specific setup and adjust settings as needed or find an alternative solution. Thank you for trying i18ntk, if you have any issues or suggestions, please feel free to open an issue on the GitHub repository!
32
+
27
33
 
28
34
  ## 🚀 Quick Start
29
35
 
@@ -79,23 +85,37 @@ npx i18ntk --version # 📋 Show detailed version information
79
85
  npx i18ntk -v # 📋 Show detailed version information (short flag)
80
86
  ```
81
87
 
82
- **Note:** v1.1.4 is production-ready with full core functionality. Console UI translation support is at approximately 95% with English fallback for missing keys. Core features work flawlessly - only translation completion remains.
83
-
84
88
  **Important:** Direct command execution (e.g., `npx i18ntk usage`) now bypasses the interactive menu, allowing for more streamlined workflows and scripting.
85
89
 
86
- ## ✨ What's New in v1.1.5
90
+ ## ✨ What's New in v1.3.1
87
91
 
88
- ### 🧹 Documentation & Metadata Cleanup
89
- - **Enhanced**: Updated all documentation to reflect current version and best practices
90
- - **Improved**: Cleaned up npm package metadata for better clarity
91
- - **Fixed**: Repository URLs and homepage links in package configuration
92
- - **Updated**: Installation instructions and version references throughout documentation
92
+ ### 🆕 Script Directory Configuration
93
+ - **New**: Added per-script directory configuration support for maximum flexibility
94
+ - **Fixed**: Path resolution now correctly uses relative paths from project root
95
+ - **Enhanced**: Added comprehensive internationalization for all new configuration options
96
+ - **Improved**: Settings CLI now includes script directory configuration menu
97
+ - **Added**: Current working directory display and path guidance in CLI prompts
98
+ - **Reset to Defaults**: New menu option to reset all directory configurations to defaults
93
99
 
94
100
  ### 🐛 Previous Version Deprecation
95
- - **Status**: All versions < 1.1.5 are now deprecated due to critical bugs
96
- - **Recommendation**: Immediate upgrade to v1.1.5 for stable functionality
101
+ - **Status**: All versions < 1.3.1 are now deprecated due to critical bugs
102
+ - **Recommendation**: Immediate upgrade to v1.3.1 for stable functionality
97
103
  - **Migration**: Major-breaking-changes upgrading from any 1.0.x version. Uninstall, and reinstall and rerun initilization.
98
104
 
105
+ ### ⬆️ Update Package Functionality
106
+ - **New Feature**: Added `Update Package` option to the settings CLI for easy `npm update i18ntk` execution.
107
+ - **Convenience**: Simplifies keeping the toolkit up-to-date directly from the interactive menu.
108
+
109
+ ### 🔍 Enhanced Directory Handling
110
+ - **Improvement**: All scripts now correctly scan directories based on settings configurations
111
+ - **Accuracy**: Path resolution fixed to respect relative paths from project root
112
+ - **Bug Fix**: Resolved "Source directory not found" errors with proper path handling
113
+
114
+ ### 🎯 Improved Complete Coverage Scanning
115
+ - **Enhancement**: Complete coverage scanning now accurately handles directory configurations.
116
+ - **Reliability**: Ensures all relevant files are scanned for comprehensive analysis.
117
+ - **Consistency**: Aligns with `i18ntk-usage.js` in respecting `sourceDir` and `i18nDir` settings.
118
+
99
119
  ### 📁 Enhanced Project Organization
100
120
  - **Improved**: Configuration files now properly organized in `settings/` directory
101
121
  - **Enhanced**: All reports centralized in `i18ntk-reports/` directory for better organization
@@ -103,7 +123,7 @@ npx i18ntk -v # 📋 Show detailed version information (short flag)
103
123
  - **Updated**: Documentation reflects new file structure and locations
104
124
 
105
125
  ### 🎉 Community Milestone
106
- - **Achievement**: 200+ downloads in the first week
126
+ - **Achievement**: 500+ downloads in the first week
107
127
  - **Gratitude**: Thank you for your patience as we resolved functional issues
108
128
  - **Commitment**: Continued focus on stability and user experience
109
129
 
@@ -113,6 +133,8 @@ npx i18ntk -v # 📋 Show detailed version information (short flag)
113
133
 
114
134
  **🏠 [Documentation Index](./docs/INDEX.md)** - Quick navigation to all documentation
115
135
 
136
+ **📁 [Script Directory Guide](./docs/SCRIPT_DIRECTORY_GUIDE.md)** - Configure custom directories for each script type (v1.3.0+)
137
+
116
138
  **📊 [Translation Status](./docs/TRANSLATION_STATUS.md)** - Current translation completion status
117
139
 
118
140
  **🔧 [API Reference](./docs/api/API_REFERENCE.md)** - Complete API documentation
@@ -146,25 +168,6 @@ npx i18ntk -v # 📋 Show detailed version information (short flag)
146
168
 
147
169
  > **📖 For detailed setup and usage instructions, see [Documentation](./docs/README.md)**
148
170
 
149
- ## 🛠️ Core Commands
150
-
151
- ### NPM Scripts (Recommended)
152
-
153
- | Command | Description | Direct Usage |
154
- |---------|-------------|-------------|
155
- | `npm run i18ntk` | Interactive management interface | `node main/i18ntk-manage.js` |
156
- | `npm run i18ntk:autorun` | Automated complete workflow | `node main/i18ntk-autorun.js` |
157
- | `npm run i18ntk:init` | Initialize i18n configuration | `node main/i18ntk-init.js` |
158
- | `npm run i18ntk:analyze` | Analyze translation completeness | `node main/i18ntk-analyze.js` |
159
- | `npm run i18ntk:validate` | Validate translation integrity | `node main/i18ntk-validate.js` |
160
- | `npm run i18ntk:complete` | Complete missing translations | `node main/i18ntk-complete.js` |
161
- | `npm run i18ntk:usage` | Analyze translation key usage | `node main/i18ntk-usage.js` |
162
- | `npm run i18ntk:sizing` | Generate sizing reports | `node main/i18ntk-sizing.js` |
163
- | `npm run i18ntk:summary` | Generate summary reports | `node main/i18ntk-summary.js` |
164
- | `npm run i18ntk:debug` | Debug and diagnostics | `node dev/debug/debugger.js` |
165
-
166
- > **📖 For complete command reference, see [API Documentation](./docs/api/API_REFERENCE.md)**
167
-
168
171
  ## 📊 Reports and Analysis
169
172
 
170
173
  The toolkit generates comprehensive reports in the `i18ntk-reports/` directory:
@@ -187,11 +190,6 @@ Requests for additional languages are welcome!
187
190
 
188
191
  ## 🧪 Development and Testing
189
192
 
190
- ### Debug Tools
191
- ```bash
192
- # Main debug interface
193
- npm run i18ntk:debug
194
-
195
193
  > **📖 For comprehensive debug tools documentation, see [Debug Tools](./docs/debug/DEBUG_TOOLS.md)**
196
194
 
197
195
 
@@ -220,7 +218,10 @@ npm run i18ntk:debug
220
218
 
221
219
  ---
222
220
 
223
- **Version:** 1.2.2 – Critical bug fix for custom locale support! 🎯
221
+ **Version:** 1.3.0
222
+ **Release Date:** 02/08/2025
223
+ **Previous Versions:** 1.2.x, 1.1.x, 1.0.x series
224
+
224
225
  ## 📄 License
225
226
 
226
227
  This project is licensed under the MIT License - see the `LICENSE` file for details.
package/docs/README.md CHANGED
@@ -1,19 +1,39 @@
1
1
  # I18N Management Toolkit - Documentation Hub
2
2
 
3
- **Version:** 1.1.5
4
- **Last Updated:** August 2, 2025
3
+ **Version:** 1.3.1
4
+ **Last Updated:** December 2024
5
5
  **Maintainer:** Vladimir Noskov
6
6
 
7
7
  ## ⚠️ Important Disclaimer
8
8
 
9
9
  **This is NOT an official i18n team product or affiliated with any i18n organization.** This toolkit was originally created as a personal project to help manage my own translation files, which was then enhanced with additional features, internationalization support, and made available to the community. It should work with any `en.json` translation files, even without i18n installed, and includes custom logic and settings that can be customized to fit your specific project needs. With simple code modifications or AI-assisted edits, you can easily adapt it to your project's requirements.
10
10
 
11
+ ## 🆕 What's New in v1.3.0
12
+
13
+ ### Major Features
14
+ - **🎯 Per-Script Directory Configuration** - Configure custom directories for each script type
15
+ - **🔧 Fixed Path Resolution** - Analyzing logic now correctly follows settings
16
+ - **🌍 Enhanced Internationalization** - Continued support for global applications
17
+ - **⚙️ Custom Directory Overrides** - Override any script directory via CLI arguments
18
+ - **📋 Improved Settings CLI** - Enhanced configuration management
19
+
20
+ ### Key Benefits
21
+ - **Flexibility**: Use different directory structures for different script types
22
+ - **Reliability**: Path resolution now works correctly with relative paths
23
+ - **Backward Compatibility**: Existing configurations continue to work
24
+ - **Migration Support**: Easy upgrade path from v1.2.x
25
+
26
+ 📖 **[See Script Directory Guide](./SCRIPT_DIRECTORY_GUIDE.md)** for detailed configuration instructions.
27
+
11
28
  ## 📚 Welcome to the Documentation Hub
12
29
 
13
30
  This is your central hub for all I18N Management Toolkit documentation. Whether you're just getting started or looking for advanced configuration options, you'll find everything you need here.
14
31
 
15
32
  ## 🚀 Quick Start
16
33
 
34
+ ### ⚠️ Deployment Warning
35
+ **We do not recommend using on a deployment server without testing on a branch first to see the file changes and process.** Always test v1.3.0 configuration changes in a development environment before production deployment.
36
+
17
37
  ### New to i18ntk?
18
38
  Start with these essential documents:
19
39
 
@@ -92,11 +112,12 @@ docs/reports/
92
112
 
93
113
  ## 🎯 Common Use Cases
94
114
 
95
- ### 🆕 Setting Up a New Project
115
+ ### 🆕 Setting Up a New Project (v1.3.0)
96
116
  1. **[Installation Guide](../INSTALLATION.md)** - Install i18ntk locally (recommended) or globally
97
- 2. **[Initialization](./api/API_REFERENCE.md#i18ntk-init)** - Set up i18n structure (`npx i18ntk init`)
98
- 3. **[Configuration](./api/CONFIGURATION.md#primary-configuration-files)** - Configure for your framework
99
- 4. **[First Analysis](./api/API_REFERENCE.md#i18ntk-analyze)** - Analyze your translations (`npx i18ntk analyze`)
117
+ 2. **[Script Directory Guide](./SCRIPT_DIRECTORY_GUIDE.md)** - Configure custom directories for each script type
118
+ 3. **[Initialization](./api/API_REFERENCE.md#i18ntk-init)** - Set up i18n structure (`npx i18ntk init`)
119
+ 4. **[Configuration](./api/CONFIGURATION.md#primary-configuration-files)** - Configure for your framework
120
+ 5. **[First Analysis](./api/API_REFERENCE.md#i18ntk-analyze)** - Analyze your translations (`npx i18ntk analyze`)
100
121
 
101
122
  ### 🔍 Analyzing Existing Projects
102
123
  1. **[Usage Analysis](./api/API_REFERENCE.md#i18ntk-usage)** - Find unused/missing keys (`npx i18ntk usage`)
@@ -110,11 +131,12 @@ docs/reports/
110
131
  3. **[Debug Tools](./debug/DEBUG_TOOLS.md)** - Troubleshoot issues
111
132
  4. **[Quality Assurance](../README.md#-quality-assurance)** - Ensure 100% coverage
112
133
 
113
- ### 🚀 Production Deployment
114
- 1. **[Final Validation](./api/API_REFERENCE.md#i18ntk-validate)** - Pre-deployment checks (`npx i18ntk validate`)
115
- 2. **[Performance Analysis](./api/API_REFERENCE.md#i18ntk-sizing)** - Optimize bundle size (`npx i18ntk sizing`)
116
- 3. **[Testing](../README.md#-testing)** - Run comprehensive tests
117
- 4. **[Documentation](./api/CONFIGURATION.md)** - Document your setup
134
+ ### 🚀 Production Deployment (v1.3.0)
135
+ 1. **[Script Directory Guide](./SCRIPT_DIRECTORY_GUIDE.md)** - Configure production directory paths
136
+ 2. **[Testing on Branch](./SCRIPT_DIRECTORY_GUIDE.md#testing-your-configuration)** - Test configuration on development branch
137
+ 3. **[Final Validation](./api/API_REFERENCE.md#i18ntk-validate)** - Pre-deployment checks (`npx i18ntk validate`)
138
+ 4. **[Performance Analysis](./api/API_REFERENCE.md#i18ntk-sizing)** - Optimize bundle size (`npx i18ntk sizing`)
139
+ 5. **[Deployment Verification](./SCRIPT_DIRECTORY_GUIDE.md#migration-guide)** - Verify all scripts work correctly
118
140
 
119
141
  ## 🌍 Language Support
120
142
 
@@ -182,14 +204,15 @@ For enterprise support, custom integrations, or consulting services, please cont
182
204
  ## 🔄 Version History
183
205
 
184
206
  ### Recent Releases
185
- - **[v1.1.5](../CHANGELOG.md)** - Documentation & Metadata Cleanup (Current)
186
- - **[v1.1.4](../CHANGELOG.md)** - Internationalization Completion **(DEPRECATED)**
187
- - **[v1.1.3](../CHANGELOG.md)** - Translation System Enhancement **(DEPRECATED)**
188
- - **[v1.1.2](../CHANGELOG.md)** - Enhanced CLI Experience **(DEPRECATED)**
189
- - **[v1.1.1](../CHANGELOG.md)** - Interactive Menu & Locale Fixes **(DEPRECATED)**
190
- - **[v1.1.0](../CHANGELOG.md)** - Enhanced CLI & Non-Interactive Mode **(DEPRECATED)**
191
-
192
- **⚠️ Note:** All versions < 1.1.5 are deprecated. Please upgrade immediately.
207
+ - **[v1.3.1](../CHANGELOG.md)** - Reset to default values option & Enhanced settings CLI (Current)
208
+ - **[v1.3.0](../CHANGELOG.md)** - Script Directory Configuration & Path Resolution Fixes
209
+ - **[v1.2.3](../CHANGELOG.md)** - Documentation & Metadata Cleanup **(DEPRECATED)**
210
+ - **[v1.1.5](../CHANGELOG.md)** - Internationalization Completion **(DEPRECATED)**
211
+ - **[v1.1.4](../CHANGELOG.md)** - Translation System Enhancement **(DEPRECATED)**
212
+ - **[v1.1.3](../CHANGELOG.md)** - Enhanced CLI Experience **(DEPRECATED)**
213
+ - **[v1.1.2](../CHANGELOG.md)** - Interactive Menu & Locale Fixes **(DEPRECATED)**
214
+
215
+ **⚠️ Note:** All versions < 1.3.0 are deprecated. Please upgrade immediately.
193
216
 
194
217
  ### Migration Guides
195
218
  - **[Upgrading to v1.0.0](../RELEASE_NOTES_v1.0.0.md#-migration-guide)** - Seamless upgrade from dev versions
@@ -0,0 +1,278 @@
1
+ # Script Directory Configuration Guide
2
+
3
+ **Version:** 1.3.1
4
+ **Last Updated:** December 2024
5
+
6
+ ## Overview
7
+
8
+ Starting with **i18ntk v1.3.0**, we've introduced powerful new features for managing script directories and fixed critical path resolution issues. In **v1.3.1**, we've enhanced these features with reset functionality. This guide explains how to configure custom directories for each script type and take advantage of the improved path handling.
9
+
10
+ ## 🆕 New Features in v1.3.0
11
+
12
+ ### 1. Per-Script Directory Configuration
13
+
14
+ Each script type can now have its own source directory configured independently. This allows for maximum flexibility in organizing your i18n files.
15
+
16
+ #### Supported Script Types
17
+ - **analyze** - Translation analysis reports
18
+ - **complete** - Translation completion tool
19
+ - **init** - Project initialization
20
+ - **manage** - Main management interface
21
+ - **sizing** - Translation sizing analysis
22
+ - **summary** - Summary reports
23
+ - **usage** - Usage analysis
24
+ - **validate** - Validation checks
25
+
26
+ ### 2. Fixed Path Resolution
27
+
28
+ We've corrected how relative paths are resolved to ensure they always work from your project root directory, eliminating the "Source directory not found" errors.
29
+
30
+ ## Configuration Methods
31
+
32
+ ### Method 1: Settings CLI (Recommended)
33
+
34
+ ```bash
35
+ # Launch the interactive settings manager
36
+ node main/i18ntk-manage.js --command=settings
37
+
38
+ # Or directly
39
+ node settings/settings-cli.js
40
+ ```
41
+
42
+ Navigate to **"Script Directory Configuration"** to configure individual directories for each script type. In v1.3.1, you can now reset any directory to its default value using the new reset option.
43
+
44
+ #### Configuration Menu
45
+
46
+ When running the settings CLI, you'll see this menu:
47
+
48
+ ```
49
+ Enter new value (or press Enter to keep current):
50
+ 1) Analyze Script Directories
51
+ Current: /src/i18n/locales/test/
52
+ 2) Complete Setup Directories
53
+ Current: (not set)
54
+ 3) Initialize Script Directories
55
+ Current: (not set)
56
+ 4) Manage Script Directories
57
+ Current: (not set)
58
+ 5) Sizing Script Directories
59
+ Current: (not set)
60
+ 6) Summary Report Directories
61
+ Current: (not set)
62
+ 7) Usage Report Directories
63
+ Current: (not set)
64
+ 8) Validate Script Directories
65
+ Current: (not set)
66
+
67
+ b) Back to main menu
68
+ r) Reset to Default Values
69
+
70
+ Select setting to edit (or b for back, r for reset):
71
+ ```
72
+
73
+ #### Reset to Default Values
74
+
75
+ **New in v1.3.1**: You can now reset all directory configurations to their default values with a single option. When you select `r) Reset to Default Values`, the toolkit will:
76
+
77
+ - Reset all custom directory paths to their system defaults
78
+ - Clear any custom configurations you've set
79
+ - Restore the original directory structure
80
+ - Provide a confirmation prompt before proceeding
81
+
82
+ #### Using Default Values
83
+
84
+ Instead of leaving fields empty (which isn't possible after changes), you can now type `default` to restore individual settings to their default values. The defaults are based on your user directory settings:
85
+
86
+ - **Type "default"**: Use system default directory paths
87
+ - **Custom paths**: Any valid directory path will override defaults
88
+ - **Global settings**: Defaults respect your global project directory configuration
89
+
90
+ This approach provides:
91
+ - **Granular control**: Reset individual directories without affecting others
92
+ - **User-specific defaults**: Defaults adapt to your project structure
93
+ - **Better UX**: Clear "default" keyword instead of ambiguous empty inputs
94
+
95
+ ### Method 2: Manual Configuration
96
+
97
+ Edit your settings file (`settings/settings.json`) to add custom directory configurations:
98
+
99
+ ```json
100
+ {
101
+ "scriptDirectories": {
102
+ "analyze": "./src/i18n/locales",
103
+ "complete": "./translations",
104
+ "init": "./locales",
105
+ "manage": "./i18n/locales",
106
+ "sizing": "./src/i18n/sizing",
107
+ "summary": "./reports/i18n",
108
+ "usage": "./src/i18n/usage",
109
+ "validate": "./src/i18n/locales"
110
+ },
111
+ "sourceDir": "./locales"
112
+ }
113
+ ```
114
+
115
+ ### Method 3: CLI Arguments
116
+
117
+ Use command-line arguments to override directories for specific runs:
118
+
119
+ ```bash
120
+ # Override source directory for analyze
121
+ node main/i18ntk-analyze.js --source-dir=./src/i18n/locales
122
+
123
+ # Override for complete
124
+ node main/i18ntk-complete.js --source-dir=./translations
125
+ ```
126
+
127
+ ## Path Resolution Priority
128
+
129
+ The toolkit uses the following priority order for determining source directories:
130
+
131
+ 1. **CLI Arguments** (`--source-dir`) - Highest priority
132
+ 2. **Script-Specific Configuration** (`scriptDirectories.<script>`)
133
+ 3. **Global Configuration** (`sourceDir`)
134
+ 4. **Default Directory** (`./locales`) - Lowest priority
135
+
136
+ ## Usage Examples
137
+
138
+ ### Example 1: Multi-Directory Setup
139
+
140
+ Organize your i18n files across multiple directories:
141
+
142
+ ```
143
+ project/
144
+ ├── src/
145
+ │ └── i18n/
146
+ │ ├── locales/ # Main translations
147
+ │ ├── admin-locales/ # Admin interface translations
148
+ │ └── public-locales/ # Public-facing translations
149
+ ├── legacy/
150
+ │ └── translations/ # Legacy translation files
151
+ └── settings/
152
+ └── settings.json
153
+ ```
154
+
155
+ Configuration:
156
+
157
+ ```json
158
+ {
159
+ "scriptDirectories": {
160
+ "analyze": "./src/i18n/locales",
161
+ "complete": "./legacy/translations",
162
+ "manage": "./src/i18n/admin-locales"
163
+ }
164
+ }
165
+ ```
166
+
167
+ ### Example 2: Development vs Production
168
+
169
+ Use different directories for development and production:
170
+
171
+ ```json
172
+ {
173
+ "scriptDirectories": {
174
+ "analyze": "./src/i18n/dev-locales",
175
+ "validate": "./src/i18n/prod-locales"
176
+ }
177
+ }
178
+ ```
179
+
180
+ ## Path Guidance Features
181
+
182
+ ### Current Working Directory Display
183
+
184
+ The settings CLI now displays your current working directory and provides helpful hints:
185
+
186
+ ```
187
+ 📁 Current directory: /home/user/myproject
188
+ 💡 Tip: Use relative paths like "./src/i18n/locales" or "../translations"
189
+ ```
190
+
191
+ ### Relative Path Examples
192
+
193
+ - ✅ `./src/i18n/locales` - Relative to project root
194
+ - ✅ `../translations` - Relative to parent directory
195
+ - ✅ `/absolute/path/to/locales` - Absolute path
196
+ - ❌ `src/i18n/locales` - Missing `./` prefix (may cause issues)
197
+
198
+ ## Migration Guide
199
+
200
+ ### From v1.2.x to v1.3.0
201
+
202
+ 1. **No Breaking Changes**: Your existing configurations will continue to work
203
+ 2. **Optional Upgrade**: The new features are opt-in
204
+ 3. **Path Resolution**: Existing relative paths will now work correctly
205
+
206
+ ### Testing Your Configuration
207
+
208
+ Before deploying to production, test your configuration:
209
+
210
+ ```bash
211
+ # Test with a specific directory
212
+ node main/i18ntk-analyze.js --source-dir=./test-locales --dry-run
213
+
214
+ # Verify all scripts work with your new configuration
215
+ npm run i18ntk:settings
216
+ ```
217
+
218
+ ## Internationalization Support
219
+
220
+ All new configuration options are fully internationalized with support for:
221
+ - English (en)
222
+ - German (de)
223
+ - Spanish (es)
224
+ - French (fr)
225
+ - Portuguese (pt)
226
+ - Russian (ru)
227
+ - Japanese (ja)
228
+ - Chinese (zh)
229
+
230
+ ## Troubleshooting
231
+
232
+ ### Common Issues
233
+
234
+ 1. **"Source directory not found"**
235
+ - Ensure the directory exists
236
+ - Use relative paths from project root
237
+ - Check file permissions
238
+
239
+ 2. **Settings not applied**
240
+ - Verify `scriptDirectories` configuration in settings.json
241
+ - Check for syntax errors in JSON
242
+ - Ensure settings file is in the correct location
243
+
244
+ 3. **CLI arguments not working**
245
+ - Use the correct argument format: `--source-dir=./path`
246
+ - Ensure no spaces around the equals sign
247
+
248
+ ### Debug Commands
249
+
250
+ ```bash
251
+ # Check current settings
252
+ node settings/settings-cli.js --show
253
+
254
+ # Test path resolution
255
+ node main/i18ntk-analyze.js --source-dir=./test-path --dry-run
256
+
257
+ # Validate configuration
258
+ node main/i18ntk-validate.js --config-only
259
+ ```
260
+
261
+ ## Best Practices
262
+
263
+ 1. **Use Relative Paths**: Always use relative paths from project root for portability
264
+ 2. **Test Before Deploying**: Always test directory configurations on a development branch
265
+ 3. **Document Your Setup**: Keep a record of your directory structure and configurations
266
+ 4. **Use Version Control**: Commit your settings.json to version control for team consistency
267
+ 5. **Backup Settings**: Create backups before making significant configuration changes
268
+
269
+ ## Support
270
+
271
+ For issues or questions:
272
+ - Check the [troubleshooting section](#troubleshooting)
273
+ - Review the [CHANGELOG.md](../CHANGELOG.md)
274
+ - Open an issue on [GitHub](https://github.com/vladnoskv/i18n-management-toolkit-main/issues)
275
+
276
+ ---
277
+
278
+ *This guide is part of i18ntk v1.3.0. For previous versions, see the [documentation](../docs/).*