i18ntk 1.6.3 โ 1.7.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.
- package/README.md +76 -65
- package/main/i18ntk-analyze.js +736 -735
- package/main/i18ntk-autorun.js +8 -21
- package/main/i18ntk-complete.js +54 -65
- package/main/i18ntk-init.js +144 -189
- package/main/i18ntk-manage.js +387 -237
- package/main/i18ntk-settings.js +13 -0
- package/main/i18ntk-sizing.js +56 -72
- package/main/i18ntk-summary.js +997 -1018
- package/main/i18ntk-ui.js +57 -27
- package/main/i18ntk-usage.js +156 -161
- package/main/i18ntk-validate.js +134 -87
- package/package.json +13 -12
- package/scripts/admin-auth.test.js +21 -0
- 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 +4 -5
- package/settings/initialization.json +7 -0
- package/settings/settings-cli.js +188 -210
- package/settings/settings-manager.js +17 -6
- package/ui-locales/de.json +6 -0
- package/ui-locales/en.json +6 -0
- package/ui-locales/es.json +6 -0
- package/ui-locales/fr.json +7 -1
- package/ui-locales/ja.json +6 -0
- package/ui-locales/ru.json +39 -33
- package/ui-locales/zh.json +6 -0
- package/utils/admin-auth.js +95 -24
- package/utils/admin-cli.js +21 -80
- package/utils/admin-pin.js +519 -567
- package/utils/cli-helper.js +229 -0
- package/utils/cli.js +131 -0
- package/utils/config-helper.js +70 -10
- package/utils/config-manager.js +46 -20
- package/utils/config.js +41 -0
- package/utils/i18n-helper.js +20 -55
- package/utils/promptPin.js +76 -0
- package/utils/security-check.js +6 -2
- package/utils/security.js +40 -13
- package/utils/watch-locales.js +28 -0
package/README.md
CHANGED
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
**Version:** 1.
|
|
6
|
-
**Last Updated:** 2025-08-
|
|
5
|
+
**Version:** 1.7.1
|
|
6
|
+
**Last Updated:** 2025-08-10
|
|
7
7
|
**GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
|
|
8
8
|
|
|
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)
|
|
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)
|
|
10
|
+
[](https://socket.dev/npm/package/i18ntk/overview/1.7.1)
|
|
10
11
|
|
|
11
12
|
**๐ The fastest way to manage translations across any framework or vanilla JavaScript projects**
|
|
12
13
|
|
|
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 validationโit does NOT implement
|
|
14
|
+
**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 validationโit does NOT implement translation logic like i18next or Vue i18n.
|
|
14
15
|
|
|
15
|
-
> **
|
|
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.
|
|
16
|
+
> **v1.7.1** โ Enhanced security logging, flexible 4-6 digit PIN authentication, configuration stability improvements, and CI/CD silent mode support; maintains 97% speed improvement (**15.38ms** for 200k keys up to 5/M keys per second).
|
|
18
17
|
|
|
19
18
|
## ๐ Quick Start
|
|
20
19
|
|
|
@@ -23,11 +22,11 @@
|
|
|
23
22
|
npm i i18ntk
|
|
24
23
|
|
|
25
24
|
# Interactive setup
|
|
26
|
-
npx i18ntk
|
|
25
|
+
npx i18ntk
|
|
27
26
|
|
|
28
27
|
# Basic commands
|
|
29
28
|
i18ntk analyze --source ./src
|
|
30
|
-
i18ntk complete --
|
|
29
|
+
i18ntk complete --source ./src
|
|
31
30
|
i18ntk validate --source ./locales
|
|
32
31
|
```
|
|
33
32
|
|
|
@@ -35,18 +34,25 @@ i18ntk validate --source ./locales
|
|
|
35
34
|
|
|
36
35
|
| Mode | Time (200k keys) | Memory | Package Size |
|
|
37
36
|
|------|------------------|--------|--------------|
|
|
37
|
+
| **Ultra-Extreme** | **15.38ms** | 1.62MB | 115KB-830KB |
|
|
38
38
|
| **Extreme** | **38.90ms** | 0.61MB | 115KB-830KB |
|
|
39
39
|
| Ultra | 336.8ms | 0.64MB | Configurable |
|
|
40
40
|
| Optimized | 847.9ms | 0.45MB | Full package |
|
|
41
41
|
|
|
42
42
|
## ๐ฏ Key Features
|
|
43
43
|
|
|
44
|
-
- **Ultra Performance**: 97% speed improvement
|
|
44
|
+
- **Ultra-Extreme Performance**: 97% speed improvement - **15.38ms** for 200k keys
|
|
45
|
+
- **Enhanced Security**: Advanced PIN protection with exponential backoff & AES-256 encryption
|
|
46
|
+
- **Edge Case Handling**: Robust handling of corrupt files, encoding issues, and network failures
|
|
45
47
|
- **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
|
|
46
|
-
- **Enterprise
|
|
48
|
+
- **Enterprise Backup**: Automated encrypted backups with cloud integration
|
|
47
49
|
- **Zero Dependencies**: Lightweight, production-ready
|
|
48
|
-
- **
|
|
49
|
-
- **Framework
|
|
50
|
+
- **Watch Helper**: Optional `--watch` mode keeps translations synced in real time
|
|
51
|
+
- **Lite Package Framework**: Build an English-only UI locale bundle for minimal footprint
|
|
52
|
+
- **8 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese, and more
|
|
53
|
+
- **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18next, Svelte i18n
|
|
54
|
+
- **Memory Optimization**: 67% memory reduction with streaming processing
|
|
55
|
+
- **Scalability**: Linear scaling up to 5M keys with ultra-extreme settings
|
|
50
56
|
|
|
51
57
|
### ๐ธ Screenshots
|
|
52
58
|
|
|
@@ -68,10 +74,12 @@ i18ntk validate --source ./locales
|
|
|
68
74
|
|---------|---------|---------|
|
|
69
75
|
| `init` | Setup project | `i18ntk init --interactive` |
|
|
70
76
|
| `analyze` | Find missing translations | `i18ntk analyze --source ./src` |
|
|
71
|
-
| `complete` | Generate translations | `i18ntk complete --config=extreme` |
|
|
77
|
+
| `complete` | Generate translations | `i18ntk complete --config=ultra-extreme` |
|
|
72
78
|
| `validate` | Check translation quality | `i18ntk validate --strict` |
|
|
73
79
|
| `sync` | Sync across languages | `i18ntk sync --languages en,es,fr` |
|
|
74
80
|
| `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
|
|
81
|
+
| `doctor` | Diagnose configuration issues | `i18ntk doctor` |
|
|
82
|
+
| `sizing` | Optimize package size | `i18ntk sizing --interactive` |
|
|
75
83
|
|
|
76
84
|
## ๐ง Configuration
|
|
77
85
|
|
|
@@ -79,19 +87,45 @@ Configuration is managed through the `settings/i18ntk-config.json` file:
|
|
|
79
87
|
|
|
80
88
|
```json
|
|
81
89
|
{
|
|
82
|
-
"version": "1.
|
|
90
|
+
"version": "1.7.1",
|
|
83
91
|
"sourceDir": "./locales",
|
|
84
92
|
"outputDir": "./i18ntk-reports",
|
|
85
93
|
"defaultLanguage": "en",
|
|
86
|
-
"supportedLanguages": ["en", "es", "fr", "de"],
|
|
94
|
+
"supportedLanguages": ["en", "es", "fr", "de", "ja", "ru", "zh"],
|
|
87
95
|
"performance": {
|
|
88
|
-
"mode": "extreme",
|
|
89
|
-
"batchSize":
|
|
90
|
-
"concurrency":
|
|
96
|
+
"mode": "ultra-extreme",
|
|
97
|
+
"batchSize": 2000,
|
|
98
|
+
"concurrency": 32,
|
|
99
|
+
"memoryLimit": "256MB",
|
|
100
|
+
"streaming": true,
|
|
101
|
+
"compression": "brotli"
|
|
102
|
+
},
|
|
103
|
+
"security": {
|
|
104
|
+
"adminPinEnabled": true,
|
|
105
|
+
"sessionTimeout": 30,
|
|
106
|
+
"maxFailedAttempts": 3
|
|
107
|
+
},
|
|
108
|
+
"backup": {
|
|
109
|
+
"enabled": true,
|
|
110
|
+
"retentionDays": 30,
|
|
111
|
+
"maxBackups": 100
|
|
91
112
|
}
|
|
92
113
|
}
|
|
93
114
|
```
|
|
94
115
|
|
|
116
|
+
### Environment Variables
|
|
117
|
+
|
|
118
|
+
You can override common path settings with environment variables:
|
|
119
|
+
|
|
120
|
+
| Variable | Overrides | Description |
|
|
121
|
+
|----------|-----------|-------------|
|
|
122
|
+
| `I18NTK_PROJECT_ROOT` | `projectRoot` | Base project directory |
|
|
123
|
+
| `I18NTK_SOURCE_DIR` | `sourceDir` | Location of source translation files |
|
|
124
|
+
| `I18NTK_I18N_DIR` | `i18nDir` | Working i18n directory |
|
|
125
|
+
| `I18NTK_OUTPUT_DIR` | `outputDir` | Output directory for generated reports |
|
|
126
|
+
|
|
127
|
+
These values are merged into the loaded configuration at runtime.
|
|
128
|
+
|
|
95
129
|
## ๐ Language Optimization
|
|
96
130
|
|
|
97
131
|
```bash
|
|
@@ -130,13 +164,21 @@ import { createI18n } from 'vue-i18n';
|
|
|
130
164
|
const i18n = createI18n({ locale: 'en', messages: translations });
|
|
131
165
|
```
|
|
132
166
|
|
|
133
|
-
|
|
134
167
|
## ๐ Security Features
|
|
135
168
|
|
|
136
|
-
- **Admin PIN Protection**:
|
|
137
|
-
- **Input Sanitization**:
|
|
138
|
-
- **
|
|
139
|
-
- **Session Management**: Automatic timeout & cleanup
|
|
169
|
+
- **Admin PIN Protection**: AES-256-GCM encryption with 30-min sessions
|
|
170
|
+
- **Advanced Input Sanitization**: Comprehensive path traversal prevention
|
|
171
|
+
- **Zero-Trust Architecture**: All inputs validated and sanitized
|
|
172
|
+
- **Session Management**: Automatic timeout & cleanup with exponential backoff
|
|
173
|
+
- **File Validation**: Safe file operations with permission checks
|
|
174
|
+
- **Edge Case Security**: Robust handling of security edge cases
|
|
175
|
+
- **Encrypted Backups**: AES-256 encrypted backup storage
|
|
176
|
+
|
|
177
|
+
### ๐ฏ **NEW INTERACTIVE LOCALE OPTIMIZER** - up to 86% Package Size Reduction
|
|
178
|
+
|
|
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,44 +199,10 @@ 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.1
|
|
203
|
+
- **All versions prior to 1.7.1 are deprecated**
|
|
161
204
|
- **All improvements applied automatically** on update
|
|
162
205
|
|
|
163
|
-
## ๐ Support
|
|
164
|
-
|
|
165
|
-
- **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
|
|
166
|
-
- **Documentation**: [Complete docs](./docs)
|
|
167
|
-
- **Performance**: [Benchmark results](./benchmarks/results)
|
|
168
|
-
- **Version**: `i18ntk --version`
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
**Made for the global development community** โค๏ธ
|
|
173
|
-
|
|
174
|
-
## Migration Guide
|
|
175
|
-
|
|
176
|
-
### Upgrading from Deprecated Versions
|
|
177
|
-
|
|
178
|
-
#### From any version < 1.6.3 (DEPRECATED - use latest version)
|
|
179
|
-
1. **Backup your current configuration**:
|
|
180
|
-
```bash
|
|
181
|
-
cp -r ./.i18ntk ./.i18ntk-backup-$(date +%Y%m%d)
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
2. **Install the latest version**:
|
|
185
|
-
```bash
|
|
186
|
-
npm install i18ntk@1.6.3
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
3. **Run configuration migration**:
|
|
190
|
-
```bash
|
|
191
|
-
npx i18ntk@1.6.3 --migrate
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
4. **Verify installation**:
|
|
195
|
-
```bash
|
|
196
|
-
npx i18ntk@1.6.3--validate
|
|
197
|
-
```
|
|
198
206
|
|
|
199
207
|
#### Preserved Features from 1.6.3
|
|
200
208
|
- โ
Ultra-extreme performance improvements
|
|
@@ -207,9 +215,12 @@ your-project/
|
|
|
207
215
|
#### Breaking Changes
|
|
208
216
|
- **None** - 1.6.3 is fully backward compatible
|
|
209
217
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
## ๐ Support
|
|
219
|
+
|
|
220
|
+
- **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
|
|
221
|
+
- **Documentation**: [Complete docs](./docs)
|
|
222
|
+
- **Performance**: [Benchmark results](./benchmarks/results)
|
|
223
|
+
- **Version**: `i18ntk --version`
|
|
224
|
+
---
|
|
215
225
|
|
|
226
|
+
**Made for the global development community** โค๏ธ
|