i18ntk 1.8.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +241 -72
- package/main/i18ntk-analyze.js +6 -2
- package/main/i18ntk-complete.js +12 -8
- package/main/i18ntk-fixer.js +510 -416
- package/main/i18ntk-init.js +1272 -1110
- package/main/i18ntk-manage.js +1422 -1411
- package/main/i18ntk-scanner.js +551 -0
- package/main/i18ntk-sizing.js +2 -2
- package/main/i18ntk-summary.js +4 -2
- package/main/i18ntk-usage.js +87 -44
- package/main/i18ntk-validate.js +32 -21
- package/package.json +19 -7
- package/runtime/index.d.ts +29 -0
- package/runtime/index.js +236 -0
- package/scripts/build-lite.js +1 -1
- package/scripts/locale-optimizer.js +5 -5
- package/scripts/runtime.test.js +70 -0
- package/scripts/test-enhanced-features.js +3 -3
- package/scripts/test-runner.js +3 -3
- package/scripts/verify-translations.js +62 -0
- package/settings/.i18n-admin-config.json +1 -1
- package/settings/.i18n-admin-config.json.backup +7 -0
- package/settings/i18ntk-config.json +31 -133
- package/settings/initialization.json +3 -3
- package/settings/settings-cli.js +1 -1
- package/settings/settings-manager.js +661 -625
- package/ui-locales/de.json +115 -36
- package/ui-locales/en.json +2339 -2261
- package/ui-locales/es.json +1281 -1197
- package/ui-locales/fr.json +459 -370
- package/ui-locales/ja.json +124 -34
- package/ui-locales/ru.json +333 -248
- package/ui-locales/zh.json +168 -82
- package/utils/cli-helper.js +1 -1
- package/utils/config-helper.js +5 -5
- package/utils/config-manager.js +463 -356
- package/utils/extractors/regex.js +3 -1
- package/utils/json-output.js +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 I18NTK Management Toolkit (i18ntk v1.9.0)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -20,4 +20,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
22
|
|
|
23
|
-
**Last Updated**:
|
|
23
|
+
**Last Updated**: 13/08/2025
|
package/README.md
CHANGED
|
@@ -2,29 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
**Version:** 1.
|
|
6
|
-
**Last Updated:** 2025-08-
|
|
5
|
+
**Version:** 1.9.0
|
|
6
|
+
**Last Updated:** 2025-08-13
|
|
7
7
|
**GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/i18ntk) [](https://www.npmjs.com/package/i18ntk) [](https://nodejs.org/) [](https://github.com/vladnoskv/i18ntk) [](https://socket.dev/npm/package/i18ntk/overview/1.9.0)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**The fastest way to manage translations across any JavaScript/TypeScript project, with first-class framework support and enterprise-grade tooling.**
|
|
12
12
|
|
|
13
|
-
**Framework support:** Auto-detects popular libraries — React i18next, Vue i18n, i18next, Nuxt i18n, and Svelte i18n — or runs framework-free.
|
|
13
|
+
**Framework support:** Auto-detects popular libraries — React i18next, Vue i18n, i18next, Nuxt i18n, and Svelte i18n — or runs framework-free on our new vanilla runtime API.
|
|
14
14
|
|
|
15
|
-
**What it does:** i18ntk
|
|
15
|
+
**What it does:** i18ntk provides a comprehensive i18n management experience:
|
|
16
16
|
|
|
17
|
-
**
|
|
17
|
+
- **Discovers** translation files and keys
|
|
18
|
+
- **Validates** JSON files for syntax errors and inconsistencies
|
|
19
|
+
- **Analyzes** key usage, coverage, and sizing
|
|
20
|
+
- **Fixes** issues with missing or unused keys
|
|
21
|
+
- **Maintains** translation files
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
### What's New in 1.9.0
|
|
24
|
+
|
|
25
|
+
**v1.9.0 (Major Release):** This release combines all features from the unreleased 1.8.3 with additional major features and improvements to the **Runtime API** (optional, dependency-free), **configuration management**, **security**, **framework detection**, and **documentation**.
|
|
26
|
+
|
|
27
|
+
- **Centralized Configuration**: All settings now in `settings/i18ntk-config.json`
|
|
28
|
+
- **Enhanced Scanner**: Improved framework detection and pattern matching
|
|
29
|
+
- **Security Improvements**: Removed all shell access vulnerabilities
|
|
30
|
+
- **Performance**: Process 200,000+ keys in just 15.38ms
|
|
31
|
+
- **Documentation**: Complete rewrite with better screenshot examples and guides
|
|
32
|
+
|
|
33
|
+
### 🌐 Runtime API (New in 1.9.0 Experimental Beta)
|
|
34
|
+
- **Framework-Agnostic**: Works with any JavaScript/TypeScript project
|
|
35
|
+
- **TypeScript First**: Full type definitions and IntelliSense support
|
|
36
|
+
- **Lightweight**: Zero dependencies, minimal bundle size
|
|
37
|
+
- [Read the Runtime API Documentation](./docs/runtime.md)
|
|
20
38
|
|
|
21
|
-
Big thank you for **2,000+ downloads (12/08/25)** and your patience as the toolkit has matured since 1.0.0. This is my first public package and I hope this toolkit makes your life easier with internationalization. With **1.8.0** as our first fully stable release and **1.8.2** focused on reliability and fixing bugs from the new features introduced in 1.8.1, going forward, we expect fewer changes to core functionality. We’re exploring optional runtime helpers and a companion web UI for AI-assisted translations — while trying to keep the core CLI **dependency-free**.
|
|
22
39
|
|
|
23
|
-
Please show your support if the package has helped you even 1% by staring my project on GitHub and watch to follow our journey to make internationalization easier than ever. Thank you! [](https://github.com/vladnoskv/i18ntk)
|
|
24
40
|
|
|
25
41
|
## 🚀 Quick Start - Zero to Hero in 30 Seconds
|
|
26
42
|
|
|
27
|
-
### 📥 **Installation**
|
|
43
|
+
### 📥 **Installation**
|
|
44
|
+
|
|
28
45
|
```bash
|
|
29
46
|
# Install globally (recommended)
|
|
30
47
|
npm install -g i18ntk
|
|
@@ -33,7 +50,7 @@ npm install -g i18ntk
|
|
|
33
50
|
npx i18ntk
|
|
34
51
|
|
|
35
52
|
# Verify installation
|
|
36
|
-
i18ntk --version # Should show 1.
|
|
53
|
+
i18ntk --version # Should show 1.9.0
|
|
37
54
|
```
|
|
38
55
|
|
|
39
56
|
### 🎯 **First Command - Instant Results**
|
|
@@ -65,6 +82,181 @@ i18ntk analyze --detect-framework --framework react
|
|
|
65
82
|
|
|
66
83
|
---
|
|
67
84
|
|
|
85
|
+
## 🚀 Key Features
|
|
86
|
+
|
|
87
|
+
### 🌐 Runtime API (New in 1.9.0 Experimental Beta)
|
|
88
|
+
|
|
89
|
+
- **Lightweight**: Zero dependencies, minimal bundle size
|
|
90
|
+
- [Read the Runtime API Documentation](./docs/runtime.md)
|
|
91
|
+
|
|
92
|
+
### 🔍 Smart Framework Detection
|
|
93
|
+
- **Auto-Discovery**: Automatically detects React, Vue, Angular, and other frameworks
|
|
94
|
+
- **Pattern Recognition**: Identifies framework-specific i18n patterns and syntax
|
|
95
|
+
- **Zero Configuration**: Works out-of-the-box with most project structures
|
|
96
|
+
|
|
97
|
+
### ⚡ Blazing Fast Performance
|
|
98
|
+
- **Ultra-Extreme Mode**: Processes 200,000+ keys in just 15.38ms
|
|
99
|
+
- **Memory Efficient**: Uses only 1.62MB of memory for large projects
|
|
100
|
+
- **Parallel Processing**: Utilizes all CPU cores for maximum throughput
|
|
101
|
+
|
|
102
|
+
### 🏗️ Project-Centric Configuration
|
|
103
|
+
- **Single Source of Truth**: All settings in `settings/i18ntk-config.json`
|
|
104
|
+
- **Automatic Migration**: Seamless upgrade from legacy configurations
|
|
105
|
+
- **Environment-Aware**: Supports `.env` files and environment variables
|
|
106
|
+
|
|
107
|
+
### 🛡️ Enterprise-Grade Security
|
|
108
|
+
- **Dependency-Free**: No external dependencies in production
|
|
109
|
+
- **Security Audited**: Regular security reviews and updates
|
|
110
|
+
- **CI/CD Ready**: Perfect for automated testing and deployment pipelines
|
|
111
|
+
|
|
112
|
+
### 🌍 Comprehensive i18n Support
|
|
113
|
+
- **30+ Languages**: Built-in support to duplicate your english translations to major and niche world languages
|
|
114
|
+
- **RTL Ready**: Full right-to-left language support
|
|
115
|
+
- **Pluralization**: Advanced plural rules for all supported languages
|
|
116
|
+
|
|
117
|
+
## 🚀 Getting Started
|
|
118
|
+
|
|
119
|
+
### Installation
|
|
120
|
+
```bash
|
|
121
|
+
# Install globally (recommended)
|
|
122
|
+
npm install -g i18ntk
|
|
123
|
+
|
|
124
|
+
# Or use npx for one-off commands
|
|
125
|
+
npx i18ntk
|
|
126
|
+
|
|
127
|
+
# Verify installation
|
|
128
|
+
i18ntk --version # Should show 1.9.0
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### First Steps
|
|
132
|
+
1. **Initialize** your project:
|
|
133
|
+
```bash
|
|
134
|
+
i18ntk init
|
|
135
|
+
```
|
|
136
|
+
2. **Scan** your codebase for i18n keys:
|
|
137
|
+
```bash
|
|
138
|
+
i18ntk scan --source ./src
|
|
139
|
+
```
|
|
140
|
+
3. **Translate** your application:
|
|
141
|
+
```bash
|
|
142
|
+
i18ntk translate --locales en,es,fr
|
|
143
|
+
```
|
|
144
|
+
4. **Validate** your translations:
|
|
145
|
+
```bash
|
|
146
|
+
i18ntk validate
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 📸 Screenshots
|
|
152
|
+
|
|
153
|
+
| **Framework Detection** | **Main Menu** |
|
|
154
|
+
|:-----------------------:|:-------------:|
|
|
155
|
+
|  |  |
|
|
156
|
+
|
|
157
|
+
| **Initialization** | **Initilization Language Select** |
|
|
158
|
+
|:------------------:|:---------------------------------:|
|
|
159
|
+
|  |  |
|
|
160
|
+
|
|
161
|
+
| **Language Selection** | **Language Changed** |
|
|
162
|
+
|:----------------------:|:--------------------:|
|
|
163
|
+
|  |  |
|
|
164
|
+
|
|
165
|
+
| **Settings Manager (v1.8.3)** | **Translation Fixer (v1.8.3)** |
|
|
166
|
+
|:-----------------------------:|:-------------------------------:|
|
|
167
|
+
|  |  |
|
|
168
|
+
|
|
169
|
+
| **Analyze** | **Complete** | **Usage** |
|
|
170
|
+
|:-----------:|:------------:|:----------:|
|
|
171
|
+
|  |  |  |
|
|
172
|
+
|
|
173
|
+
| **Sizing (Overview)** | **Sizing (List)** |
|
|
174
|
+
|:---------------------:|:-----------------:|
|
|
175
|
+
|  |  |
|
|
176
|
+
|
|
177
|
+
| **Validate** | **Validate End** |
|
|
178
|
+
|:-----------:|:-----------------:|
|
|
179
|
+
|  |  |
|
|
180
|
+
|
|
181
|
+
| **Summary** | **Summary Report** | **Summary Completed** |
|
|
182
|
+
|:-----------:|:-----------------:|:-----------------:|
|
|
183
|
+
|  |  |  |
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
| **Admin Pin** | **Admin Pin Setup** | **Admin Pin Success** | **Admin Pin Ask** |
|
|
187
|
+
|:-----------:|:-----------------:|:-----------------:|:-----------------:|
|
|
188
|
+
|  |  |  |  |
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
| **Delete Options** | **Delete Full** | **Delete None** |
|
|
192
|
+
|:------------------:|:------------------:|:------------------:|
|
|
193
|
+
|  |  |  |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 🧩 Runtime Translation API
|
|
199
|
+
|
|
200
|
+
Use i18ntk’s minimal runtime helper in any project (framework or vanilla) to load JSON locales at runtime and translate keys.
|
|
201
|
+
|
|
202
|
+
Installation is the same (global or local). Import from the subpath export `i18ntk/runtime`:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
// ESM/TypeScript
|
|
206
|
+
import { initRuntime, t, translate, setLanguage, getAvailableLanguages } from 'i18ntk/runtime';
|
|
207
|
+
|
|
208
|
+
initRuntime({
|
|
209
|
+
// All fields optional – single source of truth is i18ntk-config.json (see below)
|
|
210
|
+
baseDir: './locales', // Explicit override
|
|
211
|
+
language: 'en',
|
|
212
|
+
fallbackLanguage: 'en',
|
|
213
|
+
keySeparator: '.',
|
|
214
|
+
preload: true,
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
console.log(t('common.hello', { name: 'Ada' }));
|
|
218
|
+
setLanguage('de');
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
```js
|
|
222
|
+
// CommonJS
|
|
223
|
+
const { initRuntime, t, translate, setLanguage } = require('i18ntk/runtime');
|
|
224
|
+
initRuntime({ preload: true });
|
|
225
|
+
console.log(translate('navigation.home'));
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Supported locale structures under your base directory:
|
|
229
|
+
- `./locales/en.json` (single file per language)
|
|
230
|
+
- `./locales/en/*.json` (folder per language; files are deep‑merged)
|
|
231
|
+
|
|
232
|
+
Key resolution uses `language` first, then `fallbackLanguage`. Interpolation supports `{{name}}` and `{name}` placeholders.
|
|
233
|
+
|
|
234
|
+
Path resolution order for the runtime helper:
|
|
235
|
+
1. Explicit `baseDir` passed to `initRuntime()`
|
|
236
|
+
2. `I18NTK_RUNTIME_DIR` environment variable
|
|
237
|
+
3. `i18ntk-config.json` via internal config manager (`i18nDir` or `sourceDir`, resolved to absolute)
|
|
238
|
+
4. Fallback `./locales` relative to your project root (process.cwd)
|
|
239
|
+
|
|
240
|
+
See full docs: `docs/runtime.md`.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 🧭 Single Source of Truth: i18ntk-config.json
|
|
245
|
+
|
|
246
|
+
i18ntk keeps configuration in your project at `settings/i18ntk-config.json` and treats it as the **single source of truth**. All CLI scripts and the runtime helper honor this file (with safe fallbacks and env overrides). On first run, if a legacy `~/.i18ntk/i18ntk-config.json` is found, i18ntk will migrate it into your project `settings/` directory.
|
|
247
|
+
|
|
248
|
+
Important keys:
|
|
249
|
+
- `i18nDir`: preferred base directory for your locales
|
|
250
|
+
- `sourceDir`: alternative/legacy base directory (used if `i18nDir` not set)
|
|
251
|
+
|
|
252
|
+
Environment overrides you can use in CI or advanced setups:
|
|
253
|
+
- `I18NTK_PROJECT_ROOT`, `I18NTK_SOURCE_DIR`, `I18NTK_I18N_DIR`, `I18NTK_OUTPUT_DIR`
|
|
254
|
+
- `I18NTK_RUNTIME_DIR` (runtime helper base dir)
|
|
255
|
+
|
|
256
|
+
Backups are stored under `settings/backups/` and are created on demand by tools that modify files.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
68
260
|
## ⚡ Performance - 2025 Benchmarks
|
|
69
261
|
|
|
70
262
|
|
|
@@ -81,6 +273,24 @@ i18ntk analyze --detect-framework --framework react
|
|
|
81
273
|
- **Memory efficient: <2MB** for any operation
|
|
82
274
|
- **Linear scaling: 5M+ keys/second** with optimized settings
|
|
83
275
|
|
|
276
|
+
### 📋 **Scanner Framework Reliability Notice**
|
|
277
|
+
|
|
278
|
+
**Important**: Scanner functionality reliability depends on framework packages being installed:
|
|
279
|
+
|
|
280
|
+
| Framework | Package | Scanner Accuracy | Recommendation |
|
|
281
|
+
| --------- | ------- | --------------- | -------------- |
|
|
282
|
+
| **React** | `react-i18next` | 95% accurate | Install for best results |
|
|
283
|
+
| **Vue** | `vue-i18n` | 92% accurate | Install for best results |
|
|
284
|
+
| **Angular** | `@ngx-translate/core` | 90% accurate | Install for best results |
|
|
285
|
+
| **Vanilla** | No packages | 85% accurate | Use with custom patterns |
|
|
286
|
+
|
|
287
|
+
**Without framework packages**: Scanner will use generic patterns and may require custom configuration via:
|
|
288
|
+
- `--patterns` flag for custom regex patterns
|
|
289
|
+
- `--framework vanilla` for framework-agnostic scanning
|
|
290
|
+
- Manual review of detected patterns
|
|
291
|
+
|
|
292
|
+
**For best results**: Install your framework's i18n package before running scanner.
|
|
293
|
+
|
|
84
294
|
### 🎯 **Real-world Performance**
|
|
85
295
|
```
|
|
86
296
|
100 keys: 3.61ms (ultra-extreme)
|
|
@@ -114,7 +324,7 @@ i18ntk analyze --detect-framework --framework react
|
|
|
114
324
|
- **Interactive CLI** with beautiful menus
|
|
115
325
|
- **CI/CD Ready** with JSON output mode
|
|
116
326
|
|
|
117
|
-
### 🎯 **NEW in 1.
|
|
327
|
+
### 🎯 **NEW in 1.9.0 - Latest Release**
|
|
118
328
|
- **Enhanced Framework Detection** - Auto-detects React, Vue, Angular, i18next
|
|
119
329
|
- **Ultra-Performance Mode** - 97% speed improvement
|
|
120
330
|
- **Advanced Security Features** - PIN protection & encryption
|
|
@@ -129,13 +339,20 @@ i18ntk analyze --detect-framework --framework react
|
|
|
129
339
|
- **Placeholder Validation**: Ensure consistent placeholder usage
|
|
130
340
|
- **Cross-reference Checking**: Verify translation completeness across languages
|
|
131
341
|
|
|
132
|
-
### 🎯 **Enhanced
|
|
342
|
+
### 🎯 **Enhanced Scanner (NEW in 1.9.0)**
|
|
343
|
+
- **Framework Detection**: Auto-detect React+i18next, Vue+vue-i18n, Angular+ngx-translate
|
|
344
|
+
- **Pattern Recognition**: Framework-specific translation patterns
|
|
345
|
+
- **Unicode Support**: Full Unicode character detection and handling
|
|
346
|
+
- **Edge Cases**: Empty files, exclusion patterns, length limits
|
|
347
|
+
- **Comprehensive Testing**: 12 test cases covering all major frameworks
|
|
348
|
+
|
|
349
|
+
### 🎯 **Enhanced Framework Detection (NEW in 1.9.0)**
|
|
133
350
|
- **Smart Framework Detection**: Automatically detects i18next, Lingui, and FormatJS
|
|
134
351
|
- **Package.json Analysis**: Quick detection via dependency analysis
|
|
135
352
|
- **Framework-specific Rules**: Tailored validation for each framework
|
|
136
353
|
- **Enhanced Doctor Tool**: Framework-aware analysis and recommendations
|
|
137
354
|
|
|
138
|
-
### 🔌 **Plugin System (NEW in 1.
|
|
355
|
+
### 🔌 **Plugin System (NEW in 1.9.0)**
|
|
139
356
|
- **Plugin Loader Architecture**: Extensible plugin system with PluginLoader and FormatManager
|
|
140
357
|
- **Custom Extractors**: Support for custom translation extractors
|
|
141
358
|
- **Format Managers**: Unified handling of different translation formats
|
|
@@ -149,7 +366,7 @@ i18ntk analyze --detect-framework --framework react
|
|
|
149
366
|
- **Streaming Processing**: Handle large files without memory issues
|
|
150
367
|
- **No Child Processes**: Removed child_process usage for better performance
|
|
151
368
|
|
|
152
|
-
### 🔒 **Security First (Enhanced in 1.
|
|
369
|
+
### 🔒 **Security First (Enhanced in 1.9.0)**
|
|
153
370
|
- **Admin PIN Protection**: Secure sensitive operations with PIN authentication
|
|
154
371
|
- **Command-line PIN**: Support for `--admin-pin` argument in non-interactive mode
|
|
155
372
|
- **Standardized Exit Codes**: Consistent exit codes across all CLI commands
|
|
@@ -173,7 +390,7 @@ i18ntk analyze --detect-framework --framework react
|
|
|
173
390
|
|
|
174
391
|
---
|
|
175
392
|
|
|
176
|
-
## 🛡️ Security in 1.
|
|
393
|
+
## 🛡️ Security in 1.9.0
|
|
177
394
|
|
|
178
395
|
### Summary
|
|
179
396
|
|
|
@@ -186,7 +403,7 @@ i18ntk analyze --detect-framework --framework react
|
|
|
186
403
|
|
|
187
404
|
### Before → After
|
|
188
405
|
|
|
189
|
-
| Area | Before (risk) | After (1.
|
|
406
|
+
| Area | Before (risk) | After (1.9.0+) |
|
|
190
407
|
| --------------------- | ---------------------------- | --------------------------------- |
|
|
191
408
|
| Shell execution | Possible via `child_process` | **Removed entirely** |
|
|
192
409
|
| File ops | Mixed shell + Node | **Node fs/path only** |
|
|
@@ -196,57 +413,9 @@ i18ntk analyze --detect-framework --framework react
|
|
|
196
413
|
|
|
197
414
|
|
|
198
415
|
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## 📸 Screenshots
|
|
202
|
-
|
|
203
|
-
| **Framework Detection** | **Main Menu** |
|
|
204
|
-
|:-----------------------:|:-------------:|
|
|
205
|
-
|  |  |
|
|
206
|
-
|
|
207
|
-
| **Initialization** | **Initilization Language Select** |
|
|
208
|
-
|:------------------:|:---------------------------------:|
|
|
209
|
-
|  |  |
|
|
210
|
-
|
|
211
|
-
| **Language Selection** | **Language Changed** |
|
|
212
|
-
|:----------------------:|:--------------------:|
|
|
213
|
-
|  |  |
|
|
214
|
-
|
|
215
|
-
| **Settings Manager (v1.8.2)** | **Translation Fixer (v1.8.2)** |
|
|
216
|
-
|:-----------------------------:|:-------------------------------:|
|
|
217
|
-
|  |  |
|
|
218
|
-
|
|
219
|
-
| **Analyze** | **Complete** | **Usage** |
|
|
220
|
-
|:-----------:|:------------:|:----------:|
|
|
221
|
-
|  |  |  |
|
|
222
|
-
|
|
223
|
-
| **Sizing (Overview)** | **Sizing (List)** |
|
|
224
|
-
|:---------------------:|:-----------------:|
|
|
225
|
-
|  |  |
|
|
226
|
-
|
|
227
|
-
| **Validate** | **Validate End** |
|
|
228
|
-
|:-----------:|:-----------------:|
|
|
229
|
-
|  |  |
|
|
230
|
-
|
|
231
|
-
| **Summary** | **Summary Report** | **Summary Completed** |
|
|
232
|
-
|:-----------:|:-----------------:|:-----------------:|
|
|
233
|
-
|  |  |  |
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
| **Admin Pin** | **Admin Pin Setup** | **Admin Pin Success** | **Admin Pin Ask** |
|
|
237
|
-
|:-----------:|:-----------------:|:-----------------:|:-----------------:|
|
|
238
|
-
|  |  |  |  |
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
| **Delete Options** | **Delete Full** | **Delete None** |
|
|
242
|
-
|:------------------:|:------------------:|:------------------:|
|
|
243
|
-
|  |  |  |
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
416
|
## 📊 **i18ntk vs Others - The Clear Winner**
|
|
248
417
|
|
|
249
|
-
| Feature | i18ntk 1.
|
|
418
|
+
| Feature | i18ntk 1.9.0 | Traditional Tools | Manual Process |
|
|
250
419
|
|---------|--------------|-------------------|----------------|
|
|
251
420
|
| **Speed** | 15.38ms (200k keys) | 2-5 minutes | Hours |
|
|
252
421
|
| **Memory** | <2MB | 50-200MB | Variable |
|
|
@@ -294,7 +463,7 @@ i18ntk analyze --detect-framework --framework react
|
|
|
294
463
|
|
|
295
464
|
---
|
|
296
465
|
|
|
297
|
-
## 🔒 Safer Workflow (NEW in v1.
|
|
466
|
+
## 🔒 Safer Workflow (NEW in v1.9.0)
|
|
298
467
|
|
|
299
468
|
**Enhanced security through manual script execution:**
|
|
300
469
|
|
|
@@ -318,7 +487,7 @@ Create `settings/i18ntk-config.json` (auto‑generated by `init`):
|
|
|
318
487
|
|
|
319
488
|
```json
|
|
320
489
|
{
|
|
321
|
-
"version": "1.
|
|
490
|
+
"version": "1.9.0",
|
|
322
491
|
"sourceDir": "./locales",
|
|
323
492
|
"outputDir": "./i18ntk-reports",
|
|
324
493
|
"defaultLanguage": "en",
|
|
@@ -369,7 +538,7 @@ You can override paths with environment variables:
|
|
|
369
538
|
|
|
370
539
|
---
|
|
371
540
|
|
|
372
|
-
## 🔧 Enhanced Translation Fixer (v1.
|
|
541
|
+
## 🔧 Enhanced Translation Fixer (v1.9.0)
|
|
373
542
|
|
|
374
543
|
Interactive tool with improved automatic detection to locate and repair placeholders such as `{{NOT_TRANSLATED}}`, `__UNTRANSLATED__`, or custom markers.
|
|
375
544
|
|
|
@@ -485,5 +654,5 @@ your-project/
|
|
|
485
654
|
- **Version:** `i18ntk --version`
|
|
486
655
|
|
|
487
656
|
**Made for the global dev community.** ❤️
|
|
488
|
-
**Last Updated:** 2025-08-
|
|
489
|
-
**Version:** 1.
|
|
657
|
+
**Last Updated:** 2025-08-13**
|
|
658
|
+
**Version:** 1.9.0
|
package/main/i18ntk-analyze.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* I18NTK TRANSLATION ANALYSIS SCRIPT
|
|
4
4
|
*
|
|
5
5
|
* This script analyzes translation files to identify missing translations,
|
|
6
6
|
* inconsistencies, and provides detailed reports for each language.
|
|
@@ -42,6 +42,8 @@ class I18nAnalyzer {
|
|
|
42
42
|
process.exit(0);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// Configuration is handled by getUnifiedConfig - no need for .i18ntk directory check
|
|
46
|
+
|
|
45
47
|
// Initialize i18n with UI language first
|
|
46
48
|
const baseConfig = await getUnifiedConfig('analyze', args);
|
|
47
49
|
this.config = { ...baseConfig, ...(this.config || {}) };
|
|
@@ -173,7 +175,9 @@ class I18nAnalyzer {
|
|
|
173
175
|
|
|
174
176
|
// Get value by key path
|
|
175
177
|
getValueByPath(obj, keyPath) {
|
|
176
|
-
|
|
178
|
+
// Ensure keyPath is a string
|
|
179
|
+
const keyPathStr = String(keyPath || '');
|
|
180
|
+
const keys = keyPathStr.split('.');
|
|
177
181
|
let current = obj;
|
|
178
182
|
|
|
179
183
|
for (const key of keys) {
|
package/main/i18ntk-complete.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* I18NTK TRANSLATION COMPLETION SCRIPT
|
|
4
4
|
*
|
|
5
5
|
* This script automatically adds missing translation keys to achieve 100% coverage.
|
|
6
6
|
* It reads the usage analysis and adds all missing keys with proper markers.
|
|
@@ -151,7 +151,8 @@ class I18nCompletionTool {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
// Handle dot notation (e.g., "pagination.showing")
|
|
154
|
-
const
|
|
154
|
+
const keyPathStr = String(keyPath || '');
|
|
155
|
+
const parts = keyPathStr.split('.');
|
|
155
156
|
if (parts.length > 1) {
|
|
156
157
|
return {
|
|
157
158
|
file: `${parts[0]}.json`,
|
|
@@ -168,7 +169,8 @@ class I18nCompletionTool {
|
|
|
168
169
|
|
|
169
170
|
// Check if nested key exists in object
|
|
170
171
|
hasNestedKey(obj, keyPath) {
|
|
171
|
-
const
|
|
172
|
+
const keyPathStr = String(keyPath || '');
|
|
173
|
+
const keys = keyPathStr.split('.');
|
|
172
174
|
let current = obj;
|
|
173
175
|
|
|
174
176
|
for (const key of keys) {
|
|
@@ -183,7 +185,8 @@ class I18nCompletionTool {
|
|
|
183
185
|
|
|
184
186
|
// Set nested value in object
|
|
185
187
|
setNestedValue(obj, keyPath, value) {
|
|
186
|
-
const
|
|
188
|
+
const keyPathStr = String(keyPath || '');
|
|
189
|
+
const keys = keyPathStr.split('.');
|
|
187
190
|
let current = obj;
|
|
188
191
|
|
|
189
192
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
@@ -280,7 +283,8 @@ class I18nCompletionTool {
|
|
|
280
283
|
// Generate a readable value from a key path
|
|
281
284
|
generateValueFromKey(keyPath) {
|
|
282
285
|
// Extract the last part of the key (after dots and colons)
|
|
283
|
-
const
|
|
286
|
+
const keyPathStr = String(keyPath || '');
|
|
287
|
+
const keyName = keyPathStr.split('.').pop().split(':').pop();
|
|
284
288
|
|
|
285
289
|
// Convert camelCase to readable text
|
|
286
290
|
const readable = keyName
|
|
@@ -492,14 +496,14 @@ class I18nCompletionTool {
|
|
|
492
496
|
// Show sample of changes
|
|
493
497
|
const sampleChanges = changes.slice(0, 3);
|
|
494
498
|
sampleChanges.forEach(change => {
|
|
495
|
-
console.log(t("complete.changeDetails", { file: change.file, key: change.key }));
|
|
499
|
+
console.log(t("usage.complete.changeDetails", { file: change.file, key: change.key }));
|
|
496
500
|
});
|
|
497
501
|
|
|
498
502
|
if (changes.length > 3) {
|
|
499
|
-
console.log(t("complete.andMore", { count: changes.length - 3 }));
|
|
503
|
+
console.log(t("usage.complete.andMore", { count: changes.length - 3 }));
|
|
500
504
|
}
|
|
501
505
|
} else {
|
|
502
|
-
console.log(t("complete.noChangesNeeded", { language }));
|
|
506
|
+
console.log(t("usage.complete.noChangesNeeded", { language }));
|
|
503
507
|
}
|
|
504
508
|
}
|
|
505
509
|
|