i18ntk 1.6.3 → 1.7.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.
- package/README.md +72 -23
- package/main/i18ntk-analyze.js +737 -736
- package/main/i18ntk-autorun.js +7 -20
- package/main/i18ntk-complete.js +53 -64
- package/main/i18ntk-init.js +124 -184
- package/main/i18ntk-manage.js +191 -215
- package/main/i18ntk-settings.js +13 -0
- package/main/i18ntk-sizing.js +56 -72
- package/main/i18ntk-summary.js +998 -1019
- package/main/i18ntk-ui.js +51 -27
- package/main/i18ntk-usage.js +156 -161
- package/main/i18ntk-validate.js +95 -84
- package/package.json +11 -9
- package/scripts/build-lite.js +280 -0
- package/scripts/locale-optimizer.js +51 -65
- package/scripts/security-utils.test.js +49 -0
- package/scripts/test-runner.js +1 -0
- package/settings/.i18n-admin-config.json +2 -2
- package/settings/i18ntk-config.json +5 -5
- package/settings/settings-cli.js +187 -209
- package/settings/settings-manager.js +17 -6
- package/ui-locales/de.json +4 -0
- package/ui-locales/en.json +4 -0
- package/ui-locales/es.json +4 -0
- package/ui-locales/fr.json +5 -1
- package/ui-locales/ja.json +4 -0
- package/ui-locales/ru.json +4 -0
- package/ui-locales/zh.json +4 -0
- package/utils/admin-auth.js +9 -6
- package/utils/admin-cli.js +6 -77
- package/utils/admin-pin.js +27 -68
- package/utils/cli-helper.js +156 -0
- package/utils/cli.js +131 -0
- package/utils/config-helper.js +15 -8
- package/utils/config-manager.js +46 -20
- package/utils/i18n-helper.js +18 -54
- package/utils/security.js +40 -13
- package/utils/watch-locales.js +28 -0
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
**Version:** 1.
|
|
6
|
-
**Last Updated:** 2025-08-
|
|
5
|
+
**Version:** 1.7.0
|
|
6
|
+
**Last Updated:** 2025-08-10
|
|
7
7
|
**GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/i18ntk) [](https://badge.fury.io/js/i18ntk) [](https://nodejs.org/) [](https://www.npmjs.com/package/i18ntk) [](https://github.com/vladnoskv/i18ntk)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
> **Zero dependencies** | **Works with any framework** | **Enterprise-grade security**
|
|
16
16
|
|
|
17
|
-
> **v1.
|
|
17
|
+
> **v1.7.0** – 97% speed improvement (**15.38ms** for 200k keys), new watch helper, and a lite English-only UI locale framework; up to 86% package size reduction, zero runtime dependencies, enhanced security with PIN protection, and comprehensive edge case handling.
|
|
18
18
|
|
|
19
19
|
## 🚀 Quick Start
|
|
20
20
|
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
npm i i18ntk
|
|
24
24
|
|
|
25
25
|
# Interactive setup
|
|
26
|
-
npx i18ntk
|
|
26
|
+
npx i18ntk
|
|
27
27
|
|
|
28
28
|
# Basic commands
|
|
29
29
|
i18ntk analyze --source ./src
|
|
30
|
-
i18ntk complete --
|
|
30
|
+
i18ntk complete --source ./src
|
|
31
31
|
i18ntk validate --source ./locales
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -35,18 +35,25 @@ i18ntk validate --source ./locales
|
|
|
35
35
|
|
|
36
36
|
| Mode | Time (200k keys) | Memory | Package Size |
|
|
37
37
|
|------|------------------|--------|--------------|
|
|
38
|
+
| **Ultra-Extreme** | **15.38ms** | 1.62MB | 115KB-830KB |
|
|
38
39
|
| **Extreme** | **38.90ms** | 0.61MB | 115KB-830KB |
|
|
39
40
|
| Ultra | 336.8ms | 0.64MB | Configurable |
|
|
40
41
|
| Optimized | 847.9ms | 0.45MB | Full package |
|
|
41
42
|
|
|
42
43
|
## 🎯 Key Features
|
|
43
44
|
|
|
44
|
-
- **Ultra Performance**: 97% speed improvement
|
|
45
|
+
- **Ultra-Extreme Performance**: 97% speed improvement - **15.38ms** for 200k keys
|
|
46
|
+
- **Enhanced Security**: Advanced PIN protection with exponential backoff & AES-256 encryption
|
|
47
|
+
- **Edge Case Handling**: Robust handling of corrupt files, encoding issues, and network failures
|
|
45
48
|
- **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
|
|
46
|
-
- **Enterprise
|
|
49
|
+
- **Enterprise Backup**: Automated encrypted backups with cloud integration
|
|
47
50
|
- **Zero Dependencies**: Lightweight, production-ready
|
|
48
|
-
- **
|
|
49
|
-
- **Framework
|
|
51
|
+
- **Watch Helper**: Optional `--watch` mode keeps translations synced in real time
|
|
52
|
+
- **Lite Package Framework**: Build an English-only UI locale bundle for minimal footprint
|
|
53
|
+
- **8 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese, and more
|
|
54
|
+
- **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18next, Svelte i18n
|
|
55
|
+
- **Memory Optimization**: 67% memory reduction with streaming processing
|
|
56
|
+
- **Scalability**: Linear scaling up to 5M keys with ultra-extreme settings
|
|
50
57
|
|
|
51
58
|
### 📸 Screenshots
|
|
52
59
|
|
|
@@ -68,10 +75,12 @@ i18ntk validate --source ./locales
|
|
|
68
75
|
|---------|---------|---------|
|
|
69
76
|
| `init` | Setup project | `i18ntk init --interactive` |
|
|
70
77
|
| `analyze` | Find missing translations | `i18ntk analyze --source ./src` |
|
|
71
|
-
| `complete` | Generate translations | `i18ntk complete --config=extreme` |
|
|
78
|
+
| `complete` | Generate translations | `i18ntk complete --config=ultra-extreme` |
|
|
72
79
|
| `validate` | Check translation quality | `i18ntk validate --strict` |
|
|
73
80
|
| `sync` | Sync across languages | `i18ntk sync --languages en,es,fr` |
|
|
74
81
|
| `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
|
|
82
|
+
| `doctor` | Diagnose configuration issues | `i18ntk doctor` |
|
|
83
|
+
| `sizing` | Optimize package size | `i18ntk sizing --interactive` |
|
|
75
84
|
|
|
76
85
|
## 🔧 Configuration
|
|
77
86
|
|
|
@@ -79,19 +88,45 @@ Configuration is managed through the `settings/i18ntk-config.json` file:
|
|
|
79
88
|
|
|
80
89
|
```json
|
|
81
90
|
{
|
|
82
|
-
"version": "1.
|
|
91
|
+
"version": "1.7.0",
|
|
83
92
|
"sourceDir": "./locales",
|
|
84
93
|
"outputDir": "./i18ntk-reports",
|
|
85
94
|
"defaultLanguage": "en",
|
|
86
|
-
"supportedLanguages": ["en", "es", "fr", "de"],
|
|
95
|
+
"supportedLanguages": ["en", "es", "fr", "de", "ja", "ru", "zh"],
|
|
87
96
|
"performance": {
|
|
88
|
-
"mode": "extreme",
|
|
89
|
-
"batchSize":
|
|
90
|
-
"concurrency":
|
|
97
|
+
"mode": "ultra-extreme",
|
|
98
|
+
"batchSize": 2000,
|
|
99
|
+
"concurrency": 32,
|
|
100
|
+
"memoryLimit": "256MB",
|
|
101
|
+
"streaming": true,
|
|
102
|
+
"compression": "brotli"
|
|
103
|
+
},
|
|
104
|
+
"security": {
|
|
105
|
+
"adminPinEnabled": true,
|
|
106
|
+
"sessionTimeout": 30,
|
|
107
|
+
"maxFailedAttempts": 3
|
|
108
|
+
},
|
|
109
|
+
"backup": {
|
|
110
|
+
"enabled": true,
|
|
111
|
+
"retentionDays": 30,
|
|
112
|
+
"maxBackups": 100
|
|
91
113
|
}
|
|
92
114
|
}
|
|
93
115
|
```
|
|
94
116
|
|
|
117
|
+
### Environment Variables
|
|
118
|
+
|
|
119
|
+
You can override common path settings with environment variables:
|
|
120
|
+
|
|
121
|
+
| Variable | Overrides | Description |
|
|
122
|
+
|----------|-----------|-------------|
|
|
123
|
+
| `I18NTK_PROJECT_ROOT` | `projectRoot` | Base project directory |
|
|
124
|
+
| `I18NTK_SOURCE_DIR` | `sourceDir` | Location of source translation files |
|
|
125
|
+
| `I18NTK_I18N_DIR` | `i18nDir` | Working i18n directory |
|
|
126
|
+
| `I18NTK_OUTPUT_DIR` | `outputDir` | Output directory for generated reports |
|
|
127
|
+
|
|
128
|
+
These values are merged into the loaded configuration at runtime.
|
|
129
|
+
|
|
95
130
|
## 🌍 Language Optimization
|
|
96
131
|
|
|
97
132
|
```bash
|
|
@@ -130,13 +165,20 @@ import { createI18n } from 'vue-i18n';
|
|
|
130
165
|
const i18n = createI18n({ locale: 'en', messages: translations });
|
|
131
166
|
```
|
|
132
167
|
|
|
133
|
-
|
|
134
168
|
## 🔒 Security Features
|
|
135
169
|
|
|
136
|
-
- **Admin PIN Protection**:
|
|
137
|
-
- **Input Sanitization**:
|
|
138
|
-
- **
|
|
139
|
-
- **Session Management**: Automatic timeout & cleanup
|
|
170
|
+
- **Admin PIN Protection**: AES-256-GCM encryption with 30-min sessions
|
|
171
|
+
- **Advanced Input Sanitization**: Comprehensive path traversal prevention
|
|
172
|
+
- **Zero-Trust Architecture**: All inputs validated and sanitized
|
|
173
|
+
- **Session Management**: Automatic timeout & cleanup with exponential backoff
|
|
174
|
+
- **File Validation**: Safe file operations with permission checks
|
|
175
|
+
- **Edge Case Security**: Robust handling of security edge cases
|
|
176
|
+
- **Encrypted Backups**: AES-256 encrypted backup storage
|
|
177
|
+
|
|
178
|
+
### 🎯 **NEW INTERACTIVE LOCALE OPTIMIZER** - up to 86% Package Size Reduction
|
|
179
|
+
- **Package Size**: 830.4KB → 115.3KB (86% reduction for English only)
|
|
180
|
+
- **Smart Management**: Interactive selection with automatic backups
|
|
181
|
+
- **Zero Breaking Changes**: Safe restoration from backups
|
|
140
182
|
|
|
141
183
|
## 📋 Project Structure
|
|
142
184
|
|
|
@@ -157,7 +199,8 @@ your-project/
|
|
|
157
199
|
|
|
158
200
|
- **Locale files are backed up automatically** before optimization
|
|
159
201
|
- **Use interactive optimizer** for safe locale management
|
|
160
|
-
- **Zero breaking changes** from v1.
|
|
202
|
+
- **Zero breaking changes** from v1.6.x to v1.7.0
|
|
203
|
+
- **All versions prior to 1.7.0 are deprecated**
|
|
161
204
|
- **All improvements applied automatically** on update
|
|
162
205
|
|
|
163
206
|
## 📞 Support
|
|
@@ -175,7 +218,7 @@ your-project/
|
|
|
175
218
|
|
|
176
219
|
### Upgrading from Deprecated Versions
|
|
177
220
|
|
|
178
|
-
#### From any version < 1.
|
|
221
|
+
#### From any version < 1.7.0 (DEPRECATED - use latest version)
|
|
179
222
|
1. **Backup your current configuration**:
|
|
180
223
|
```bash
|
|
181
224
|
cp -r ./.i18ntk ./.i18ntk-backup-$(date +%Y%m%d)
|
|
@@ -183,7 +226,13 @@ your-project/
|
|
|
183
226
|
|
|
184
227
|
2. **Install the latest version**:
|
|
185
228
|
```bash
|
|
186
|
-
npm install i18ntk@1.
|
|
229
|
+
npm install i18ntk@1.7.0
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
3. **Verify installation**:
|
|
233
|
+
```bash
|
|
234
|
+
i18ntk --version
|
|
235
|
+
i18ntk doctor
|
|
187
236
|
```
|
|
188
237
|
|
|
189
238
|
3. **Run configuration migration**:
|