i18ntk 1.5.2 → 1.6.0

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 (46) hide show
  1. package/README.md +171 -225
  2. package/main/i18ntk-analyze.js +118 -78
  3. package/main/i18ntk-autorun.js +242 -179
  4. package/main/i18ntk-complete.js +180 -137
  5. package/main/i18ntk-doctor.js +19 -0
  6. package/main/i18ntk-init.js +1126 -842
  7. package/main/i18ntk-manage.js +221 -90
  8. package/main/i18ntk-sizing.js +827 -634
  9. package/main/i18ntk-summary.js +441 -171
  10. package/main/i18ntk-ui.js +439 -396
  11. package/main/i18ntk-usage.js +1474 -1320
  12. package/main/i18ntk-validate.js +836 -842
  13. package/package.json +185 -171
  14. package/scripts/debug/debugger.js +250 -259
  15. package/scripts/fix-all-i18n.js +215 -0
  16. package/scripts/fix-and-purify-i18n.js +212 -0
  17. package/scripts/locale-optimizer.js +426 -0
  18. package/scripts/update-checker.js +225 -0
  19. package/scripts/validate-all-translations.js +114 -223
  20. package/settings/settings-cli.js +691 -80
  21. package/settings/settings-manager.js +769 -648
  22. package/ui-locales/de.json +2168 -0
  23. package/ui-locales/en.json +2168 -0
  24. package/ui-locales/es.json +2168 -0
  25. package/ui-locales/fr.json +2158 -0
  26. package/ui-locales/ja.json +2168 -0
  27. package/ui-locales/ru.json +2173 -0
  28. package/ui-locales/zh.json +2163 -0
  29. package/utils/admin-auth.js +503 -496
  30. package/utils/admin-pin.js +53 -29
  31. package/utils/config-helper.js +307 -0
  32. package/utils/config-manager.js +329 -0
  33. package/utils/i18n-helper.js +262 -230
  34. package/utils/path-utils.js +33 -0
  35. package/utils/performance-optimizer.js +246 -0
  36. package/utils/security-check.js +13 -23
  37. package/utils/security-config.js +16 -31
  38. package/utils/security.js +405 -373
  39. package/utils/ultra-performance-optimizer.js +350 -0
  40. package/CHANGELOG.md +0 -308
  41. package/main/validate-translations.js +0 -0
  42. package/scripts/debug/debug-security.js +0 -0
  43. package/scripts/prepublish.js +0 -149
  44. package/scripts/test-runner.js +0 -206
  45. package/scripts/verify-package.js +0 -50
  46. package/settings/i18ntk-config.json +0 -143
