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.
Files changed (108) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +141 -1191
  3. package/main/i18ntk-analyze.js +65 -84
  4. package/main/i18ntk-backup-class.js +420 -0
  5. package/main/i18ntk-backup.js +3 -3
  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 +77 -26
  11. package/main/i18ntk-java.js +27 -32
  12. package/main/i18ntk-js.js +70 -68
  13. package/main/i18ntk-manage.js +129 -30
  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 +9 -404
  18. package/main/i18ntk-sizing.js +6 -6
  19. package/main/i18ntk-summary.js +21 -18
  20. package/main/i18ntk-ui.js +11 -10
  21. package/main/i18ntk-usage.js +54 -18
  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 -29
  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 +117 -117
  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 +157 -161
  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 +18 -18
  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 +73 -104
  86. package/utils/config-manager.js +204 -171
  87. package/utils/config.js +5 -4
  88. package/utils/env-manager.js +249 -263
  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/mini-commander.js +179 -0
  94. package/utils/missing-key-validator.js +5 -5
  95. package/utils/plugin-loader.js +40 -29
  96. package/utils/prompt.js +14 -44
  97. package/utils/safe-json.js +40 -0
  98. package/utils/secure-errors.js +3 -3
  99. package/utils/security-check-improved.js +390 -0
  100. package/utils/security-config.js +5 -5
  101. package/utils/security-fixed.js +607 -0
  102. package/utils/security.js +652 -602
  103. package/utils/setup-enforcer.js +136 -44
  104. package/utils/setup-validator.js +33 -32
  105. package/utils/ultra-performance-optimizer.js +11 -9
  106. package/utils/watch-locales.js +2 -1
  107. package/utils/prompt-fixed.js +0 -55
  108. package/utils/security-check.js +0 -454
