i18ntk 1.7.2 β 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -19
- package/main/i18ntk-analyze.js +19 -17
- package/main/i18ntk-fixer.js +653 -0
- package/main/i18ntk-manage.js +40 -33
- package/main/i18ntk-validate.js +4 -3
- package/package.json +13 -6
- package/scripts/fixer.test.js +90 -0
- package/scripts/test-runner.js +2 -1
- package/settings/i18ntk-config.json +8 -1
- package/settings/initialization.json +3 -3
- package/ui-locales/de.json +67 -1
- package/ui-locales/en.json +67 -1
- package/ui-locales/es.json +67 -1
- package/ui-locales/fr.json +67 -1
- package/ui-locales/ja.json +67 -1
- package/ui-locales/ru.json +67 -1
- package/ui-locales/zh.json +67 -1
- package/utils/config-helper.js +5 -1
- package/utils/security.js +2 -1
package/README.md
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
**Version:** 1.7.
|
|
6
|
-
**Last Updated:** 2025-08-
|
|
5
|
+
**Version:** 1.7.4
|
|
6
|
+
**Last Updated:** 2025-08-11
|
|
7
7
|
**GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/i18ntk) [](https://badge.fury.io/js/i18ntk) [](https://nodejs.org/) [](https://www.npmjs.com/package/i18ntk) [](https://github.com/vladnoskv/i18ntk)
|
|
10
|
-
[](https://socket.dev/npm/package/i18ntk/overview/1.7.
|
|
10
|
+
[](https://socket.dev/npm/package/i18ntk/overview/1.7.4)
|
|
11
11
|
|
|
12
12
|
**π The fastest way to manage translations across any framework or vanilla JavaScript projects**
|
|
13
13
|
|
|
14
14
|
**Framework Support:** Auto-detects popular libraries (React i18next, Vue i18n, i18next, Nuxt i18n, Svelte i18n) or works without a framework. i18ntk manages translation files and validationβit does NOT implement translation logic like i18next or Vue i18n.
|
|
15
15
|
|
|
16
|
-
> **v1.7.
|
|
16
|
+
> **v1.7.4** β **NEW Interactive Translation Fixer Tool** with custom placeholder markers, selective language/file fixing, mass fix capabilities, and 7-language UI support; enhanced security logging, flexible 4-6 digit PIN authentication, configuration stability improvements, and CI/CD silent mode support; maintains 97% speed improvement (**15.38ms** for 200k keys)
|
|
17
17
|
|
|
18
18
|
## π Quick Start
|
|
19
19
|
|
|
@@ -41,18 +41,21 @@ i18ntk validate --source ./locales
|
|
|
41
41
|
|
|
42
42
|
## π― Key Features
|
|
43
43
|
|
|
44
|
+
### β¨ **MAJOR FEATURE FOR 1.7.4: Interactive Translation Fixer Tool**
|
|
45
|
+
|
|
44
46
|
- **Ultra-Extreme Performance**: 97% speed improvement - **15.38ms** for 200k keys
|
|
45
47
|
- **Enhanced Security**: Advanced PIN protection with exponential backoff & AES-256 encryption
|
|
46
48
|
- **Edge Case Handling**: Robust handling of corrupt files, encoding issues, and network failures
|
|
47
49
|
- **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
|
|
50
|
+
- **Interactive Translation Fixer**: New `i18ntk fixer` command with step-by-step guided fixing process
|
|
48
51
|
- **Enterprise Backup**: Automated encrypted backups with cloud integration
|
|
49
52
|
- **Zero Dependencies**: Lightweight, production-ready
|
|
50
53
|
- **Watch Helper**: Optional `--watch` mode keeps translations synced in real time
|
|
51
54
|
- **Lite Package Framework**: Build an English-only UI locale bundle for minimal footprint
|
|
52
|
-
- **
|
|
55
|
+
- **7 UI Languages**: English, Spanish, French, German, Japanese, Russian, Chinese
|
|
53
56
|
- **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18next, Svelte i18n
|
|
54
57
|
- **Memory Optimization**: 67% memory reduction with streaming processing
|
|
55
|
-
- **Scalability**: Linear scaling up to 5M keys with ultra-extreme settings
|
|
58
|
+
- **Scalability**: Linear scaling up to 5M keys per second with ultra-extreme settings
|
|
56
59
|
- **Smart Framework Detection**: Automatically skips unnecessary prompts when i18n frameworks are detected
|
|
57
60
|
|
|
58
61
|
### πΈ Screenshots
|
|
@@ -81,6 +84,7 @@ i18ntk validate --source ./locales
|
|
|
81
84
|
| `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
|
|
82
85
|
| `doctor` | Diagnose configuration issues | `i18ntk doctor` |
|
|
83
86
|
| `sizing` | Optimize package size | `i18ntk sizing --interactive` |
|
|
87
|
+
| `fixer` | Fix broken translations & placeholders | `i18ntk fixer --interactive` |
|
|
84
88
|
|
|
85
89
|
## π§ Configuration
|
|
86
90
|
|
|
@@ -88,7 +92,7 @@ Configuration is managed through the `settings/i18ntk-config.json` file:
|
|
|
88
92
|
|
|
89
93
|
```json
|
|
90
94
|
{
|
|
91
|
-
"version": "1.7.
|
|
95
|
+
"version": "1.7.4",
|
|
92
96
|
"sourceDir": "./locales",
|
|
93
97
|
"outputDir": "./i18ntk-reports",
|
|
94
98
|
"defaultLanguage": "en",
|
|
@@ -181,6 +185,73 @@ const i18n = createI18n({ locale: 'en', messages: translations });
|
|
|
181
185
|
- **Smart Management**: Interactive selection with automatic backups
|
|
182
186
|
- **Zero Breaking Changes**: Safe restoration from backups
|
|
183
187
|
|
|
188
|
+
### π§ **NEW TRANSLATION FIXER TOOL** - Mass Fix Broken Translations
|
|
189
|
+
|
|
190
|
+
**Interactive Translation Fixer with Multi-Marker Support**
|
|
191
|
+
|
|
192
|
+
- **Interactive Mode**: Step-by-step guided fixing process
|
|
193
|
+
- **Custom Placeholder Markers**: Configure any markers (e.g., `{{NOT_TRANSLATED}}`, `__UNTRANSLATED__`, `[PLACEHOLDER]`)
|
|
194
|
+
- **Selective Language Fixing**: Choose specific languages or fix all
|
|
195
|
+
- **Selective File Fixing**: Target specific files or directories
|
|
196
|
+
- **Mass Fix Capability**: Fix thousands of broken translations at once
|
|
197
|
+
- **Comprehensive Reports**: Detailed analysis and fix reports
|
|
198
|
+
- **8 Language Support**: Full internationalization for all UI interactions
|
|
199
|
+
|
|
200
|
+
**Usage Examples:**
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Interactive mode with guided prompts
|
|
204
|
+
i18ntk fixer --interactive
|
|
205
|
+
|
|
206
|
+
# Fix specific languages with custom markers
|
|
207
|
+
i18ntk fixer --languages en,es,fr --markers "{{NOT_TRANSLATED}},__MISSING__"
|
|
208
|
+
|
|
209
|
+
# Fix specific directory with auto-fix
|
|
210
|
+
i18ntk fixer --source ./src/locales --auto-fix --report
|
|
211
|
+
|
|
212
|
+
# Custom placeholder detection
|
|
213
|
+
i18ntk fixer --markers "TODO_TRANSLATE,PLACEHOLDER_TEXT,MISSING_TRANSLATION"
|
|
214
|
+
|
|
215
|
+
# Fix all available languages
|
|
216
|
+
i18ntk fixer --languages all --markers "[PLACEHOLDER],{{UNTRANSLATED}}"
|
|
217
|
+
```i18ntk fixer --interactive
|
|
218
|
+
|
|
219
|
+
# Fix specific languages with custom markers
|
|
220
|
+
i18ntk fixer --languages en,es,fr --markers "{{NOT_TRANSLATED}},__MISSING__"
|
|
221
|
+
|
|
222
|
+
# Fix specific directory with default settings
|
|
223
|
+
i18ntk fixer --source ./src/locales --languages all
|
|
224
|
+
|
|
225
|
+
# Non-interactive mode with auto-fix
|
|
226
|
+
i18ntk fixer --source ./locales --auto-fix --report
|
|
227
|
+
|
|
228
|
+
# Custom placeholder detection
|
|
229
|
+
i18ntk fixer --markers "TODO_TRANSLATE,PLACEHOLDER_TEXT,MISSING_TRANSLATION"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Interactive Features:**
|
|
233
|
+
- **Welcome Screen**: Introduction and tool overview
|
|
234
|
+
- **Marker Configuration**: Custom placeholder marker setup
|
|
235
|
+
- **Language Selection**: Choose specific languages to fix
|
|
236
|
+
- **Directory Selection**: Target specific directories
|
|
237
|
+
- **Progress Tracking**: Real-time progress and statistics
|
|
238
|
+
- **Fix Confirmation**: Review before applying changes
|
|
239
|
+
- **Report Generation**: Detailed fix reports with before/after analysis
|
|
240
|
+
|
|
241
|
+
**Supported Placeholder Types:**
|
|
242
|
+
- **Standard Markers**: `{{NOT_TRANSLATED}}`, `__UNTRANSLATED__`
|
|
243
|
+
- **Custom Markers**: Any user-defined placeholder text
|
|
244
|
+
- **Framework Markers**: Framework-specific placeholders
|
|
245
|
+
- **Legacy Markers**: Support for old translation systems
|
|
246
|
+
|
|
247
|
+
**Output Reports Include:**
|
|
248
|
+
- Total issues found and fixed
|
|
249
|
+
- Missing translations identified
|
|
250
|
+
- Placeholder translations detected
|
|
251
|
+
- Language-specific statistics
|
|
252
|
+
- File-by-file analysis
|
|
253
|
+
- Before/after comparison
|
|
254
|
+
|
|
184
255
|
## π Project Structure
|
|
185
256
|
|
|
186
257
|
```
|
|
@@ -200,22 +271,10 @@ your-project/
|
|
|
200
271
|
|
|
201
272
|
- **Locale files are backed up automatically** before optimization
|
|
202
273
|
- **Use interactive optimizer** for safe locale management
|
|
203
|
-
- **Zero breaking changes** from v1.6.x to v1.7.1
|
|
204
274
|
- **All versions prior to 1.7.1 are deprecated**
|
|
205
275
|
- **All improvements applied automatically** on update
|
|
206
276
|
|
|
207
277
|
|
|
208
|
-
#### Preserved Features from 1.6.3
|
|
209
|
-
- β
Ultra-extreme performance improvements
|
|
210
|
-
- β
Enhanced security with PIN protection
|
|
211
|
-
- β
Comprehensive backup & recovery
|
|
212
|
-
- β
Edge case handling
|
|
213
|
-
- β
Memory optimization
|
|
214
|
-
- β
Advanced configuration management
|
|
215
|
-
|
|
216
|
-
#### Breaking Changes
|
|
217
|
-
- **None** - 1.6.3 is fully backward compatible
|
|
218
|
-
|
|
219
278
|
## π Support
|
|
220
279
|
|
|
221
280
|
- **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
|
package/main/i18ntk-analyze.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* I18N TRANSLATION ANALYSIS SCRIPT
|
|
4
4
|
*
|
|
@@ -189,25 +189,26 @@ class I18nAnalyzer {
|
|
|
189
189
|
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
190
190
|
issues.push(...this.analyzeTranslationIssues(value, sourceObj, fullKey));
|
|
191
191
|
} else if (typeof value === 'string') {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
const markers = this.config.notTranslatedMarkers || [this.config.notTranslatedMarker];
|
|
193
|
+
if (markers.some(m => value === m)) {
|
|
194
|
+
issues.push({
|
|
195
|
+
type: 'not_translated',
|
|
196
|
+
key: fullKey,
|
|
197
|
+
value,
|
|
197
198
|
sourceValue: sourceValue || 'N/A'
|
|
198
199
|
});
|
|
199
200
|
} else if (value === '') {
|
|
200
|
-
issues.push({
|
|
201
|
-
type: 'empty_value',
|
|
202
|
-
key: fullKey,
|
|
203
|
-
value,
|
|
201
|
+
issues.push({
|
|
202
|
+
type: 'empty_value',
|
|
203
|
+
key: fullKey,
|
|
204
|
+
value,
|
|
204
205
|
sourceValue: sourceValue || 'N/A'
|
|
205
206
|
});
|
|
206
|
-
} else if (value.includes(
|
|
207
|
-
issues.push({
|
|
208
|
-
type: 'partial_translation',
|
|
209
|
-
key: fullKey,
|
|
210
|
-
value,
|
|
207
|
+
} else if (markers.some(m => value.includes(m))) {
|
|
208
|
+
issues.push({
|
|
209
|
+
type: 'partial_translation',
|
|
210
|
+
key: fullKey,
|
|
211
|
+
value,
|
|
211
212
|
sourceValue: sourceValue || 'N/A'
|
|
212
213
|
});
|
|
213
214
|
} else if (sourceValue && value === sourceValue) {
|
|
@@ -232,14 +233,15 @@ class I18nAnalyzer {
|
|
|
232
233
|
let empty = 0;
|
|
233
234
|
let partial = 0;
|
|
234
235
|
|
|
236
|
+
const markers = this.config.notTranslatedMarkers || [this.config.notTranslatedMarker];
|
|
235
237
|
const count = (item) => {
|
|
236
238
|
if (typeof item === 'string') {
|
|
237
239
|
total++;
|
|
238
|
-
if (item ===
|
|
240
|
+
if (markers.some(m => item === m)) {
|
|
239
241
|
notTranslated++;
|
|
240
242
|
} else if (item === '') {
|
|
241
243
|
empty++;
|
|
242
|
-
} else if (item.includes(
|
|
244
|
+
} else if (markers.some(m => item.includes(m))) {
|
|
243
245
|
partial++;
|
|
244
246
|
} else {
|
|
245
247
|
translated++;
|