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