i18ntk 1.10.2 → 2.0.2
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/LICENSE +1 -1
- package/README.md +141 -1191
- package/main/i18ntk-analyze.js +65 -84
- package/main/i18ntk-backup-class.js +420 -0
- package/main/i18ntk-backup.js +3 -3
- package/main/i18ntk-complete.js +90 -65
- package/main/i18ntk-doctor.js +123 -103
- package/main/i18ntk-fixer.js +61 -725
- package/main/i18ntk-go.js +14 -15
- package/main/i18ntk-init.js +77 -26
- package/main/i18ntk-java.js +27 -32
- package/main/i18ntk-js.js +70 -68
- package/main/i18ntk-manage.js +129 -30
- package/main/i18ntk-php.js +75 -75
- package/main/i18ntk-py.js +55 -56
- package/main/i18ntk-scanner.js +59 -57
- package/main/i18ntk-setup.js +9 -404
- package/main/i18ntk-sizing.js +6 -6
- package/main/i18ntk-summary.js +21 -18
- package/main/i18ntk-ui.js +11 -10
- package/main/i18ntk-usage.js +54 -18
- package/main/i18ntk-validate.js +13 -13
- package/main/manage/commands/AnalyzeCommand.js +1124 -0
- package/main/manage/commands/BackupCommand.js +62 -0
- package/main/manage/commands/CommandRouter.js +295 -0
- package/main/manage/commands/CompleteCommand.js +61 -0
- package/main/manage/commands/DoctorCommand.js +60 -0
- package/main/manage/commands/FixerCommand.js +624 -0
- package/main/manage/commands/InitCommand.js +62 -0
- package/main/manage/commands/ScannerCommand.js +654 -0
- package/main/manage/commands/SizingCommand.js +60 -0
- package/main/manage/commands/SummaryCommand.js +61 -0
- package/main/manage/commands/UsageCommand.js +60 -0
- package/main/manage/commands/ValidateCommand.js +978 -0
- package/main/manage/index-fixed.js +1447 -0
- package/main/manage/index.js +1462 -0
- package/main/manage/managers/DebugMenu.js +140 -0
- package/main/manage/managers/InteractiveMenu.js +177 -0
- package/main/manage/managers/LanguageMenu.js +62 -0
- package/main/manage/managers/SettingsMenu.js +53 -0
- package/main/manage/services/AuthenticationService.js +263 -0
- package/main/manage/services/ConfigurationService-fixed.js +449 -0
- package/main/manage/services/ConfigurationService.js +449 -0
- package/main/manage/services/FileManagementService.js +368 -0
- package/main/manage/services/FrameworkDetectionService.js +458 -0
- package/main/manage/services/InitService.js +1051 -0
- package/main/manage/services/SetupService.js +462 -0
- package/main/manage/services/SummaryService.js +450 -0
- package/main/manage/services/UsageService.js +1502 -0
- package/package.json +32 -29
- package/runtime/enhanced.d.ts +221 -221
- package/runtime/index.d.ts +29 -29
- package/runtime/index.full.d.ts +331 -331
- package/runtime/index.js +7 -6
- package/scripts/build-lite.js +17 -17
- package/scripts/deprecate-versions.js +23 -6
- package/scripts/export-translations.js +5 -5
- package/scripts/fix-all-i18n.js +3 -3
- package/scripts/fix-and-purify-i18n.js +3 -2
- package/scripts/fix-locale-control-chars.js +110 -0
- package/scripts/lint-locales.js +80 -0
- package/scripts/locale-optimizer.js +8 -8
- package/scripts/prepublish.js +21 -21
- package/scripts/security-check.js +117 -117
- package/scripts/sync-translations.js +4 -4
- package/scripts/sync-ui-locales.js +9 -8
- package/scripts/validate-all-translations.js +8 -7
- package/scripts/verify-deprecations.js +157 -161
- package/scripts/verify-translations.js +6 -5
- package/settings/i18ntk-config.json +282 -282
- package/settings/language-config.json +5 -5
- package/settings/settings-cli.js +9 -9
- package/settings/settings-manager.js +18 -18
- package/ui-locales/de.json +2417 -2348
- package/ui-locales/en.json +2415 -2352
- package/ui-locales/es.json +2425 -2353
- package/ui-locales/fr.json +2418 -2348
- package/ui-locales/ja.json +2463 -2361
- package/ui-locales/ru.json +2463 -2359
- package/ui-locales/zh.json +2418 -2351
- package/utils/admin-auth.js +2 -2
- package/utils/admin-cli.js +297 -297
- package/utils/admin-pin.js +9 -9
- package/utils/cli-helper.js +9 -9
- package/utils/config-helper.js +73 -104
- package/utils/config-manager.js +204 -171
- package/utils/config.js +5 -4
- package/utils/env-manager.js +249 -263
- package/utils/framework-detector.js +27 -24
- package/utils/i18n-helper.js +85 -41
- package/utils/init-helper.js +152 -94
- package/utils/json-output.js +98 -98
- package/utils/mini-commander.js +179 -0
- package/utils/missing-key-validator.js +5 -5
- package/utils/plugin-loader.js +40 -29
- package/utils/prompt.js +14 -44
- package/utils/safe-json.js +40 -0
- package/utils/secure-errors.js +3 -3
- package/utils/security-check-improved.js +390 -0
- package/utils/security-config.js +5 -5
- package/utils/security-fixed.js +607 -0
- package/utils/security.js +652 -602
- package/utils/setup-enforcer.js +136 -44
- package/utils/setup-validator.js +33 -32
- package/utils/ultra-performance-optimizer.js +11 -9
- package/utils/watch-locales.js +2 -1
- package/utils/prompt-fixed.js +0 -55
- package/utils/security-check.js +0 -454
package/README.md
CHANGED
|
@@ -1,1191 +1,141 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[![
|
|
10
|
-
[![
|
|
11
|
-
[![
|
|
12
|
-
[![
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
i18ntk
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
i18ntk
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- 🔒 **Encrypted Backups** - AES-256-GCM encryption for all backups
|
|
143
|
-
- 🚫 **No Shell Access** - 100% Node.js native, zero shell vulnerabilities
|
|
144
|
-
|
|
145
|
-
### 🌍 **Universal Language Support**
|
|
146
|
-
From JavaScript to Python, Java, PHP, and Go - we support them all.
|
|
147
|
-
|
|
148
|
-
| Language | Framework Support | File Formats |
|
|
149
|
-
|----------|------------------|--------------|
|
|
150
|
-
| **JavaScript/TypeScript** | React, Vue, Angular, Next.js, Nuxt.js, SvelteKit | JSON, JSON5 |
|
|
151
|
-
| **Python** | Django, Flask, FastAPI | .po, .mo, JSON |
|
|
152
|
-
| **Java** | Spring Boot, Android | .properties, .xml |
|
|
153
|
-
| **PHP** | Laravel, Symfony, WordPress | .php, JSON |
|
|
154
|
-
| **Go** | Standard Go, go-i18n | JSON, TOML, YAML |
|
|
155
|
-
|
|
156
|
-
### 📊 **Advanced Analytics & Reporting**
|
|
157
|
-
Comprehensive insights into your translation health.
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
# Generate detailed reports
|
|
161
|
-
i18ntk analyze --detailed --output json
|
|
162
|
-
i18ntk usage --performance-mode
|
|
163
|
-
i18ntk sizing --format html
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**Analytics Features:**
|
|
167
|
-
- 📈 **Translation Coverage** - See exactly what's translated
|
|
168
|
-
- 🔍 **Usage Analysis** - Find unused and missing translations
|
|
169
|
-
- 📊 **Performance Metrics** - Monitor translation loading times
|
|
170
|
-
- 📋 **Custom Reports** - HTML, JSON, CSV, and PDF formats
|
|
171
|
-
|
|
172
|
-
### 💾 **Secure Backup & Recovery**
|
|
173
|
-
Never lose your translations again.
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Create encrypted backup
|
|
177
|
-
i18ntk backup create --encrypt
|
|
178
|
-
|
|
179
|
-
# List all backups
|
|
180
|
-
i18ntk backup list
|
|
181
|
-
|
|
182
|
-
# Restore from backup
|
|
183
|
-
i18ntk backup restore <backup-id>
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**Backup Features:**
|
|
187
|
-
- 🔐 **Encrypted Storage** - AES-256-GCM encryption
|
|
188
|
-
- 📦 **Incremental Backups** - Only store changes
|
|
189
|
-
- ⚡ **Fast Recovery** - Restore in seconds
|
|
190
|
-
- 🏷️ **Version Tagging** - Organize backups by version
|
|
191
|
-
|
|
192
|
-
## 🏆 Real-World Use Cases
|
|
193
|
-
|
|
194
|
-
### 🚀 **For Enterprise Teams**
|
|
195
|
-
```bash
|
|
196
|
-
# Large-scale project with multiple teams
|
|
197
|
-
i18ntk analyze --detailed --output json --threshold 95
|
|
198
|
-
i18ntk usage --performance-mode --framework-detect
|
|
199
|
-
i18ntk backup create --encrypt --name "sprint-42-release"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Benefits:**
|
|
203
|
-
- ⚡ **Scale to millions** of translation keys
|
|
204
|
-
- 🔒 **Enterprise security** with PIN protection
|
|
205
|
-
- 📊 **Team collaboration** with shared reports
|
|
206
|
-
- 🚀 **CI/CD integration** with JSON output
|
|
207
|
-
|
|
208
|
-
### 🎨 **For Indie Developers**
|
|
209
|
-
```bash
|
|
210
|
-
# Quick setup for personal projects
|
|
211
|
-
npx i18ntk init
|
|
212
|
-
npx i18ntk scanner --source ./src --framework react
|
|
213
|
-
npx i18ntk fixer --interactive
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
**Benefits:**
|
|
217
|
-
- 🆓 **Zero cost** - MIT licensed
|
|
218
|
-
- ⚡ **Instant setup** - Works in seconds
|
|
219
|
-
- 🎯 **Perfect for MVPs** - Get to market faster
|
|
220
|
-
- 🌍 **Multi-language ready** - Expand globally easily
|
|
221
|
-
|
|
222
|
-
### 🌐 **For Open Source Projects**
|
|
223
|
-
```bash
|
|
224
|
-
# Community-driven localization
|
|
225
|
-
i18ntk validate --strict --fix
|
|
226
|
-
i18ntk usage --unused --missing
|
|
227
|
-
i18ntk summary --format html --include analysis,validation
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**Benefits:**
|
|
231
|
-
- 🤝 **Community contributions** - Easy for volunteers
|
|
232
|
-
- 📈 **Translation coverage** tracking
|
|
233
|
-
- 🌍 **Global reach** - Support any language
|
|
234
|
-
- 📊 **Transparency** - Public translation reports
|
|
235
|
-
|
|
236
|
-
### 🏢 **For Translation Agencies**
|
|
237
|
-
```bash
|
|
238
|
-
# Professional translation workflow
|
|
239
|
-
i18ntk analyze --detailed --output csv
|
|
240
|
-
i18ntk backup create --encrypt
|
|
241
|
-
i18ntk validate --strict --auto-fix
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**Benefits:**
|
|
245
|
-
- 💼 **Professional workflow** - Industry-standard processes
|
|
246
|
-
- 🔐 **Secure client data** - Encrypted backups
|
|
247
|
-
- 📋 **Detailed reporting** - Client-ready documentation
|
|
248
|
-
- ⚡ **Batch processing** - Handle multiple projects
|
|
249
|
-
|
|
250
|
-
## 🛠️ Command Line Interface
|
|
251
|
-
|
|
252
|
-
### Core Commands
|
|
253
|
-
|
|
254
|
-
| Command | Description | Use Case |
|
|
255
|
-
|---------|-------------|----------|
|
|
256
|
-
| `i18ntk init` | Initialize i18n project | **Start here** - Setup your project |
|
|
257
|
-
| `i18ntk analyze` | Analyze translation completeness | **Daily use** - Check translation health |
|
|
258
|
-
| `i18ntk validate` | Validate translation files | **Quality assurance** - Catch errors |
|
|
259
|
-
| `i18ntk scanner` | Find hardcoded text | **Development** - Discover missed translations |
|
|
260
|
-
| `i18ntk fixer` | Interactive translation fixer | **Fix issues** - Mass translation updates |
|
|
261
|
-
| `i18ntk usage` | Analyze translation usage | **Optimization** - Remove unused keys |
|
|
262
|
-
| `i18ntk backup` | Backup & restore translations | **Safety** - Never lose your work |
|
|
263
|
-
| `i18ntk sizing` | Performance analysis | **Optimization** - Monitor bundle size |
|
|
264
|
-
|
|
265
|
-
### Advanced Commands
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
# Development workflow
|
|
269
|
-
i18ntk scanner --source ./src --framework react --output-report
|
|
270
|
-
i18ntk fixer --interactive --languages en,es,fr
|
|
271
|
-
i18ntk validate --strict --fix --backup
|
|
272
|
-
|
|
273
|
-
# Production workflow
|
|
274
|
-
i18ntk analyze --detailed --threshold 95 --output json
|
|
275
|
-
i18ntk backup create --encrypt --name "production-release"
|
|
276
|
-
i18ntk usage --performance-mode --framework-detect
|
|
277
|
-
|
|
278
|
-
# CI/CD integration
|
|
279
|
-
i18ntk validate --strict --output json || exit 1
|
|
280
|
-
i18ntk analyze --output json --threshold 90 || exit 1
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
## 🌍 Language Support Matrix
|
|
285
|
-
|
|
286
|
-
i18ntk supports **7 major languages** with complete UI translations and **5 programming languages** with full framework integration.
|
|
287
|
-
|
|
288
|
-
### 🌐 Built-in UI Languages
|
|
289
|
-
|
|
290
|
-
| Language | Native Name | Code | Status | UI Translation |
|
|
291
|
-
|----------|-------------|------|--------|----------------|
|
|
292
|
-
| 🇺🇸 English | English | `en` | ✅ Complete | ✅ Full |
|
|
293
|
-
| 🇪🇸 Spanish | Español | `es` | ✅ Complete | ✅ Full |
|
|
294
|
-
| 🇫🇷 French | Français | `fr` | ✅ Complete | ✅ Full |
|
|
295
|
-
| 🇩🇪 German | Deutsch | `de` | ✅ Complete | ✅ Full |
|
|
296
|
-
| 🇷🇺 Russian | Русский | `ru` | ✅ Complete | ✅ Full |
|
|
297
|
-
| 🇯🇵 Japanese | 日本語 | `ja` | ✅ Complete | ✅ Full |
|
|
298
|
-
| 🇨🇳 Chinese | 中文 | `zh` | ✅ Complete | ✅ Full |
|
|
299
|
-
|
|
300
|
-
### 💻 Programming Language Support
|
|
301
|
-
|
|
302
|
-
| Language | Frameworks | File Formats | Translation Files |
|
|
303
|
-
|----------|------------|--------------|------------------|
|
|
304
|
-
| **JavaScript/TypeScript** | React, Vue, Angular, Next.js, Nuxt.js, SvelteKit | JSON, JSON5 | `locales/en/common.json` |
|
|
305
|
-
| **Python** | Django, Flask, FastAPI | .po, .mo, JSON | `locale/en/LC_MESSAGES/django.po` |
|
|
306
|
-
| **Java** | Spring Boot, Android | .properties, .xml | `messages.properties` |
|
|
307
|
-
| **PHP** | Laravel, Symfony, WordPress | .php, JSON | `lang/en/messages.php` |
|
|
308
|
-
| **Go** | Standard Go, go-i18n | JSON, TOML, YAML | `locales/en.json` |
|
|
309
|
-
|
|
310
|
-
### 🔧 Adding Custom Languages
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
# Add a new UI language
|
|
314
|
-
cp ui-locales/en.json ui-locales/it.json
|
|
315
|
-
# Edit ui-locales/it.json with Italian translations
|
|
316
|
-
|
|
317
|
-
# Add a new content language
|
|
318
|
-
mkdir -p locales/it
|
|
319
|
-
cp locales/en/common.json locales/it/common.json
|
|
320
|
-
# Edit locales/it/common.json with Italian translations
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
**✨ Pro Tip:** i18ntk supports all CLDR languages with automatic pluralization rules, RTL text direction, and cultural formatting.
|
|
324
|
-
|
|
325
|
-
## 🔒 Security
|
|
326
|
-
|
|
327
|
-
### Key Security Features
|
|
328
|
-
- **Local-Only**: No network access or external dependencies
|
|
329
|
-
- **Minimal Permissions**: Only accesses explicitly specified directories
|
|
330
|
-
- **Zero Dependencies**: Reduces attack surface and potential vulnerabilities
|
|
331
|
-
- **Memory Protection**: Secure handling of sensitive data in memory
|
|
332
|
-
- **Secure Defaults**: All security features enabled by default
|
|
333
|
-
|
|
334
|
-
### Security Architecture
|
|
335
|
-
|
|
336
|
-
#### Data Protection
|
|
337
|
-
- **Encryption**: AES-256-GCM with PBKDF2 key derivation
|
|
338
|
-
- **Secure Storage**: Configuration files stored with restricted permissions (600 for files, 700 for directories)
|
|
339
|
-
- **Memory Safety**: Sensitive data is zeroed out after use
|
|
340
|
-
- **Input Validation**: All user inputs are strictly validated and sanitized
|
|
341
|
-
|
|
342
|
-
#### Access Control
|
|
343
|
-
- **Admin PIN**: Required for sensitive operations
|
|
344
|
-
- **Session Management**: Automatic timeout after 15 minutes of inactivity
|
|
345
|
-
- **Rate Limiting**: Protection against brute force attacks
|
|
346
|
-
- **Path Validation**: Prevents directory traversal attacks
|
|
347
|
-
|
|
348
|
-
### Security Configuration
|
|
349
|
-
|
|
350
|
-
Customize security settings in `security-config.json`:
|
|
351
|
-
|
|
352
|
-
```json
|
|
353
|
-
{
|
|
354
|
-
"pin": {
|
|
355
|
-
"minLength": 4,
|
|
356
|
-
"maxLength": 32,
|
|
357
|
-
"requireStrongPin": true,
|
|
358
|
-
"maxAttempts": 5,
|
|
359
|
-
"lockDuration": 900000,
|
|
360
|
-
"sessionTimeout": 900000
|
|
361
|
-
},
|
|
362
|
-
"encryption": {
|
|
363
|
-
"enabled": true,
|
|
364
|
-
"algorithm": "aes-256-gcm",
|
|
365
|
-
"keyDerivation": {
|
|
366
|
-
"iterations": 100000,
|
|
367
|
-
"digest": "sha512"
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
"filePermissions": {
|
|
371
|
-
"files": 384, // 600 in octal
|
|
372
|
-
"directories": 448 // 700 in octal
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### Security Best Practices
|
|
378
|
-
|
|
379
|
-
1. **Regular Updates**
|
|
380
|
-
- Keep i18ntk updated to the latest version
|
|
381
|
-
- Subscribe to security announcements
|
|
382
|
-
|
|
383
|
-
2. **Access Control**
|
|
384
|
-
- Run with minimal required permissions
|
|
385
|
-
- Restrict access to configuration files
|
|
386
|
-
- Use strong, unique PINs
|
|
387
|
-
|
|
388
|
-
3. **Monitoring**
|
|
389
|
-
- Review security logs regularly
|
|
390
|
-
- Monitor for unusual activity
|
|
391
|
-
- Report any security concerns immediately
|
|
392
|
-
|
|
393
|
-
4. **Backup & Recovery**
|
|
394
|
-
- Maintain regular backups
|
|
395
|
-
- Store backups securely
|
|
396
|
-
- Test restore procedures
|
|
397
|
-
|
|
398
|
-
### Exit Codes
|
|
399
|
-
|
|
400
|
-
| Code | Meaning | Description |
|
|
401
|
-
|------|---------|-------------|
|
|
402
|
-
| 0 | Success | Operation completed successfully |
|
|
403
|
-
| 1 | Configuration error | Invalid or missing configuration |
|
|
404
|
-
| 2 | Validation failed | Input validation error |
|
|
405
|
-
| 3 | Security violation | Authentication or authorization failure |
|
|
406
|
-
| 4 | Resource error | File system or resource access issue |
|
|
407
|
-
| 5 | Runtime error | Unexpected error during execution |
|
|
408
|
-
|
|
409
|
-
## ⚡ Runtime API Quick Start
|
|
410
|
-
|
|
411
|
-
Add i18ntk to your app with just a few lines of code:
|
|
412
|
-
|
|
413
|
-
```javascript
|
|
414
|
-
// Initialize once at app startup
|
|
415
|
-
import { initRuntime, t } from 'i18ntk/runtime';
|
|
416
|
-
|
|
417
|
-
initRuntime({
|
|
418
|
-
baseDir: './locales', // path to your locale files
|
|
419
|
-
language: 'en', // default language
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
// Use anywhere in your app
|
|
423
|
-
function Welcome() {
|
|
424
|
-
return (
|
|
425
|
-
<div>
|
|
426
|
-
<h1>{t('welcome.title')}</h1>
|
|
427
|
-
<p>{t('welcome.subtitle', { name: 'User' })}</p>
|
|
428
|
-
</div>
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Key Features
|
|
434
|
-
- **Type Safety**: Full TypeScript support with beta autocomplete support
|
|
435
|
-
- **Framework Agnostic**: Works with React, Vue, Angular, or vanilla JS
|
|
436
|
-
- **Dynamic Loading**: Load translations on demand
|
|
437
|
-
- **Pluralization & Interpolation**: Built-in support for all i18n features
|
|
438
|
-
|
|
439
|
-
## 💾 Backup & Restore
|
|
440
|
-
|
|
441
|
-
i18ntk provides a secure backup system to protect your translation files and configuration.
|
|
442
|
-
|
|
443
|
-
### Backup Commands
|
|
444
|
-
|
|
445
|
-
```bash
|
|
446
|
-
# Create a new backup with timestamp
|
|
447
|
-
i18ntk backup create
|
|
448
|
-
|
|
449
|
-
# Create backup with custom name
|
|
450
|
-
i18ntk backup create --name my-backup
|
|
451
|
-
|
|
452
|
-
# List all available backups
|
|
453
|
-
i18ntk backup list
|
|
454
|
-
|
|
455
|
-
# Show detailed info about a backup
|
|
456
|
-
i18ntk backup info <backup-id>
|
|
457
|
-
|
|
458
|
-
# Restore from a specific backup
|
|
459
|
-
i18ntk backup restore <backup-id>
|
|
460
|
-
|
|
461
|
-
# Verify backup integrity
|
|
462
|
-
i18ntk backup verify <backup-id>
|
|
463
|
-
|
|
464
|
-
# Remove old backups (keeps last 5 by default)
|
|
465
|
-
i18ntk backup cleanup [--keep=5]
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
### Backup Features
|
|
469
|
-
|
|
470
|
-
- **Incremental Backups**: Only stores changed files
|
|
471
|
-
- **Compression**: Reduces storage space usage
|
|
472
|
-
- **Encryption**: Optional encryption for sensitive data
|
|
473
|
-
- **Metadata**: Includes version and timestamp information
|
|
474
|
-
- **Verification**: Checksum validation for backup integrity
|
|
475
|
-
|
|
476
|
-
### Backup Configuration
|
|
477
|
-
|
|
478
|
-
Configure backup settings in `backup-config.json`:
|
|
479
|
-
|
|
480
|
-
```json
|
|
481
|
-
{
|
|
482
|
-
"backup": {
|
|
483
|
-
"directory": "./i18n-backups",
|
|
484
|
-
"retention": {
|
|
485
|
-
"maxBackups": 10,
|
|
486
|
-
"maxAgeDays": 30
|
|
487
|
-
},
|
|
488
|
-
"compression": {
|
|
489
|
-
"enabled": true,
|
|
490
|
-
"level": 6
|
|
491
|
-
},
|
|
492
|
-
"encryption": {
|
|
493
|
-
"enabled": true,
|
|
494
|
-
"algorithm": "aes-256-gcm"
|
|
495
|
-
},
|
|
496
|
-
"include": [
|
|
497
|
-
"locales/**/*.json",
|
|
498
|
-
"i18n.config.json"
|
|
499
|
-
],
|
|
500
|
-
"exclude": [
|
|
501
|
-
"**/node_modules/**",
|
|
502
|
-
"**/.*"
|
|
503
|
-
]
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
### Automatic Backups
|
|
509
|
-
|
|
510
|
-
Enable automatic backups in your project configuration:
|
|
511
|
-
|
|
512
|
-
```json
|
|
513
|
-
{
|
|
514
|
-
"autoBackup": {
|
|
515
|
-
"enabled": true,
|
|
516
|
-
"frequency": "daily",
|
|
517
|
-
"time": "02:00",
|
|
518
|
-
"maxBackups": 7
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
### Restoring from Backup
|
|
524
|
-
|
|
525
|
-
1. List available backups:
|
|
526
|
-
```bash
|
|
527
|
-
i18ntk backup list
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
2. Verify backup contents:
|
|
531
|
-
```bash
|
|
532
|
-
i18ntk backup info <backup-id>
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
3. Restore backup:
|
|
536
|
-
```bash
|
|
537
|
-
i18ntk backup restore <backup-id>
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
4. Verify restoration:
|
|
541
|
-
```bash
|
|
542
|
-
i18ntk validate
|
|
543
|
-
```
|
|
544
|
-
|
|
545
|
-
### Best Practices
|
|
546
|
-
|
|
547
|
-
- **Regular Backups**: Set up automatic daily backups
|
|
548
|
-
- **Offsite Storage**: Copy backups to a secure, offsite location
|
|
549
|
-
- **Test Restores**: Periodically verify backup integrity
|
|
550
|
-
- **Retention Policy**: Keep at least 7 days of backups
|
|
551
|
-
- **Monitor Space**: Ensure sufficient disk space for backups
|
|
552
|
-
|
|
553
|
-
## 🚀 Why Use i18ntk?
|
|
554
|
-
|
|
555
|
-
- **Simple**: Easy to use with minimal setup
|
|
556
|
-
- **Fast**: Quick analysis and validation
|
|
557
|
-
- **Lightweight**: Small footprint, no dependencies
|
|
558
|
-
- **Flexible**: Works with most JavaScript projects
|
|
559
|
-
|
|
560
|
-
## 📁 Project Structure
|
|
561
|
-
|
|
562
|
-
```
|
|
563
|
-
i18ntk/
|
|
564
|
-
├── main/ # CLI commands
|
|
565
|
-
├── main/ # CLI commands
|
|
566
|
-
│ ├── i18ntk-manage.js # Main interface
|
|
567
|
-
│ ├── i18ntk-analyze.js # Analysis
|
|
568
|
-
│ └── i18ntk-validate.js # Validation
|
|
569
|
-
├── utils/ # Core utilities
|
|
570
|
-
│ ├── framework-detector.js
|
|
571
|
-
│ └── logger.js
|
|
572
|
-
├── settings/ # Configuration
|
|
573
|
-
├── package.json # Package info
|
|
574
|
-
└── README.md # Documentation
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
## ⚙️ Configuration
|
|
578
|
-
## ⚙️ Configuration
|
|
579
|
-
|
|
580
|
-
### Environment Variables
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
```bash
|
|
584
|
-
# Source directory for translation files
|
|
585
|
-
# Source directory for translation files
|
|
586
|
-
I18N_SOURCE_DIR=./locales
|
|
587
|
-
|
|
588
|
-
# Output directory for reports and exports
|
|
589
|
-
I18N_OUTPUT_DIR=./i18n-reports
|
|
590
|
-
|
|
591
|
-
# Default locale (e.g., 'en', 'es', 'fr')
|
|
592
|
-
I18N_DEFAULT_LOCALE=en
|
|
593
|
-
|
|
594
|
-
# Enable debug mode
|
|
595
|
-
I18N_DEBUG=false
|
|
596
|
-
|
|
597
|
-
# Log level (error, warn, info, debug, trace)
|
|
598
|
-
I18N_LOG_LEVEL=info
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
### Configuration File
|
|
602
|
-
|
|
603
|
-
Create an `i18n.config.json` file in your project root:
|
|
604
|
-
|
|
605
|
-
```json
|
|
606
|
-
{
|
|
607
|
-
"sourceDir": "./locales",
|
|
608
|
-
"outputDir": "./i18n-reports",
|
|
609
|
-
"defaultLocale": "en",
|
|
610
|
-
"locales": ["en", "es", "fr", "de", "ja", "zh"],
|
|
611
|
-
"framework": "auto",
|
|
612
|
-
"backup": {
|
|
613
|
-
"enabled": true,
|
|
614
|
-
"directory": "./i18n-backups"
|
|
615
|
-
"directory": "./i18n-backups"
|
|
616
|
-
},
|
|
617
|
-
"features": {
|
|
618
|
-
"autoBackup": true,
|
|
619
|
-
"validation": true,
|
|
620
|
-
"analysis": true
|
|
621
|
-
"features": {
|
|
622
|
-
"autoBackup": true,
|
|
623
|
-
"validation": true,
|
|
624
|
-
"analysis": true
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
## ❓ Common Issues & Solutions
|
|
630
|
-
|
|
631
|
-
### Missing Translations
|
|
632
|
-
|
|
633
|
-
```
|
|
634
|
-
Warning: Translation key not found: my.key
|
|
635
|
-
```
|
|
636
|
-
|
|
637
|
-
**Solution**:
|
|
638
|
-
1. Add the missing key to your translation files
|
|
639
|
-
2. Run `i18ntk validate` to check for other missing translations
|
|
640
|
-
3. Use `i18ntk analyze` to find unused translations
|
|
641
|
-
|
|
642
|
-
### Permission Issues
|
|
643
|
-
|
|
644
|
-
```
|
|
645
|
-
Error: EACCES: permission denied
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
**Solution**:
|
|
649
|
-
## ❓ Common Issues & Solutions
|
|
650
|
-
|
|
651
|
-
### Missing Translations
|
|
652
|
-
|
|
653
|
-
```
|
|
654
|
-
Warning: Translation key not found: my.key
|
|
655
|
-
```
|
|
656
|
-
|
|
657
|
-
**Solution**:
|
|
658
|
-
1. Add the missing key to your translation files
|
|
659
|
-
2. Run `i18ntk validate` to check for other missing translations
|
|
660
|
-
3. Use `i18ntk analyze` to find unused translations
|
|
661
|
-
|
|
662
|
-
### Permission Issues
|
|
663
|
-
|
|
664
|
-
```
|
|
665
|
-
Error: EACCES: permission denied
|
|
666
|
-
```
|
|
667
|
-
|
|
668
|
-
**Solution**:
|
|
669
|
-
```bash
|
|
670
|
-
# Fix directory permissions
|
|
671
|
-
chmod 755 /path/to/project
|
|
672
|
-
|
|
673
|
-
# Or run with sudo (not recommended for production)
|
|
674
|
-
sudo chown -R $USER:$USER /path/to/project
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
### Backup Issues
|
|
678
|
-
|
|
679
|
-
**Problem**: Backup fails with encryption error
|
|
680
|
-
**Solution**: Ensure you have proper permissions and sufficient disk space
|
|
681
|
-
|
|
682
|
-
**Problem**: Can't restore from backup
|
|
683
|
-
**Solution**: Verify backup integrity and check version compatibility
|
|
684
|
-
|
|
685
|
-
### Performance Issues
|
|
686
|
-
|
|
687
|
-
**Problem**: Slow analysis with large projects
|
|
688
|
-
**Solution**:
|
|
689
|
-
- Exclude node_modules and other large directories
|
|
690
|
-
- Use `.i18nignore` to skip files
|
|
691
|
-
- Increase Node.js memory limit: `NODE_OPTIONS=--max-old-space-size=4096 i18ntk analyze`
|
|
692
|
-
|
|
693
|
-
## 📊 Troubleshooting
|
|
694
|
-
|
|
695
|
-
### Enable Debug Mode
|
|
696
|
-
|
|
697
|
-
# Fix directory permissions
|
|
698
|
-
chmod 755 /path/to/project
|
|
699
|
-
|
|
700
|
-
# Or run with sudo (not recommended for production)
|
|
701
|
-
sudo chown -R $USER:$USER /path/to/project
|
|
702
|
-
```
|
|
703
|
-
|
|
704
|
-
### Backup Issues
|
|
705
|
-
|
|
706
|
-
**Problem**: Backup fails with encryption error
|
|
707
|
-
**Solution**: Ensure you have proper permissions and sufficient disk space
|
|
708
|
-
|
|
709
|
-
**Problem**: Can't restore from backup
|
|
710
|
-
**Solution**: Verify backup integrity and check version compatibility
|
|
711
|
-
|
|
712
|
-
### Performance Issues
|
|
713
|
-
|
|
714
|
-
**Problem**: Slow analysis with large projects
|
|
715
|
-
**Solution**:
|
|
716
|
-
- Exclude node_modules and other large directories
|
|
717
|
-
- Use `.i18nignore` to skip files
|
|
718
|
-
- Increase Node.js memory limit: `NODE_OPTIONS=--max-old-space-size=4096 i18ntk analyze`
|
|
719
|
-
|
|
720
|
-
## 📊 Troubleshooting
|
|
721
|
-
|
|
722
|
-
### Enable Debug Mode
|
|
723
|
-
|
|
724
|
-
```bash
|
|
725
|
-
# Set debug environment variable
|
|
726
|
-
export I18N_DEBUG=true
|
|
727
|
-
|
|
728
|
-
# Or use the debug flag
|
|
729
|
-
i18ntk --debug <command>
|
|
730
|
-
```
|
|
731
|
-
|
|
732
|
-
### View Logs
|
|
733
|
-
|
|
734
|
-
Logs are stored in `.i18ntk/logs/` by default. Check the latest log for detailed error information.
|
|
735
|
-
|
|
736
|
-
### Get Help
|
|
737
|
-
|
|
738
|
-
# Set debug environment variable
|
|
739
|
-
export I18N_DEBUG=true
|
|
740
|
-
|
|
741
|
-
# Or use the debug flag
|
|
742
|
-
i18ntk --debug <command>
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
### View Logs
|
|
746
|
-
|
|
747
|
-
Logs are stored in `.i18ntk/logs/` by default. Check the latest log for detailed error information.
|
|
748
|
-
|
|
749
|
-
### Get Help
|
|
750
|
-
|
|
751
|
-
```bash
|
|
752
|
-
# Show help for all commands
|
|
753
|
-
i18ntk --help
|
|
754
|
-
|
|
755
|
-
# Get help for a specific command
|
|
756
|
-
i18ntk <command> --help
|
|
757
|
-
|
|
758
|
-
# Check version
|
|
759
|
-
i18ntk --version
|
|
760
|
-
```
|
|
761
|
-
|
|
762
|
-
## 🌍 Locale Optimization
|
|
763
|
-
|
|
764
|
-
Optimize your translation files to reduce bundle size:
|
|
765
|
-
|
|
766
|
-
```bash
|
|
767
|
-
# Optimize all locales
|
|
768
|
-
i18ntk optimize
|
|
769
|
-
# Optimize all locales
|
|
770
|
-
i18ntk optimize
|
|
771
|
-
|
|
772
|
-
# Optimize specific languages
|
|
773
|
-
i18ntk optimize --lang=en,es,de
|
|
774
|
-
# Optimize specific languages
|
|
775
|
-
i18ntk optimize --lang=en,es,de
|
|
776
|
-
```
|
|
777
|
-
|
|
778
|
-
**Example:** 830.4KB → 115.3KB for English-only optimization
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
## 🎯 Enhanced Translation Fixer
|
|
783
|
-
|
|
784
|
-
Interactive tool with automatic detection and repair:
|
|
785
|
-
|
|
786
|
-
```bash
|
|
787
|
-
# Enhanced guided mode
|
|
788
|
-
i18ntk fixer --interactive
|
|
789
|
-
|
|
790
|
-
# Fix specific languages with custom markers
|
|
791
|
-
i18ntk fixer --languages en,es,fr --markers "{{NOT_TRANSLATED}},__MISSING__"
|
|
792
|
-
|
|
793
|
-
# Auto-fix with reporting
|
|
794
|
-
i18ntk fixer --source ./src/locales --auto-fix --report
|
|
795
|
-
|
|
796
|
-
# Detect custom placeholder styles
|
|
797
|
-
i18ntk fixer --markers "TODO_TRANSLATE,PLACEHOLDER_TEXT,MISSING_TRANSLATION"
|
|
798
|
-
|
|
799
|
-
# Fix all languages
|
|
800
|
-
i18ntk fixer --languages all
|
|
801
|
-
```
|
|
802
|
-
|
|
803
|
-
**Features:**
|
|
804
|
-
- 7-language UI support
|
|
805
|
-
- 7-language UI support
|
|
806
|
-
- Smart marker detection
|
|
807
|
-
- Selective fixing by language/file
|
|
808
|
-
- Comprehensive reporting
|
|
809
|
-
- Secure backup creation
|
|
810
|
-
- Real-time progress tracking
|
|
811
|
-
|
|
812
|
-
## 📚 Documentation
|
|
813
|
-
|
|
814
|
-
All documentation is built into the toolkit. Use:
|
|
815
|
-
|
|
816
|
-
```bash
|
|
817
|
-
i18ntk --help # General help
|
|
818
|
-
i18ntk [command] --help # Command-specific help
|
|
819
|
-
```
|
|
820
|
-
|
|
821
|
-
### 📊 Technical Documentation
|
|
822
|
-
- **[JSON Performance Analysis](./JSON_PERFORMANCE_ANALYSIS.md)** - Detailed analysis of V8 JSON performance improvements and Node.js 22 optimization benefits
|
|
823
|
-
|
|
824
|
-
## 📄 License
|
|
825
|
-
|
|
826
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
827
|
-
|
|
828
|
-
## 📋 What's New in v1.10.0
|
|
829
|
-
|
|
830
|
-
### 🚀 **Major Features Released**
|
|
831
|
-
|
|
832
|
-
#### **🌐 Enhanced Runtime API**
|
|
833
|
-
- **Framework-agnostic translation runtime** with full TypeScript support
|
|
834
|
-
- **Auto-detects Next.js, Nuxt.js, and SvelteKit** projects
|
|
835
|
-
- **Optimized translation lookups** with reduced memory footprint
|
|
836
|
-
- **Hot reloading** support for development workflows
|
|
837
|
-
|
|
838
|
-
#### **⚡ Ultra-Fast Performance**
|
|
839
|
-
- **15.38ms** for 200k translation keys (97% faster than alternatives)
|
|
840
|
-
- **<2MB memory usage** (96% less than traditional tools)
|
|
841
|
-
- **315KB package size** (99% smaller than competitors)
|
|
842
|
-
- **Zero dependencies** - pure Node.js implementation
|
|
843
|
-
|
|
844
|
-
#### **🔒 Enterprise-Grade Security**
|
|
845
|
-
- **AES-256-GCM encryption** for all sensitive data
|
|
846
|
-
- **PIN-based authentication** for admin operations
|
|
847
|
-
- **Zero shell access** - 100% Node.js native
|
|
848
|
-
- **Secure backup system** with encrypted storage
|
|
849
|
-
|
|
850
|
-
#### **🌍 Universal Language Support**
|
|
851
|
-
- **7 built-in UI languages** with complete translations
|
|
852
|
-
- **5 programming languages** supported (JS/TS, Python, Java, PHP, Go)
|
|
853
|
-
- **8+ frameworks** auto-detected (React, Vue, Angular, Next.js, Nuxt.js, SvelteKit)
|
|
854
|
-
- **All CLDR languages** supported with automatic pluralization
|
|
855
|
-
|
|
856
|
-
#### **🛠️ Developer Experience**
|
|
857
|
-
- **Interactive CLI** with guided workflows
|
|
858
|
-
- **Comprehensive documentation** with real-world examples
|
|
859
|
-
- **CI/CD ready** with JSON output for automation
|
|
860
|
-
- **Multi-language support** in the CLI itself
|
|
861
|
-
|
|
862
|
-
### 🔧 **Technical Improvements**
|
|
863
|
-
|
|
864
|
-
#### **Performance Optimizations**
|
|
865
|
-
- **Tree-shaking support** - only load what you use
|
|
866
|
-
- **Lazy loading** - translations loaded on demand
|
|
867
|
-
- **Intelligent caching** - persistent translation cache
|
|
868
|
-
- **Memory optimization** - minimal footprint
|
|
869
|
-
|
|
870
|
-
#### **Security Enhancements**
|
|
871
|
-
- **Input validation** - comprehensive sanitization
|
|
872
|
-
- **Path validation** - prevents directory traversal
|
|
873
|
-
- **Session management** - secure admin sessions
|
|
874
|
-
- **Audit logging** - complete operation tracking
|
|
875
|
-
|
|
876
|
-
#### **Framework Integration**
|
|
877
|
-
- **React i18next** - seamless integration
|
|
878
|
-
- **Vue i18n** - full composition API support
|
|
879
|
-
- **Angular i18n** - built-in pipeline compatibility
|
|
880
|
-
- **Vanilla JS/TS** - zero-framework setup
|
|
881
|
-
|
|
882
|
-
### 📊 **Version 1.10.0 Highlights**
|
|
883
|
-
|
|
884
|
-
| Category | Achievement | Impact |
|
|
885
|
-
|----------|-------------|---------|
|
|
886
|
-
| **Performance** | 97% faster than alternatives | 20x faster CI/CD |
|
|
887
|
-
| **Memory** | 96% less memory usage | Scales to enterprise |
|
|
888
|
-
| **Security** | Zero vulnerabilities | Enterprise-ready |
|
|
889
|
-
| **Languages** | 5 programming + 7 UI languages | Global coverage |
|
|
890
|
-
| **Frameworks** | 8+ auto-detected | Universal compatibility |
|
|
891
|
-
|
|
892
|
-
### 🎯 **Breaking Changes**
|
|
893
|
-
- **None** - Fully backward compatible with previous versions
|
|
894
|
-
- **Zero migration required** - seamless upgrade path
|
|
895
|
-
- **All existing configurations** continue to work
|
|
896
|
-
|
|
897
|
-
### 🐛 **Bug Fixes**
|
|
898
|
-
- **Fixed DNR functionality** - proper persistence across versions
|
|
899
|
-
- **Resolved path resolution** - Windows compatibility improvements
|
|
900
|
-
- **Enhanced error handling** - better user feedback
|
|
901
|
-
- **Improved configuration loading** - faster initialization
|
|
902
|
-
|
|
903
|
-
---</search>
|
|
904
|
-
|
|
905
|
-
## 📸 Screenshots
|
|
906
|
-
|
|
907
|
-
| **Framework Detection** | **Main Menu** |
|
|
908
|
-
|:-----------------------:|:-------------:|
|
|
909
|
-
|  |  |
|
|
910
|
-
|
|
911
|
-
| **Initialization** | **Initilization Language Select** |
|
|
912
|
-
|:------------------:|:---------------------------------:|
|
|
913
|
-
|  |  |
|
|
914
|
-
|
|
915
|
-
| **Language Selection** | **Language Changed** |
|
|
916
|
-
|:----------------------:|:--------------------:|
|
|
917
|
-
|  |  |
|
|
918
|
-
|
|
919
|
-
| **Settings Manager (v1.10.0)** | **Translation Fixer (v1.10.0)** |
|
|
920
|
-
|:-----------------------------:|:-------------------------------:|
|
|
921
|
-
|  |  |
|
|
922
|
-
|
|
923
|
-
| **Analyze** | **Complete** | **Usage** |
|
|
924
|
-
|:-----------:|:------------:|:----------:|
|
|
925
|
-
|  |  |  |
|
|
926
|
-
|
|
927
|
-
| **Sizing (Overview)** | **Sizing (List)** |
|
|
928
|
-
|:---------------------:|:-----------------:|
|
|
929
|
-
|  |  |
|
|
930
|
-
|
|
931
|
-
| **Validate** | **Validate End** |
|
|
932
|
-
|:-----------:|:-----------------:|
|
|
933
|
-
|  |  |
|
|
934
|
-
|
|
935
|
-
| **Summary** | **Summary Report** | **Summary Completed** |
|
|
936
|
-
|:-----------:|:-----------------:|:-----------------:|
|
|
937
|
-
|  |  |  |
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
| **Admin Pin** | **Admin Pin Setup** | **Admin Pin Success** | **Admin Pin Ask** |
|
|
941
|
-
|:-----------:|:-----------------:|:-----------------:|:-----------------:|
|
|
942
|
-
|  |  |  |  |
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
| **Delete Options** | **Delete Full** | **Delete None** |
|
|
946
|
-
|:------------------:|:------------------:|:------------------:|
|
|
947
|
-
|  |  |  |
|
|
948
|
-
|
|
949
|
-
## 🚀 Get Started Today!
|
|
950
|
-
|
|
951
|
-
<div align="center">
|
|
952
|
-
|
|
953
|
-
### **Ready to supercharge your i18n workflow?**
|
|
954
|
-
|
|
955
|
-
```bash
|
|
956
|
-
# Install in 30 seconds
|
|
957
|
-
npm install -g i18ntk
|
|
958
|
-
|
|
959
|
-
# Initialize your project
|
|
960
|
-
i18ntk init
|
|
961
|
-
|
|
962
|
-
# Start analyzing
|
|
963
|
-
i18ntk analyze
|
|
964
|
-
```
|
|
965
|
-
|
|
966
|
-
**[📦 Install Now](#-installation)** • **[⚡ Quick Start](#-quick-start)** • **[📚 Documentation](#-documentation)**
|
|
967
|
-
|
|
968
|
-
---
|
|
969
|
-
|
|
970
|
-
## 🏆 Why Developers Choose i18ntk
|
|
971
|
-
|
|
972
|
-
<div align="center">
|
|
973
|
-
|
|
974
|
-
| Metric | i18ntk v1.10.0 | Industry Average |
|
|
975
|
-
|--------|----------------|------------------|
|
|
976
|
-
| **Performance** | 15.38ms (200k keys) | 2-5 minutes |
|
|
977
|
-
| **Memory Usage** | <2MB | 50-200MB |
|
|
978
|
-
| **Setup Time** | 60 seconds | 2-3 hours |
|
|
979
|
-
| **Languages Supported** | 7 UI + 5 Programming | 1-2 |
|
|
980
|
-
| **Security Vulnerabilities** | **0** | 5-15 |
|
|
981
|
-
|
|
982
|
-
</div>
|
|
983
|
-
|
|
984
|
-
---
|
|
985
|
-
|
|
986
|
-
## 🌟 Success Stories
|
|
987
|
-
|
|
988
|
-
> **"Finally, a translation tool that doesn't slow down our development process!"**
|
|
989
|
-
> — Emma Thompson, Indie Developer
|
|
990
|
-
|
|
991
|
-
---
|
|
992
|
-
|
|
993
|
-
## 🤝 Community & Support
|
|
994
|
-
|
|
995
|
-
### **Join the i18ntk Community**
|
|
996
|
-
|
|
997
|
-
- 🐛 **[Report Issues](https://github.com/vladnoskv/i18ntk/issues)** - Help us improve
|
|
998
|
-
- 💬 **[Discussions](https://github.com/vladnoskv/i18ntk/discussions)** - Share ideas and ask questions
|
|
999
|
-
- 📖 **[Documentation](./docs)** - Comprehensive guides and tutorials
|
|
1000
|
-
- 🏆 **[Contribute](https://github.com/vladnoskv/i18ntk/blob/main/CONTRIBUTING.md)** - Join our development team
|
|
1001
|
-
|
|
1002
|
-
### **Stay Connected**
|
|
1003
|
-
|
|
1004
|
-
- 🌟 **[Star on GitHub](https://github.com/vladnoskv/i18ntk)** - Show your support
|
|
1005
|
-
- 📧 **Newsletter** - Get updates on new features
|
|
1006
|
-
- 🐦 **Twitter** - Follow for tips and updates
|
|
1007
|
-
|
|
1008
|
-
### **Professional Support**
|
|
1009
|
-
|
|
1010
|
-
- 🏢 **Enterprise Support** - 24/7 technical assistance
|
|
1011
|
-
- 🎯 **Custom Training** - Team workshops and onboarding
|
|
1012
|
-
- 🔧 **Integration Services** - Custom solutions for your needs
|
|
1013
|
-
|
|
1014
|
-
---
|
|
1015
|
-
|
|
1016
|
-
## 📈 Performance Benchmarks
|
|
1017
|
-
|
|
1018
|
-
<div align="center">
|
|
1019
|
-
|
|
1020
|
-
### **🚀 Real-World Performance Tests**
|
|
1021
|
-
|
|
1022
|
-
| Operation | i18ntk v1.10.0 | Traditional Tools | Improvement |
|
|
1023
|
-
|-----------|----------------|-------------------|-------------|
|
|
1024
|
-
| **🔍 Analyze 10k keys** | 0.8s ⚡ | 45s 🐌 | **98.2x faster** |
|
|
1025
|
-
| **✅ Validate 50k keys** | 2.1s ⚡ | 120s 🐌 | **57x faster** |
|
|
1026
|
-
| **🔎 Scan 100 files** | 1.2s ⚡ | 30s 🐌 | **25x faster** |
|
|
1027
|
-
| **🔧 Fix 1k translations** | 3.5s ⚡ | 300s 🐌 | **85.7x faster** |
|
|
1028
|
-
| **💾 Create encrypted backup** | 1.8s ⚡ | 45s 🐌 | **25x faster** |
|
|
1029
|
-
| **📊 Generate HTML report** | 2.3s ⚡ | 180s 🐌 | **78x faster** |
|
|
1030
|
-
|
|
1031
|
-
*Benchmark and real world results may differ. Results may vary depending on the size of the project, the number of files, and the number of keys.
|
|
1032
|
-
|
|
1033
|
-
---
|
|
1034
|
-
|
|
1035
|
-
### **📊 Memory Usage Comparison**
|
|
1036
|
-
|
|
1037
|
-
<div align="center">
|
|
1038
|
-
|
|
1039
|
-
| Metric | i18ntk v1.10.0 | Traditional Tools | Savings |
|
|
1040
|
-
|--------|----------------|-------------------|---------|
|
|
1041
|
-
| **Peak Memory** | <2MB | 50-200MB | **96% less** |
|
|
1042
|
-
| **Idle Memory** | <10MB | 100-500MB | **95% less** |
|
|
1043
|
-
| **Bundle Size** | 315KB | 5-50MB | **99% smaller** |
|
|
1044
|
-
|
|
1045
|
-
</div>
|
|
1046
|
-
|
|
1047
|
-
---
|
|
1048
|
-
|
|
1049
|
-
### **⚡ Startup Time Comparison**
|
|
1050
|
-
|
|
1051
|
-
| Tool | Cold Start | Warm Start | Memory Footprint |
|
|
1052
|
-
|------|------------|------------|------------------|
|
|
1053
|
-
| **i18ntk v1.10.0** | 0.15s ⚡ | 0.02s ⚡ | 8MB |
|
|
1054
|
-
| **Traditional i18n tools** | 2-5s 🐌 | 0.5-2s 🐌 | 100-500MB |
|
|
1055
|
-
| **Manual process** | N/A | N/A | Variable |
|
|
1056
|
-
|
|
1057
|
-
---
|
|
1058
|
-
|
|
1059
|
-
### **🎯 CI/CD Performance Impact**
|
|
1060
|
-
|
|
1061
|
-
```yaml
|
|
1062
|
-
# Before: Slow CI/CD pipeline
|
|
1063
|
-
- name: Run i18n analysis
|
|
1064
|
-
run: traditional-tool analyze --input locales/
|
|
1065
|
-
# Takes 2-5 minutes, often fails
|
|
1066
|
-
|
|
1067
|
-
# After: Lightning-fast CI/CD
|
|
1068
|
-
- name: Run i18n analysis
|
|
1069
|
-
run: npx i18ntk analyze --output json
|
|
1070
|
-
# Takes 15 seconds, always reliable
|
|
1071
|
-
```
|
|
1072
|
-
|
|
1073
|
-
**Result:** **CI/CD pipelines 20x faster** with zero failures
|
|
1074
|
-
|
|
1075
|
-
</div></search>
|
|
1076
|
-
|
|
1077
|
-
---
|
|
1078
|
-
|
|
1079
|
-
## 🎯 Roadmap
|
|
1080
|
-
|
|
1081
|
-
### **Coming Soon in v1.11.0**
|
|
1082
|
-
- 🤖 **AI-Powered Translation** - Automatic translation suggestions
|
|
1083
|
-
- 🔗 **API Integrations** - Connect with translation services
|
|
1084
|
-
- 📊 **Advanced Analytics** - Translation quality metrics
|
|
1085
|
-
|
|
1086
|
-
### **Future Vision**
|
|
1087
|
-
- 🎨 **Visual Translation Editor** - WYSIWYG translation interface
|
|
1088
|
-
- 🧪 **Automated Testing** - Translation validation in CI/CD
|
|
1089
|
-
- 🌍 **Global Translation Network** - Community-powered translations
|
|
1090
|
-
- 🤝 **Enterprise Features** - SSO, audit logs, compliance tools
|
|
1091
|
-
|
|
1092
|
-
---
|
|
1093
|
-
|
|
1094
|
-
## 📄 License & Legal
|
|
1095
|
-
|
|
1096
|
-
**MIT License** - Free for personal and commercial use
|
|
1097
|
-
|
|
1098
|
-
```text
|
|
1099
|
-
Copyright (c) 2025 Vladimir Noskov
|
|
1100
|
-
|
|
1101
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1102
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
1103
|
-
in the Software without restriction, including without limitation the rights
|
|
1104
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1105
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
1106
|
-
furnished to do so, subject to the following conditions:
|
|
1107
|
-
|
|
1108
|
-
The above copyright notice and this permission notice shall be included in all
|
|
1109
|
-
copies or substantial portions of the Software.
|
|
1110
|
-
```
|
|
1111
|
-
|
|
1112
|
-
---
|
|
1113
|
-
|
|
1114
|
-
<div align="center">
|
|
1115
|
-
|
|
1116
|
-
---
|
|
1117
|
-
|
|
1118
|
-
## 🎉 **Ready to Transform Your i18n Workflow?**
|
|
1119
|
-
|
|
1120
|
-
### **🚀 Start Your Journey Today**
|
|
1121
|
-
|
|
1122
|
-
<div align="center">
|
|
1123
|
-
|
|
1124
|
-
| Action | Time | Impact |
|
|
1125
|
-
|--------|------|---------|
|
|
1126
|
-
| **Install i18ntk** | 30 seconds | Zero learning curve |
|
|
1127
|
-
| **Initialize project** | 60 seconds | Complete i18n setup |
|
|
1128
|
-
| **First analysis** | 15 seconds | Full translation health check |
|
|
1129
|
-
| **Total Time** | **< 2 minutes** | **Professional i18n infrastructure** |
|
|
1130
|
-
|
|
1131
|
-
</div>
|
|
1132
|
-
|
|
1133
|
-
---
|
|
1134
|
-
|
|
1135
|
-
### **💡 Why Wait? Join 2000+ Developers Who Already Use i18ntk**
|
|
1136
|
-
|
|
1137
|
-
```bash
|
|
1138
|
-
# Your future workflow - just 3 commands:
|
|
1139
|
-
npm install -g i18ntk
|
|
1140
|
-
i18ntk init
|
|
1141
|
-
i18ntk analyze
|
|
1142
|
-
|
|
1143
|
-
# That's it! Your i18n is now enterprise-ready.
|
|
1144
|
-
```
|
|
1145
|
-
|
|
1146
|
-
---
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
### **🎯 Your Next Steps**
|
|
1150
|
-
|
|
1151
|
-
<div align="center">
|
|
1152
|
-
|
|
1153
|
-
#### **For Individual Developers**
|
|
1154
|
-
1. **[📦 Install i18ntk](#-installation)** (30 seconds)
|
|
1155
|
-
2. **[⚡ Try the Quick Start](#-quick-start)** (2 minutes)
|
|
1156
|
-
3. **[📚 Explore Documentation](#-documentation)** (as needed)
|
|
1157
|
-
|
|
1158
|
-
#### **For Open Source Projects**
|
|
1159
|
-
1. **[🤝 Join Community](#)** (Get involved)
|
|
1160
|
-
2. **[📖 Contribute](#)** (Help improve i18ntk)
|
|
1161
|
-
3. **[🌍 Share Globally](#)** (Reach international users)
|
|
1162
|
-
|
|
1163
|
-
</div>
|
|
1164
|
-
|
|
1165
|
-
---
|
|
1166
|
-
|
|
1167
|
-
### **🔥 Don't Miss Out on the Future of i18n**
|
|
1168
|
-
|
|
1169
|
-
**i18ntk v1.10.0** is the most advanced i18n toolkit ever built. Join the revolution and:
|
|
1170
|
-
|
|
1171
|
-
- ⚡ **Save 40+ hours** per month on translation work
|
|
1172
|
-
- 🚀 **Deploy 10x faster** with automated workflows
|
|
1173
|
-
- 🛡️ **Sleep better** with enterprise-grade security
|
|
1174
|
-
- 🌍 **Scale globally** without translation headaches
|
|
1175
|
-
|
|
1176
|
-
---
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
## **🚀 Ready to Supercharge Your i18n?**
|
|
1180
|
-
|
|
1181
|
-
**[📦 Install Now](#-installation)** • **[⚡ Quick Start](#-quick-start)** • **[📚 Documentation](#-documentation)**
|
|
1182
|
-
|
|
1183
|
-
---
|
|
1184
|
-
|
|
1185
|
-
**Made with ❤️ for the global developer community**
|
|
1186
|
-
|
|
1187
|
-
**v1.10.0** • **Last Updated:** 2025-08-22 • **[GitHub](https://github.com/vladnoskv/i18ntk)** • **[Documentation](./docs)**
|
|
1188
|
-
|
|
1189
|
-
**#i18n #internationalization #localization #javascript #typescript #python #java #php #go #developer-tools**
|
|
1190
|
-
|
|
1191
|
-
</div>
|
|
1
|
+
# i18ntk v2
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/i18ntk)
|
|
8
|
+
[](https://www.npmjs.com/package/i18ntk)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](https://www.npmjs.com/package/i18ntk)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://socket.dev/npm/package/i18ntk/overview/2.0.0)
|
|
13
|
+
|
|
14
|
+
Zero-dependency i18n toolkit for initialization, scanning, analysis, validation, and completion workflows.
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g i18ntk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# interactive menu
|
|
28
|
+
i18ntk
|
|
29
|
+
|
|
30
|
+
# direct workflow
|
|
31
|
+
i18ntk --command=init
|
|
32
|
+
i18ntk --command=analyze --no-prompt
|
|
33
|
+
i18ntk --command=validate --no-prompt
|
|
34
|
+
i18ntk --command=complete --no-prompt
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## v2 Command Model
|
|
38
|
+
|
|
39
|
+
Primary CLI commands:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
i18ntk --command=init
|
|
43
|
+
i18ntk --command=analyze
|
|
44
|
+
i18ntk --command=validate
|
|
45
|
+
i18ntk --command=usage
|
|
46
|
+
i18ntk --command=scanner
|
|
47
|
+
i18ntk --command=sizing
|
|
48
|
+
i18ntk --command=complete
|
|
49
|
+
i18ntk --command=summary
|
|
50
|
+
i18ntk --command=debug
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Standalone binaries:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
i18ntk-init
|
|
57
|
+
i18ntk-analyze
|
|
58
|
+
i18ntk-validate
|
|
59
|
+
i18ntk-usage
|
|
60
|
+
i18ntk-scanner
|
|
61
|
+
i18ntk-sizing
|
|
62
|
+
i18ntk-complete
|
|
63
|
+
i18ntk-summary
|
|
64
|
+
i18ntk-doctor
|
|
65
|
+
i18ntk-fixer
|
|
66
|
+
i18ntk-backup
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Backup helper:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
i18ntk-backup --help
|
|
73
|
+
i18ntk-backup create ./locales
|
|
74
|
+
i18ntk-backup list
|
|
75
|
+
i18ntk-backup restore <backup-file>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Common Flags
|
|
79
|
+
|
|
80
|
+
Most commands support:
|
|
81
|
+
|
|
82
|
+
- `--source-dir <path>`
|
|
83
|
+
- `--i18n-dir <path>`
|
|
84
|
+
- `--output-dir <path>`
|
|
85
|
+
- `--source-language <code>`
|
|
86
|
+
- `--ui-language <code>`
|
|
87
|
+
- `--no-prompt`
|
|
88
|
+
- `--dry-run`
|
|
89
|
+
- `--help`
|
|
90
|
+
|
|
91
|
+
## Configuration
|
|
92
|
+
|
|
93
|
+
i18ntk reads project settings from `.i18ntk-config` in the project root.
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"version": "2.0.0",
|
|
100
|
+
"sourceDir": "./locales",
|
|
101
|
+
"i18nDir": "./locales",
|
|
102
|
+
"outputDir": "./i18ntk-reports",
|
|
103
|
+
"sourceLanguage": "en",
|
|
104
|
+
"defaultLanguages": ["de", "es", "fr", "ru"],
|
|
105
|
+
"setup": {
|
|
106
|
+
"completed": true
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Runtime API
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { initRuntime, t, setLanguage, getLanguage } from 'i18ntk/runtime';
|
|
115
|
+
|
|
116
|
+
initRuntime({
|
|
117
|
+
baseDir: './locales',
|
|
118
|
+
language: 'en',
|
|
119
|
+
fallbackLanguage: 'en',
|
|
120
|
+
preload: true
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
console.log(t('common.hello'));
|
|
124
|
+
setLanguage('fr');
|
|
125
|
+
console.log(getLanguage());
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Docs
|
|
129
|
+
|
|
130
|
+
- [Documentation Index](docs/README.md)
|
|
131
|
+
- [API Reference](docs/api/API_REFERENCE.md)
|
|
132
|
+
- [Configuration Guide](docs/api/CONFIGURATION.md)
|
|
133
|
+
- [Runtime API Guide](docs/runtime.md)
|
|
134
|
+
- [Scanner Guide](docs/scanner-guide.md)
|
|
135
|
+
- [Environment Variables](docs/environment-variables.md)
|
|
136
|
+
- [Migration Guide v2.0.0](docs/migration-guide-v2.0.0.md)
|
|
137
|
+
- [Release Runbook](DEVUPDATE.md)
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|