package/README.md CHANGED
@@ -1,1191 +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.2)](https://socket.dev/npm/package/i18ntk/overview/1.10.2)
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.2** - 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
- # 6. Mangage Mre
63
- ```
64
-
65
- That's it! Your i18n infrastructure is ready. 🎉
66
-
67
- > **🚨 v1.10.2 Update**: Fresh installs now work out-of-the-box! We've fixed the default `projectRoot` path from `"./"` to `"/"` when resetting settings. No more configuration issues on first run!
68
- >
69
- > **Migration Note**: If you're upgrading from v1.10.1 or earlier, your existing `projectRoot` settings will remain unchanged. Only new installations or manual resets will use the improved default.
70
-
71
- ## 🎯 Why Choose i18ntk?
72
-
73
- | Feature | i18ntk v1.10.0 | Traditional Tools | Manual Process |
74
- |---------|----------------|-------------------|----------------|
75
- | **⚡ Speed** | 15.38ms (200k keys) | 2-5 minutes | Hours |
76
- | **🧠 Memory** | <2MB | 50-200MB | Variable |
77
- | **📦 Size** | 315KB packed | 5-50MB | N/A |
78
- | **🔗 Dependencies** | **ZERO** | 10-50 packages | Zero |
79
- | **🎯 Framework Support** | Auto-detect 8+ frameworks | Manual config | Manual |
80
- | **🔒 Security** | AES-256 + PIN | Basic | None |
81
- | **🌍 Languages** | 7 UI languages | Usually 1-2 | Manual |
82
- | **🤖 CI/CD Ready** | ✅ JSON output | ❌ Manual | ❌ |
83
-
84
- **i18ntk v1.10.0 is 97% faster than traditional i18n tools while using 98% less memory.**
85
-
86
- ## 🌟 Core Features
87
-
88
- ### 🚀 **Ultra-Fast Runtime API**
89
- The most advanced, framework-agnostic translation runtime ever built.
90
-
91
- ```typescript
92
- // Works with ANY framework - React, Vue, Angular, Svelte, or vanilla JS
93
- import { initRuntime, t } from 'i18ntk/runtime';
94
-
95
- initRuntime({
96
- baseDir: './locales',
97
- language: 'en'
98
- });
99
-
100
- // Use anywhere in your app
101
- const greeting = t('welcome.message', { name: 'World' });
102
- ```
103
-
104
- **✨ What's New in v1.10.0:**
105
- - ⚡ **97% Performance Boost** - 15.38ms for 200k keys
106
- - 🎯 **Enhanced TypeScript Support** - Full type inference and autocomplete
107
- - 🔍 **Smart Framework Detection** - Auto-detects Next.js, Nuxt.js, SvelteKit
108
- - 🧠 **Intelligent Caching** - Reduced memory footprint with persistent caching
109
- - 🔄 **Hot Reloading** - Update translations without page reload
110
-
111
- ### 🎯 **AI-Powered Translation Scanner**
112
- Automatically finds hardcoded text in your codebase and suggests translations.
113
-
114
- ```bash
115
- # Scan your entire codebase in seconds
116
- i18ntk scanner --source ./src --framework react
117
-
118
- # Interactive fixing with AI suggestions
119
- i18ntk fixer --interactive
120
- ```
121
-
122
- **Features:**
123
- - 🤖 **AI-Powered Detection** - Finds text that should be translated (Coming soon!)
124
- - 🎨 **Framework-Aware** - Understands React, Vue, Angular patterns
125
- - 🌍 **Multi-Language Support** - Works with 7 built-in UI languages
126
- - ⚡ **Lightning Fast** - Scans 200k+ keys in milliseconds
127
-
128
- ### 🔒 **Military-Grade Security**
129
- Enterprise-level security with zero vulnerabilities.
130
-
131
- ```bash
132
- # Secure your translations with PIN protection
133
- i18ntk backup create --encrypt
134
-
135
- # Encrypted configuration storage
136
- # AES-256-GCM encryption with PBKDF2 key derivation
137
- ```
138
-
139
- **Security Features:**
140
- - 🔐 **PIN Protection** - Admin authentication for sensitive operations
141
- - 🛡️ **Zero Dependencies** - No security vulnerabilities from third-party packages
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
- | ![Framework Detection](docs/screenshots/I18NTK-FRAMEWORK.PNG) | ![Main Menu](docs/screenshots/I18NTK-MENU.PNG) |
910
-
911
- | **Initialization** | **Initilization Language Select** |
912
- |:------------------:|:---------------------------------:|
913
- | ![Initialization](docs/screenshots/I18NTK-INIT.PNG) | ![Init Summary](docs/screenshots/I18NTK-INIT-LANG-SELECT.PNG) |
914
-
915
- | **Language Selection** | **Language Changed** |
916
- |:----------------------:|:--------------------:|
917
- | ![Language Selection](docs/screenshots/I18NTK-LANGUAGE-UI.PNG) | ![Language Changed](docs/screenshots/I18NTK-LANGUAGE-UI-CHANGED.PNG) |
918
-
919
- | **Settings Manager (v1.10.0)** | **Translation Fixer (v1.10.0)** |
920
- |:-----------------------------:|:-------------------------------:|
921
- | ![Settings Manager](docs/screenshots/I18NTK-SETTINGS.PNG) | ![Translation Fixer](docs/screenshots/I18NTK-FIXER.PNG) |
922
-
923
- | **Analyze** | **Complete** | **Usage** |
924
- |:-----------:|:------------:|:----------:|
925
- | ![Analyze](docs/screenshots/I18NTK-ANALYZE.PNG) | ![Complete](docs/screenshots/I18NTK-COMPLETE.PNG) | ![Usage](docs/screenshots/I18NTK-USAGE.PNG) |
926
-
927
- | **Sizing (Overview)** | **Sizing (List)** |
928
- |:---------------------:|:-----------------:|
929
- | ![Sizing](docs/screenshots/I18NTK-SIZING.PNG) | ![Sizing List](docs/screenshots/I18NTK-SIZING-LIST.PNG) |
930
-
931
- | **Validate** | **Validate End** |
932
- |:-----------:|:-----------------:|
933
- | ![Validate](docs/screenshots/I18NTK-VALIDATE.PNG) | ![Validate End](docs/screenshots/I18NTK-VALIDATE-END.PNG) |
934
-
935
- | **Summary** | **Summary Report** | **Summary Completed** |
936
- |:-----------:|:-----------------:|:-----------------:|
937
- | ![Summary Start](docs/screenshots/I18NTK-SUMMARY-1.PNG) | ![Summary End](docs/screenshots/I18NTK-SUMMARY-2.PNG) | ![Summary Options](docs/screenshots/I18NTK-SUMMARY-3.PNG) |
938
-
939
-
940
- | **Admin Pin** | **Admin Pin Setup** | **Admin Pin Success** | **Admin Pin Ask** |
941
- |:-----------:|:-----------------:|:-----------------:|:-----------------:|
942
- | ![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) |
943
-
944
-
945
- | **Delete Options** | **Delete Full** | **Delete None** |
946
- |:------------------:|:------------------:|:------------------:|
947
- | ![Delete Options](docs/screenshots/I18NTK-DELETE-CHOOSE.PNG) | ![Delete Full](docs/screenshots/I18NTK-DELETE-FULL.PNG) | ![Delete None](docs/screenshots/I18NTK-DELETE-NONE.PNG) |
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
+ ![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