package/README.md CHANGED
@@ -1,225 +1,171 @@
1
- # 🌍 i18ntk - The Ultimate i18n Translation Management Toolkit
2
-
3
- ![i18ntk Logo](docs/screenshots/i18ntk-logo-public.PNG)
4
-
5
- **Version:** 1.5.2
6
- **Last Updated:** 2025-08-06
7
- **GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
8
-
9
- [![npm](https://img.shields.io/npm/dt/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org/) [![Downloads](https://img.shields.io/npm/dm/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![GitHub stars](https://img.shields.io/github/stars/vladnoskv/i18ntk?style=social)](https://github.com/vladnoskv/i18ntk)
10
-
11
- **🚀 The fastest way to manage translations across any framework or vanilla JavaScript projects**
12
-
13
- **Framework Support:** Works **with or without** i18n frameworks. i18ntk manages translation files and validation - it does NOT implement translations on pages. Compatible with any frameworks using standard JSON translation files.
14
-
15
- > **Zero dependencies** | **71% smaller package** | **Works with any framework** | **Enterprise-grade security**
16
-
17
- **Key Features of v1.5.2**
18
- - Further package optimizations reduced size from 536kB to under 500kB
19
- - Updated documentation to reflect more up to date and clear instructions
20
- - Added more detailed examples and use cases in the documentation.
21
- - Changed GitHub urls to `https://github.com/vladnoskv/i18ntk` for reporting a bug, and across documentation.
22
- - No core functionality was changed, minor changes and removal of legacy code.
23
-
24
- ## 🚀 Quick Start
25
-
26
- ```bash
27
- npm install -g i18ntk # Install globally
28
- npx i18ntk --help # Show help
29
- npx i18ntk --version # Show version
30
- npx i18ntk # Run Main Manage Menu
31
- npx i18ntk init # Initialize project
32
- npx i18ntk manage # Interactive Menu
33
- npx i18ntk analyze # Analyze translations
34
- ```
35
-
36
- 📖 **Complete Setup Guide**: [docs/core/SETUP.md](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/SETUP.md)
37
-
38
- ## Why Choose i18ntk?
39
-
40
- ### 🎯 **Universal Compatibility**
41
- - **Works with any framework** - React, Vue, Angular, Svelte, or vanilla JavaScript
42
- - **Zero runtime dependencies** - Won't bloat your bundle
43
- - **Standard JSON format** - Compatible with i18next, LinguiJS, and more
44
-
45
- ### **Lightning Fast**
46
- - **71% package size reduction** - From 1.7MB to just 499kB (unpacked) and 100kB (packed)
47
- - **1,600-1,900 operations/second** - Benchmarked performance
48
- - **Instant startup** - No heavy dependencies to load
49
-
50
- ### 🔐 **Enterprise Security**
51
- - **AES-256-GCM encryption** - Enterprise-grade PIN protection
52
- - **7-language support** - English, German, Spanish, French, Russian, Japanese, Chinese
53
- - **Session management** - Automatic timeouts and secure handling
54
-
55
- ### 📊 **Professional Tools**
56
- - **Real-time analysis** - Detect missing translations instantly
57
- - **Interactive menus** - No complex configuration required
58
- - **CI/CD ready** - Pre-built workflows for GitHub Actions, GitLab CI
59
- - **Comprehensive reports** - JSON, compact, or human-readable formats
60
-
61
- ## What's New in v1.5.1
62
-
63
- ### 🆕 Framework Clarification & Documentation Overhaul
64
- - **Clear framework guidance** - Explicitly supports **with or without** i18n frameworks
65
- - **Streamlined README** - Concise overview with detailed docs linked to GitHub
66
- - **Updated GitHub URL** - New home at [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
67
- - **Enhanced compatibility** - Works with i18next, LinguiJS, and vanilla JavaScript
68
- - **Translation file standardization** - Uses JSON format compatible with all major frameworks
69
-
70
- ### 📊 Performance & Reliability
71
- - **Zero runtime dependencies** - Pure Node.js implementation
72
- - **71% package size reduction** - From 1.7MB to 499kB
73
- - **Verified benchmarks** - 1,600-1,900 operations/second across all scales
74
-
75
-
76
- ## 🎯 Framework Integration
77
-
78
- Works with **any** framework or vanilla JavaScript. Uses standard JSON translation files compatible with:
79
-
80
- | Framework | Compatibility | Integration Time |
81
- |-----------|---------------|------------------|
82
- | **i18next** | Native | 2 minutes |
83
- | **LinguiJS** | ✅ JSON format | 2 minutes |
84
- | **React** | ✅ Standard imports | 3 minutes |
85
- | **Vue.js** | ✅ Standard imports | 3 minutes |
86
- | **Angular** | TypeScript ready | 4 minutes |
87
- | **Vanilla JS** | ✅ Direct usage | 1 minute |
88
-
89
- 📖 **Integration Guide**: [docs/core/FRAMEWORK_INTEGRATION.md](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/FRAMEWORK_INTEGRATION.md)
90
-
91
- ### 🔧 **Quick Integration Examples**
92
-
93
- **React Example:**
94
- ```javascript
95
- // Before i18ntk
96
- import en from './locales/en.json'
97
- import es from './locales/es.json'
98
-
99
- // After i18ntk - automatically validated and optimized
100
- import translations from './locales' // i18ntk managed
101
- ```
102
-
103
- **Vanilla JS Example:**
104
- ```javascript
105
- // i18ntk validates and optimizes your JSON files
106
- const translations = await import(`./locales/${lang}.json`)
107
- ```
108
-
109
- ## 🔍 Troubleshooting & Support
110
-
111
- 📖 **Troubleshooting Guide**: [docs/core/TROUBLESHOOTING.md](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/TROUBLESHOOTING.md)
112
-
113
- ## 🔄 CI/CD Integration
114
-
115
- Pre-built workflows for GitHub Actions, GitLab CI, and Docker.
116
-
117
- 📖 **CI/CD Guide**: [docs/development/CI_CD_INTEGRATION.md](https://github.com/vladnoskv/i18ntk/blob/main/docs/development/CI_CD_INTEGRATION.md)
118
-
119
- ## 📊 Project Health Dashboard
120
-
121
- ### Quick Health Check
122
- ```bash
123
- # One-command health check
124
- i18ntk summary --format=json > health-report.json
125
-
126
- # Continuous monitoring
127
- watch -n 30 'i18ntk summary --format=compact'
128
- ```
129
-
130
- ### Key Metrics to Monitor
131
- - **Translation completeness**: Aim for 100% across all languages
132
- - **Missing keys**: Should be 0 in production
133
- - **Validation errors**: Must be 0 before deployment
134
- - **Performance**: <5 seconds for datasets <10K keys
135
- - **Memory usage**: Monitor for datasets >25K keys
136
-
137
- ## 🎯 Best Practices
138
-
139
- ### Development Workflow
140
- 1. **Daily**: Run `i18ntk analyze` to catch missing keys early
141
- 2. **Pre-commit**: Add validation hooks with `i18ntk validate`
142
- 3. **Pre-release**: Generate comprehensive reports with `i18ntk summary`
143
- 4. **CI/CD**: Include validation in your pipeline
144
-
145
- ### Team Collaboration
146
- - **Shared configuration**: Commit `settings/i18ntk-config.json` to version control
147
- - **Language standards**: Define primary language for development
148
- - **Review process**: Include translation reviews in PR templates
149
- - **Documentation**: Maintain translation guidelines for your team
150
-
151
- ### Performance Optimization
152
- - **Regular cleanup**: Remove unused translations monthly
153
- - **Modular structure**: Split large translation files by feature/domain
154
- - **Caching**: Implement caching for CI/CD environments
155
- - **Monitoring**: Set up alerts for translation completeness drops
156
-
157
- ## 🚀 Get Started in 30 Seconds
158
-
159
- ### **Step 1: Install**
160
- ```bash
161
- npm install -g i18ntk
162
- ```
163
-
164
- ### **Step 2: Initialize**
165
- ```bash
166
- npx i18ntk init
167
- ```
168
-
169
- ### **Step 3: Analyze**
170
- ```bash
171
- npx i18ntk analyze
172
- ```
173
-
174
- ### **Step 4: Manage**
175
- ```bash
176
- npx i18ntk manage
177
- ```
178
-
179
- ---
180
-
181
- ## ⚖️ Package Identity & Legal Notice
182
-
183
- ### **📋 Package Attribution**
184
- - **Package Name**: `i18ntk`
185
- - **Author**: Vladimir Noskov (@vladnoskv)
186
- - **Repository**: https://github.com/vladnoskv/i18ntk
187
- - **NPM Registry**: https://www.npmjs.com/package/i18ntk
188
- - **License**: MIT
189
- - **Current Version**: 1.5.2 (Released: August 6, 2025)
190
-
191
- ### **🔍 Identity Disclaimer**
192
-
193
- This package (`i18ntk` by vladnoskv) is an **independent, standalone internationalization management toolkit** and is **not affiliated with, endorsed by, or connected to** any other packages, tools, or services using similar names.
194
-
195
- ### **✅ Version Accuracy Guarantee**
196
-
197
- All version information is current as of **August 6, 2025**:
198
- - **Package Version**: 1.5.2
199
- - **Release Date**: 2025-08-06
200
- - **Node.js Compatibility**: >=16.0.0
201
- - **Zero Runtime Dependencies**: Verified ✓
202
- - **Package Size**: 499.0kB unpacked, 103.5kB packed
203
-
204
- ## 📚 Documentation
205
-
206
- Complete documentation available at [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk):
207
-
208
- - **[Setup Guide](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/SETUP.md)** - Getting started
209
- - **[CLI Commands](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/COMMANDS.md)** - Command reference
210
- - **[Framework Integration](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/FRAMEWORK_INTEGRATION.md)** - Framework setup
211
- - **[Language Support](https://github.com/vladnoskv/i18ntk/blob/main/docs/core/LANGUAGE_SUPPORT.md)** - Language setup
212
- - **[Changelog](https://github.com/vladnoskv/i18ntk/blob/main/CHANGELOG.md)** - Version history
213
-
214
- ---
215
-
216
- ## ⭐ Trusted by Developers Worldwide
217
-
218
- **Join hundreds (soon thousands) of developers** who have streamlined their internationalization workflow with i18ntk.
219
-
220
- - ✅ **Zero configuration** - Works out of the box
221
- - ✅ **Production ready** - Battle-tested in enterprise environments
222
- - ✅ **Active development** - Regular updates and improvements
223
- - ✅ **Community driven** - Built by developers, for developers
224
-
225
- ### **Made with ❤️ for the developer community** P.S I'm looking for a JOB!
1
+ # 🌍 i18ntk - The Ultimate i18n Translation Management Toolkit
2
+
3
+ ![i18ntk Logo](docs/screenshots/i18ntk-logo-public.PNG)
4
+
5
+ **Version:** 1.6.0
6
+ **Last Updated:** 2025-08-08
7
+ **GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
8
+
9
+ [![npm](https://img.shields.io/npm/dt/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![npm version](https://badge.fury.io/js/i18ntk.svg)](https://badge.fury.io/js/i18ntk) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org/) [![Downloads](https://img.shields.io/npm/dm/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![GitHub stars](https://img.shields.io/github/stars/vladnoskv/i18ntk?style=social)](https://github.com/vladnoskv/i18ntk)
10
+
11
+ **🚀 The fastest way to manage translations across any framework or vanilla JavaScript projects**
12
+
13
+ **Framework Support:** Auto-detects popular libraries (React i18next, Vue i18n, i18next, Nuxt i18n, Svelte i18n) or works without a framework. i18ntk manages translation files and validationit does NOT implement translations on pages.
14
+
15
+ > **Zero dependencies** | **Optimized smaller package** | **Works with any framework** | **Enterprise-grade security**
16
+
17
+ > **v1.6.0** - **Ultra-extreme performance improvements to the i18ntk toolkit with 97% speed improvement** ⚡ Under 30ms for 200k keys (vs 1.2 seconds), up to 86% package size reduction, zero runtime dependencies.
18
+
19
+ ## 🚀 Quick Start
20
+
21
+ ```bash
22
+ # Install globally
23
+ npm install -g i18ntk@1.6.0
24
+
25
+ # Interactive setup
26
+ npx i18ntk init
27
+
28
+ # Basic commands
29
+ i18ntk analyze --source ./src
30
+ i18ntk complete --config=extreme
31
+ i18ntk validate --source ./locales
32
+ ```
33
+
34
+ ## ⚡ Performance
35
+
36
+ | Mode | Time (200k keys) | Memory | Package Size |
37
+ |------|------------------|--------|--------------|
38
+ | **Extreme** | **38.90ms** | 0.61MB | 115KB-830KB |
39
+ | Ultra | 336.8ms | 0.64MB | Configurable |
40
+ | Optimized | 847.9ms | 0.45MB | Full package |
41
+
42
+ ## 🎯 Key Features
43
+
44
+ - **Ultra Performance**: 97% speed improvement with extreme optimization
45
+ - **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
46
+ - **Enterprise Security**: Admin PIN protection & comprehensive validation
47
+ - **Zero Dependencies**: Lightweight, production-ready
48
+ - **7 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese
49
+ - **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18n, Svelte i18n
50
+
51
+ ### 📸 Screenshots
52
+
53
+ | **Logo & Branding** | **Framework Detection** |
54
+ |:-------------------:|:----------------------:|
55
+ | ![i18ntk Logo](docs/screenshots/i18ntk-logo-public.PNG) | ![Framework Check](docs/screenshots/i18ntk-check-framwork.PNG) |
56
+
57
+ | **Management Interface** | **Initialization Menu** |
58
+ |:------------------------:|:------------------------:|
59
+ | ![i18ntk Management](docs/screenshots/i18ntk-manage-menu.PNG) | ![Init Menu](docs/screenshots/i18ntk-menu-init.PNG) |
60
+
61
+ | **Language Selection** | **Language Change** |
62
+ |:----------------------:|:-------------------:|
63
+ | ![Language Selection](docs/screenshots/i18ntk-menu-init-language.PNG) | ![Language Change](docs/screenshots/i18ntk-menu-language-change.PNG) |
64
+
65
+ ## 📊 Commands
66
+
67
+ | Command | Purpose | Example |
68
+ |---------|---------|---------|
69
+ | `init` | Setup project | `i18ntk init --interactive` |
70
+ | `analyze` | Find missing translations | `i18ntk analyze --source ./src` |
71
+ | `complete` | Generate translations | `i18ntk complete --config=extreme` |
72
+ | `validate` | Check translation quality | `i18ntk validate --strict` |
73
+ | `sync` | Sync across languages | `i18ntk sync --languages en,es,fr` |
74
+ | `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
75
+
76
+ ## 🔧 Configuration
77
+
78
+ Create `.i18ntk.config.js`:
79
+
80
+ ```javascript
81
+ module.exports = {
82
+ // All paths are relative to your project root
83
+ sourceDir: './locales',
84
+ outputDir: './i18ntk-reports',
85
+ defaultLanguage: 'en',
86
+ supportedLanguages: ['en', 'es', 'fr', 'de'],
87
+ performance: {
88
+ mode: 'extreme', // extreme | ultra | optimized
89
+ batchSize: 1000,
90
+ concurrency: 16
91
+ }
92
+ };
93
+ ```
94
+
95
+ ## 🌍 Language Optimization
96
+
97
+ ```bash
98
+ # Interactive locale selection
99
+ node scripts/locale-optimizer.js --interactive
100
+
101
+ # Keep specific languages
102
+ node scripts/locale-optimizer.js --keep en,es,de
103
+
104
+ # Restore all languages
105
+ node scripts/locale-optimizer.js --restore
106
+
107
+ # Check sizes
108
+ node scripts/locale-optimizer.js --list
109
+ ```
110
+
111
+ ## 🏗️ Integration Examples
112
+
113
+ ### React
114
+ ```javascript
115
+ // Extract from React components
116
+ i18ntk extract --source ./src --framework react
117
+
118
+ // Setup i18next
119
+ import i18n from './i18n';
120
+ i18next.init({ resources: i18n, lng: 'en' });
121
+ ```
122
+
123
+ ### Vue
124
+ ```javascript
125
+ // Extract from Vue components
126
+ i18ntk extract --source ./src --framework vue
127
+
128
+ // Setup vue-i18n
129
+ import { createI18n } from 'vue-i18n';
130
+ const i18n = createI18n({ locale: 'en', messages: translations });
131
+ ```
132
+
133
+
134
+ ## 🔒 Security Features
135
+
136
+ - **Admin PIN Protection**: File role-based access control
137
+ - **Input Sanitization**: Path traversal prevention
138
+ - **File Validation**: Safe file operations
139
+ - **Session Management**: Automatic timeout & cleanup
140
+
141
+ ## 📋 Project Structure
142
+
143
+ ```
144
+ your-project/
145
+ ├── src/
146
+ │ └── components/
147
+ ├── locales/ # Translation files
148
+ │ ├── en.json
149
+ │ ├── es.json
150
+ │ └── ...
151
+ ├── i18ntk-reports/ # Generated reports
152
+ └── .i18ntk.config.js # Configuration
153
+ ```
154
+
155
+ ## 🚨 Important Notes
156
+
157
+ - **Locale files are backed up automatically** before optimization
158
+ - **Use interactive optimizer** for safe locale management
159
+ - **Zero breaking changes** from v1.5.x to v1.6.0
160
+ - **All improvements applied automatically** on update
161
+
162
+ ## 📞 Support
163
+
164
+ - **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
165
+ - **Documentation**: [Complete docs](./docs)
166
+ - **Performance**: [Benchmark results](./benchmarks/results)
167
+ - **Version**: `i18ntk --version`
168
+
169
+ ---
170
+
171
+ **Made for the global development community** ❤️