i18ntk 1.2.2 → 1.3.1
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/CHANGELOG.md +75 -2
- package/LICENSE +3 -1
- package/README.md +48 -47
- package/docs/README.md +42 -19
- package/docs/SCRIPT_DIRECTORY_GUIDE.md +278 -0
- package/docs/release-notes/v1.3.0.md +162 -0
- package/docs/release-notes/v1.3.1.md +136 -0
- package/main/i18ntk-analyze.js +14 -6
- package/main/i18ntk-autorun.js +37 -36
- package/main/i18ntk-complete.js +9 -5
- package/main/i18ntk-init.js +16 -12
- package/main/i18ntk-manage.js +6 -4
- package/main/i18ntk-sizing.js +12 -12
- package/main/i18ntk-summary.js +6 -2
- package/main/i18ntk-usage.js +5 -5
- package/main/i18ntk-validate.js +9 -5
- package/package.json +20 -19
- package/scripts/copy-translations.js +90 -0
- package/settings/i18ntk-config.json +10 -0
- package/settings/settings-cli.js +201 -77
- package/settings/settings-manager.js +19 -0
- package/ui-locales/de/autorun.json +69 -64
- package/ui-locales/de/common.json +14 -1
- package/ui-locales/de/errors.json +11 -1
- package/ui-locales/de/menu.json +10 -1
- package/ui-locales/de/operations.json +11 -0
- package/ui-locales/de/security.json +2 -1
- package/ui-locales/de/settings.json +67 -9
- package/ui-locales/de/sizing.json +14 -1
- package/ui-locales/de/status.json +18 -1
- package/ui-locales/de/test-complete-system.json +13 -1
- package/ui-locales/en/autorun.json +68 -65
- package/ui-locales/en/common.json +15 -1
- package/ui-locales/en/init.json +20 -5
- package/ui-locales/en/menu.json +1 -0
- package/ui-locales/en/operations.json +11 -1
- package/ui-locales/en/settings.json +158 -35
- package/ui-locales/en/validate.json +1 -0
- package/ui-locales/es/autorun.json +68 -65
- package/ui-locales/es/common.json +14 -1
- package/ui-locales/es/errors.json +11 -1
- package/ui-locales/es/menu.json +10 -1
- package/ui-locales/es/operations.json +11 -0
- package/ui-locales/es/security.json +2 -1
- package/ui-locales/es/settings.json +60 -9
- package/ui-locales/es/sizing.json +14 -1
- package/ui-locales/es/status.json +18 -1
- package/ui-locales/es/test-complete-system.json +13 -1
- package/ui-locales/fr/autorun.json +69 -64
- package/ui-locales/fr/common.json +14 -1
- package/ui-locales/fr/errors.json +11 -1
- package/ui-locales/fr/menu.json +10 -1
- package/ui-locales/fr/operations.json +11 -0
- package/ui-locales/fr/security.json +2 -1
- package/ui-locales/fr/settings.json +60 -9
- package/ui-locales/fr/sizing.json +14 -1
- package/ui-locales/fr/status.json +18 -1
- package/ui-locales/fr/test-complete-system.json +13 -1
- package/ui-locales/ja/autorun.json +69 -64
- package/ui-locales/ja/common.json +14 -1
- package/ui-locales/ja/errors.json +11 -1
- package/ui-locales/ja/menu.json +10 -1
- package/ui-locales/ja/operations.json +11 -0
- package/ui-locales/ja/security.json +2 -1
- package/ui-locales/ja/settings.json +60 -9
- package/ui-locales/ja/sizing.json +14 -1
- package/ui-locales/ja/status.json +18 -1
- package/ui-locales/ja/test-complete-system.json +13 -1
- package/ui-locales/pt/analyze.json +2 -1
- package/ui-locales/pt/autorun.json +69 -64
- package/ui-locales/pt/common.json +14 -1
- package/ui-locales/pt/errors.json +11 -1
- package/ui-locales/pt/init.json +5 -1
- package/ui-locales/pt/menu.json +10 -1
- package/ui-locales/pt/operations.json +11 -0
- package/ui-locales/pt/security.json +2 -1
- package/ui-locales/pt/settings.json +60 -9
- package/ui-locales/pt/sizing.json +14 -1
- package/ui-locales/pt/status.json +18 -1
- package/ui-locales/pt/test-complete-system.json +13 -1
- package/ui-locales/ru/autorun.json +69 -64
- package/ui-locales/ru/common.json +14 -1
- package/ui-locales/ru/errors.json +11 -1
- package/ui-locales/ru/menu.json +10 -1
- package/ui-locales/ru/operations.json +11 -0
- package/ui-locales/ru/security.json +2 -1
- package/ui-locales/ru/settings.json +60 -9
- package/ui-locales/ru/sizing.json +14 -1
- package/ui-locales/ru/status.json +18 -1
- package/ui-locales/ru/test-complete-system.json +13 -1
- package/ui-locales/zh/autorun.json +69 -64
- package/ui-locales/zh/common.json +14 -1
- package/ui-locales/zh/errors.json +11 -1
- package/ui-locales/zh/menu.json +10 -1
- package/ui-locales/zh/operations.json +11 -0
- package/ui-locales/zh/security.json +2 -1
- package/ui-locales/zh/settings.json +67 -9
- package/ui-locales/zh/sizing.json +13 -1
- package/ui-locales/zh/status.json +25 -8
- package/ui-locales/zh/test-complete-system.json +13 -1
- package/utils/test-complete-system.js +178 -162
- package/settings/backups/i18ntk-config-backup-2025-08-01T23-38-43-753Z.json +0 -117
- package/ui-locales/de-old.json +0 -705
- package/ui-locales/de.json +0 -15
- package/ui-locales/en-old.json +0 -709
- package/ui-locales/en.json +0 -15
- package/ui-locales/es-old.json +0 -654
- package/ui-locales/es.json +0 -15
- package/ui-locales/fr-old.json +0 -606
- package/ui-locales/fr.json +0 -15
- package/ui-locales/ja-old.json +0 -660
- package/ui-locales/ja.json +0 -15
- package/ui-locales/pt.json +0 -15
- package/ui-locales/ru-old.json +0 -655
- package/ui-locales/ru.json +0 -15
- package/ui-locales/zh-old.json +0 -647
- package/ui-locales/zh.json +0 -15
package/settings/settings-cli.js
CHANGED
|
@@ -68,7 +68,7 @@ class SettingsCLI {
|
|
|
68
68
|
this.schema = settingsManager.getSettingsSchema();
|
|
69
69
|
return true;
|
|
70
70
|
} catch (error) {
|
|
71
|
-
this.error(
|
|
71
|
+
this.error(this.t('settings.initFailed', { error: error.message }));
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -113,7 +113,7 @@ class SettingsCLI {
|
|
|
113
113
|
console.log(colors.reset);
|
|
114
114
|
|
|
115
115
|
if (this.modified) {
|
|
116
|
-
console.log(`${colors.yellow}
|
|
116
|
+
console.log(`${colors.yellow}${this.t('settings.mainMenu.unsavedChangesWarning')}${colors.reset}\n`);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -124,12 +124,14 @@ class SettingsCLI {
|
|
|
124
124
|
const options = [
|
|
125
125
|
{ key: '1', label: this.t('settings.mainMenu.uiSettings'), description: this.t('settings.mainMenu.uiSettingsDesc') },
|
|
126
126
|
{ key: '2', label: this.t('settings.mainMenu.directorySettings'), description: this.t('settings.mainMenu.directorySettingsDesc') },
|
|
127
|
-
{ key: '3', label: this.t('settings.mainMenu.
|
|
128
|
-
{ key: '4', label: this.t('settings.mainMenu.
|
|
129
|
-
{ key: '5', label: this.t('settings.mainMenu.
|
|
130
|
-
{ key: '6', label: this.t('settings.mainMenu.
|
|
131
|
-
{ key: '7', label: this.t('settings.mainMenu.
|
|
132
|
-
{ key: '8', label: this.t('settings.mainMenu.
|
|
127
|
+
{ key: '3', label: this.t('settings.mainMenu.scriptDirectorySettings'), description: this.t('settings.mainMenu.scriptDirectorySettingsDesc') },
|
|
128
|
+
{ key: '4', label: this.t('settings.mainMenu.processingSettings'), description: this.t('settings.mainMenu.processingSettingsDesc') },
|
|
129
|
+
{ key: '5', label: this.t('settings.mainMenu.advancedSettings'), description: this.t('settings.mainMenu.advancedSettingsDesc') },
|
|
130
|
+
{ key: '6', label: this.t('settings.mainMenu.viewAllSettings'), description: this.t('settings.mainMenu.viewAllSettingsDesc') },
|
|
131
|
+
{ key: '7', label: this.t('settings.mainMenu.importExport'), description: this.t('settings.mainMenu.importExportDesc') },
|
|
132
|
+
{ key: '8', label: this.t('settings.mainMenu.resetToDefaults'), description: this.t('settings.mainMenu.resetToDefaultsDesc') },
|
|
133
|
+
{ key: '9', label: this.t('settings.mainMenu.reportBug'), description: this.t('settings.mainMenu.reportBugDesc') },
|
|
134
|
+
{ key: '0', label: this.t('settings.mainMenu.updatePackage'), description: this.t('settings.mainMenu.updatePackageDesc') },
|
|
133
135
|
{ key: 's', label: this.t('settings.mainMenu.saveChanges'), description: this.t('settings.mainMenu.saveChangesDesc') },
|
|
134
136
|
{ key: 'h', label: this.t('settings.mainMenu.help'), description: this.t('settings.mainMenu.helpDesc') },
|
|
135
137
|
{ key: 'q', label: this.t('settings.mainMenu.quit'), description: this.t('settings.mainMenu.quitDesc') }
|
|
@@ -160,23 +162,29 @@ class SettingsCLI {
|
|
|
160
162
|
await this.showDirectorySettings();
|
|
161
163
|
break;
|
|
162
164
|
case '3':
|
|
163
|
-
await this.
|
|
165
|
+
await this.showScriptDirectorySettings();
|
|
164
166
|
break;
|
|
165
167
|
case '4':
|
|
166
|
-
await this.
|
|
168
|
+
await this.showProcessingSettings();
|
|
167
169
|
break;
|
|
168
170
|
case '5':
|
|
169
|
-
await this.
|
|
171
|
+
await this.showAdvancedSettings();
|
|
170
172
|
break;
|
|
171
173
|
case '6':
|
|
172
|
-
await this.
|
|
174
|
+
await this.showAllSettings();
|
|
173
175
|
break;
|
|
174
176
|
case '7':
|
|
175
|
-
await this.
|
|
177
|
+
await this.showImportExport();
|
|
176
178
|
break;
|
|
177
179
|
case '8':
|
|
180
|
+
await this.resetToDefaults();
|
|
181
|
+
break;
|
|
182
|
+
case '9':
|
|
178
183
|
await this.reportBug();
|
|
179
184
|
break;
|
|
185
|
+
case '0':
|
|
186
|
+
await this.updatePackage();
|
|
187
|
+
break;
|
|
180
188
|
case 's':
|
|
181
189
|
await this.saveSettings();
|
|
182
190
|
break;
|
|
@@ -231,6 +239,30 @@ class SettingsCLI {
|
|
|
231
239
|
await this.showSettingsCategory(dirSettings);
|
|
232
240
|
}
|
|
233
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Show script-specific directory settings menu
|
|
244
|
+
*/
|
|
245
|
+
async showScriptDirectorySettings() {
|
|
246
|
+
this.clearScreen();
|
|
247
|
+
this.showHeader();
|
|
248
|
+
console.log(`${colors.bright}${this.t('settings.categories.scriptDirectorySettings')}${colors.reset}\n`);
|
|
249
|
+
console.log(`📁 ${colors.cyan}${this.t('settings.currentDirectory')}: ${process.cwd()}${colors.reset}`);
|
|
250
|
+
console.log(`💡 ${colors.dim}${this.t('settings.relativePathHint')}${colors.reset}\n`);
|
|
251
|
+
|
|
252
|
+
const scriptDirSettings = {
|
|
253
|
+
'scriptDirectories.analyze': this.t('settings.fields.scriptDirectories.analyzeLabel'),
|
|
254
|
+
'scriptDirectories.complete': this.t('settings.fields.scriptDirectories.completeLabel'),
|
|
255
|
+
'scriptDirectories.init': this.t('settings.fields.scriptDirectories.initLabel'),
|
|
256
|
+
'scriptDirectories.manage': this.t('settings.fields.scriptDirectories.manageLabel'),
|
|
257
|
+
'scriptDirectories.sizing': this.t('settings.fields.scriptDirectories.sizingLabel'),
|
|
258
|
+
'scriptDirectories.summary': this.t('settings.fields.scriptDirectories.summaryLabel'),
|
|
259
|
+
'scriptDirectories.usage': this.t('settings.fields.scriptDirectories.usageLabel'),
|
|
260
|
+
'scriptDirectories.validate': this.t('settings.fields.scriptDirectories.validateLabel')
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
await this.showSettingsCategory(scriptDirSettings);
|
|
264
|
+
}
|
|
265
|
+
|
|
234
266
|
/**
|
|
235
267
|
* Show processing settings menu
|
|
236
268
|
*/
|
|
@@ -280,6 +312,12 @@ class SettingsCLI {
|
|
|
280
312
|
});
|
|
281
313
|
|
|
282
314
|
console.log(`\n ${colors.yellow}b${colors.reset}) ${this.t('settings.back')}`);
|
|
315
|
+
|
|
316
|
+
// Add reset option for script directories
|
|
317
|
+
const isScriptDirectory = Object.keys(categorySettings).some(key => key.startsWith('scriptDirectories.'));
|
|
318
|
+
if (isScriptDirectory) {
|
|
319
|
+
console.log(` ${colors.red}r${colors.reset}) ${this.t('settings.resetScriptDirectories')}`);
|
|
320
|
+
}
|
|
283
321
|
console.log();
|
|
284
322
|
|
|
285
323
|
const choice = await this.prompt(this.t('settings.selectSettingPrompt'));
|
|
@@ -288,6 +326,12 @@ class SettingsCLI {
|
|
|
288
326
|
return;
|
|
289
327
|
}
|
|
290
328
|
|
|
329
|
+
if (choice.toLowerCase() === 'r' && isScriptDirectory) {
|
|
330
|
+
await this.resetScriptDirectories();
|
|
331
|
+
await this.showSettingsCategory(categorySettings);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
|
|
291
335
|
const index = parseInt(choice) - 1;
|
|
292
336
|
if (index >= 0 && index < keys.length) {
|
|
293
337
|
const key = keys[index];
|
|
@@ -402,7 +446,7 @@ class SettingsCLI {
|
|
|
402
446
|
|
|
403
447
|
// Check if admin authentication is required
|
|
404
448
|
if (this.requiresAdminAuth(key) && !this.adminAuthenticated) {
|
|
405
|
-
console.log(`\n
|
|
449
|
+
console.log(`\n${this.t('settings.admin.authRequired', { label: label })}`);
|
|
406
450
|
const authenticated = await this.adminPin.verifyPin();
|
|
407
451
|
if (!authenticated) {
|
|
408
452
|
console.log(this.t('settings.admin.accessDenied'));
|
|
@@ -446,8 +490,19 @@ class SettingsCLI {
|
|
|
446
490
|
return;
|
|
447
491
|
}
|
|
448
492
|
|
|
449
|
-
|
|
450
|
-
|
|
493
|
+
// Handle "default" keyword for script directory settings
|
|
494
|
+
if (newValue.trim().toLowerCase() === 'default') {
|
|
495
|
+
if (key.startsWith('scriptDirectories.')) {
|
|
496
|
+
this.setNestedValue(this.settings, key, null);
|
|
497
|
+
this.modified = true;
|
|
498
|
+
this.success(`${label} reset to system default.`);
|
|
499
|
+
await this.pause();
|
|
500
|
+
return;
|
|
501
|
+
} else {
|
|
502
|
+
this.error('"default" keyword is only supported for script directory settings.');
|
|
503
|
+
await this.pause();
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
451
506
|
}
|
|
452
507
|
|
|
453
508
|
// Validate input
|
|
@@ -461,7 +516,7 @@ class SettingsCLI {
|
|
|
461
516
|
// Convert the value
|
|
462
517
|
const convertedValue = this.convertValue(newValue.trim(), schema);
|
|
463
518
|
if (convertedValue === null) {
|
|
464
|
-
this.error('
|
|
519
|
+
this.error(this.t('settings.invalidValueFormat'));
|
|
465
520
|
await this.pause();
|
|
466
521
|
return;
|
|
467
522
|
}
|
|
@@ -499,7 +554,7 @@ class SettingsCLI {
|
|
|
499
554
|
async handlePinSetup() {
|
|
500
555
|
this.clearScreen();
|
|
501
556
|
this.showHeader();
|
|
502
|
-
console.log(`${colors.bright}
|
|
557
|
+
console.log(`${colors.bright}${this.t('settings.admin.pinSetupTitle')}${colors.reset}\n`);
|
|
503
558
|
|
|
504
559
|
if (this.adminPin.isPinSet()) {
|
|
505
560
|
console.log(this.t('settings.admin.pinConfigured'));
|
|
@@ -509,7 +564,7 @@ class SettingsCLI {
|
|
|
509
564
|
console.log(' ' + this.t('settings.admin.cancel'));
|
|
510
565
|
console.log();
|
|
511
566
|
|
|
512
|
-
const choice = await this.prompt('
|
|
567
|
+
const choice = await this.prompt(this.t('settings.admin.selectOption'));
|
|
513
568
|
|
|
514
569
|
switch (choice) {
|
|
515
570
|
case '1':
|
|
@@ -542,7 +597,7 @@ class SettingsCLI {
|
|
|
542
597
|
console.log(this.t('settings.admin.operationCancelled'));
|
|
543
598
|
break;
|
|
544
599
|
default:
|
|
545
|
-
this.error('
|
|
600
|
+
this.error(this.t('common.invalidOption'));
|
|
546
601
|
}
|
|
547
602
|
} else {
|
|
548
603
|
console.log(this.t('settings.admin.noPinConfigured'));
|
|
@@ -553,7 +608,7 @@ class SettingsCLI {
|
|
|
553
608
|
console.log(' ' + this.t('settings.admin.benefitReset'));
|
|
554
609
|
console.log();
|
|
555
610
|
|
|
556
|
-
const response = await this.prompt('
|
|
611
|
+
const response = await this.prompt(this.t('settings.admin.setupPinPrompt'));
|
|
557
612
|
|
|
558
613
|
if (response.toLowerCase() === 'y' || response.toLowerCase() === 'yes') {
|
|
559
614
|
const success = await this.adminPin.setupPin();
|
|
@@ -640,7 +695,7 @@ class SettingsCLI {
|
|
|
640
695
|
* Export settings to a file
|
|
641
696
|
*/
|
|
642
697
|
async exportSettings() {
|
|
643
|
-
const filename = await this.prompt(
|
|
698
|
+
const filename = await this.prompt(this.t('settings.importExport.exportFilenamePrompt'));
|
|
644
699
|
const exportFile = filename.trim() || `i18n-settings-${new Date().toISOString().split('T')[0]}.json`;
|
|
645
700
|
|
|
646
701
|
try {
|
|
@@ -657,7 +712,7 @@ class SettingsCLI {
|
|
|
657
712
|
* Import settings from a file
|
|
658
713
|
*/
|
|
659
714
|
async importSettings() {
|
|
660
|
-
const filename = await this.prompt('
|
|
715
|
+
const filename = await this.prompt(this.t('settings.importExport.importFilenamePrompt'));
|
|
661
716
|
|
|
662
717
|
if (!filename.trim()) {
|
|
663
718
|
return;
|
|
@@ -679,7 +734,7 @@ class SettingsCLI {
|
|
|
679
734
|
return;
|
|
680
735
|
}
|
|
681
736
|
|
|
682
|
-
const confirm = await this.prompt('
|
|
737
|
+
const confirm = await this.prompt(this.t('settings.importExport.importConfirm'));
|
|
683
738
|
if (confirm.toLowerCase() === 'y') {
|
|
684
739
|
this.settings = importedSettings;
|
|
685
740
|
this.modified = true;
|
|
@@ -712,12 +767,11 @@ class SettingsCLI {
|
|
|
712
767
|
async resetToDefaults() {
|
|
713
768
|
this.clearScreen();
|
|
714
769
|
this.showHeader();
|
|
715
|
-
console.log(`${colors.bright}
|
|
770
|
+
console.log(`${colors.bright}${this.t('settings.resetToDefaultsTitle')}${colors.reset}\n`);
|
|
771
|
+
console.log(`${colors.yellow}${this.t('settings.resetWarning1')}${colors.reset}`);
|
|
772
|
+
console.log(`${colors.yellow}${this.t('settings.resetWarning2')}${colors.reset}\n`);
|
|
716
773
|
|
|
717
|
-
|
|
718
|
-
console.log(`${colors.yellow}⚠️ Any unsaved changes will be lost.${colors.reset}\n`);
|
|
719
|
-
|
|
720
|
-
const confirm = await this.prompt('Are you sure you want to continue? (y/N): ');
|
|
774
|
+
const confirm = await this.prompt(this.t('settings.resetConfirm'));
|
|
721
775
|
|
|
722
776
|
if (confirm.toLowerCase() === 'y') {
|
|
723
777
|
try {
|
|
@@ -733,6 +787,46 @@ class SettingsCLI {
|
|
|
733
787
|
await this.pause();
|
|
734
788
|
}
|
|
735
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Reset script directories to defaults
|
|
792
|
+
*/
|
|
793
|
+
async resetScriptDirectories() {
|
|
794
|
+
this.clearScreen();
|
|
795
|
+
this.showHeader();
|
|
796
|
+
console.log(`${colors.bright}${this.t('settings.resetScriptDirectoriesTitle')}${colors.reset}\n`);
|
|
797
|
+
console.log(`${colors.yellow}${this.t('settings.resetScriptDirectoriesWarning1')}${colors.reset}`);
|
|
798
|
+
console.log(`${colors.yellow}${this.t('settings.resetScriptDirectoriesWarning2')}${colors.reset}\n`);
|
|
799
|
+
|
|
800
|
+
const confirm = await this.prompt(this.t('settings.resetScriptDirectoriesConfirm'));
|
|
801
|
+
|
|
802
|
+
if (confirm.toLowerCase() === 'y') {
|
|
803
|
+
try {
|
|
804
|
+
// Reset all script directory settings to null (use system defaults)
|
|
805
|
+
const scriptDirKeys = [
|
|
806
|
+
'scriptDirectories.analyze',
|
|
807
|
+
'scriptDirectories.complete',
|
|
808
|
+
'scriptDirectories.init',
|
|
809
|
+
'scriptDirectories.manage',
|
|
810
|
+
'scriptDirectories.sizing',
|
|
811
|
+
'scriptDirectories.summary',
|
|
812
|
+
'scriptDirectories.usage',
|
|
813
|
+
'scriptDirectories.validate'
|
|
814
|
+
];
|
|
815
|
+
|
|
816
|
+
scriptDirKeys.forEach(key => {
|
|
817
|
+
this.setNestedValue(this.settings, key, null);
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
this.modified = true;
|
|
821
|
+
this.success('Script directories reset to system defaults successfully.');
|
|
822
|
+
} catch (error) {
|
|
823
|
+
this.error(`Failed to reset script directories: ${error.message}`);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
await this.pause();
|
|
828
|
+
}
|
|
829
|
+
|
|
736
830
|
/**
|
|
737
831
|
* Save current settings
|
|
738
832
|
*/
|
|
@@ -758,31 +852,30 @@ class SettingsCLI {
|
|
|
758
852
|
async showHelp() {
|
|
759
853
|
this.clearScreen();
|
|
760
854
|
this.showHeader();
|
|
761
|
-
console.log(`${colors.bright}
|
|
762
|
-
|
|
763
|
-
console.log(`${
|
|
764
|
-
console.log(`
|
|
765
|
-
console.log(
|
|
766
|
-
console.log(
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
console.log(`${
|
|
770
|
-
console.log(`
|
|
771
|
-
console.log(`
|
|
772
|
-
console.log(`
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
console.log(`${
|
|
776
|
-
console.log(`
|
|
777
|
-
console.log(`
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
console.log(`${
|
|
781
|
-
console.log(
|
|
782
|
-
console.log(
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
console.log(`Press Enter to continue...`);
|
|
855
|
+
console.log(`${colors.bright}${this.t('settings.help.title')}${colors.reset}\n`);
|
|
856
|
+
console.log(`${colors.cyan}${this.t('settings.help.navigationTitle')}${colors.reset}`);
|
|
857
|
+
console.log(`${this.t('settings.help.navigation1')}`);
|
|
858
|
+
console.log(`${this.t('settings.help.navigation2')}`);
|
|
859
|
+
console.log(`${this.t('settings.help.navigation3')}`);
|
|
860
|
+
console.log(`${this.t('settings.help.navigation4')}\n`);
|
|
861
|
+
|
|
862
|
+
console.log(`${colors.cyan}${this.t('settings.help.categoriesTitle')}${colors.reset}`);
|
|
863
|
+
console.log(`${this.t('settings.help.categoryUI')}`);
|
|
864
|
+
console.log(`${this.t('settings.help.categoryDirectory')}`);
|
|
865
|
+
console.log(`${this.t('settings.help.categoryProcessing')}`);
|
|
866
|
+
console.log(`${this.t('settings.help.categoryAdvanced')}\n`);
|
|
867
|
+
|
|
868
|
+
console.log(`${colors.cyan}${this.t('settings.help.envVarsTitle')}${colors.reset}`);
|
|
869
|
+
console.log(`${this.t('settings.help.envVar1')}`);
|
|
870
|
+
console.log(`${this.t('settings.help.envVar2')}`);
|
|
871
|
+
console.log(`${this.t('settings.help.envVar3')}\n`);
|
|
872
|
+
|
|
873
|
+
console.log(`${colors.cyan}${this.t('settings.help.cliUsageTitle')}${colors.reset}`);
|
|
874
|
+
console.log(`${this.t('settings.help.cliUsage1')}`);
|
|
875
|
+
console.log(`${this.t('settings.help.cliUsage2')}`);
|
|
876
|
+
console.log(`${this.t('settings.help.cliUsage3')}\n`);
|
|
877
|
+
|
|
878
|
+
console.log(`${this.t('settings.pressEnter')}\n`);
|
|
786
879
|
await this.prompt('');
|
|
787
880
|
}
|
|
788
881
|
|
|
@@ -792,19 +885,12 @@ class SettingsCLI {
|
|
|
792
885
|
async reportBug() {
|
|
793
886
|
this.clearScreen();
|
|
794
887
|
this.showHeader();
|
|
795
|
-
console.log(`${colors.bright}
|
|
796
|
-
|
|
797
|
-
console.log(
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
console.log(` • Check if the issue already exists`);
|
|
802
|
-
console.log(` • Include steps to reproduce the problem`);
|
|
803
|
-
console.log(` • Provide error messages and logs`);
|
|
804
|
-
console.log(` • Mention your operating system and Node.js version\n`);
|
|
805
|
-
|
|
806
|
-
console.log(`${colors.cyan}Opening GitHub issues page...${colors.reset}`);
|
|
807
|
-
|
|
888
|
+
console.log(`${colors.bright}${this.t('settings.reportBug.title')}${colors.reset}\n`);
|
|
889
|
+
console.log(this.t('settings.reportBug.description'));
|
|
890
|
+
console.log(`
|
|
891
|
+
${colors.dim}${this.t('settings.reportBug.link')}: https://github.com/vladnoskv/i18n-management-toolkit-main/issues${colors.reset}
|
|
892
|
+
`);
|
|
893
|
+
|
|
808
894
|
try {
|
|
809
895
|
const { exec } = require('child_process');
|
|
810
896
|
const url = 'https://github.com/vladnoskv/i18n-management-toolkit-main/issues';
|
|
@@ -825,34 +911,72 @@ class SettingsCLI {
|
|
|
825
911
|
|
|
826
912
|
exec(command, (error) => {
|
|
827
913
|
if (error) {
|
|
828
|
-
console.log(`${colors.yellow}
|
|
829
|
-
console.log(
|
|
914
|
+
console.log(`${colors.yellow}${this.t('settings.reportBug.browserOpenFailed')}${colors.reset}`);
|
|
915
|
+
console.log(`${this.t('settings.reportBug.manualVisit', { url: url })}`);
|
|
830
916
|
} else {
|
|
831
|
-
console.log(`${colors.green}
|
|
917
|
+
console.log(`${colors.green}${this.t('settings.reportBug.browserOpened')}${colors.reset}`);
|
|
832
918
|
}
|
|
833
919
|
});
|
|
834
920
|
} catch (error) {
|
|
835
|
-
console.log(`${colors.yellow}
|
|
836
|
-
console.log(
|
|
921
|
+
console.log(`${colors.yellow}${this.t('settings.reportBug.browserOpenFailed')}${colors.reset}`);
|
|
922
|
+
console.log(`${this.t('settings.reportBug.manualVisit', { url: 'https://github.com/vladnoskv/i18n-management-toolkit-main/issues' })}`);
|
|
837
923
|
}
|
|
838
924
|
|
|
839
925
|
await this.pause();
|
|
840
926
|
}
|
|
841
927
|
|
|
928
|
+
/**
|
|
929
|
+
* Update the i18n-toolkit package via npm
|
|
930
|
+
*/
|
|
931
|
+
async updatePackage() {
|
|
932
|
+
this.clearScreen();
|
|
933
|
+
this.showHeader();
|
|
934
|
+
console.log(`${colors.bright}${this.t('settings.updatePackage.title')}${colors.reset}\n`);
|
|
935
|
+
console.log(this.t('settings.updatePackage.description'));
|
|
936
|
+
console.log(`
|
|
937
|
+
${colors.dim}${this.t('settings.updatePackage.command')}: npm update i18ntk -g${colors.reset}
|
|
938
|
+
`);
|
|
939
|
+
|
|
940
|
+
const confirm = await this.prompt(this.t('settings.updatePackage.prompt'));
|
|
941
|
+
|
|
942
|
+
if (confirm.toLowerCase() === 'y') {
|
|
943
|
+
try {
|
|
944
|
+
const { exec } = require('child_process');
|
|
945
|
+
console.log(this.t('settings.updatePackage.updating'));
|
|
946
|
+
exec('npm update i18ntk -g', (error, stdout, stderr) => {
|
|
947
|
+
if (error) {
|
|
948
|
+
this.error(`${this.t('settings.updatePackage.error')}: ${error.message}`);
|
|
949
|
+
console.error(stderr);
|
|
950
|
+
} else {
|
|
951
|
+
this.success(this.t('settings.updatePackage.success'));
|
|
952
|
+
console.log(stdout);
|
|
953
|
+
}
|
|
954
|
+
this.pause();
|
|
955
|
+
});
|
|
956
|
+
} catch (error) {
|
|
957
|
+
this.error(`${this.t('settings.updatePackage.error')}: ${error.message}`);
|
|
958
|
+
this.pause();
|
|
959
|
+
}
|
|
960
|
+
} else {
|
|
961
|
+
this.warning(this.t('settings.updatePackage.cancelled'));
|
|
962
|
+
await this.pause();
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
842
966
|
/**
|
|
843
967
|
* Quit the application
|
|
844
968
|
*/
|
|
845
969
|
async quit() {
|
|
846
970
|
if (this.modified) {
|
|
847
|
-
console.log(`\n${colors.yellow}
|
|
848
|
-
const save = await this.prompt(
|
|
849
|
-
|
|
971
|
+
console.log(`\n${colors.yellow}${this.t('settings.mainMenu.unsavedChangesWarning')}${colors.reset}`);
|
|
972
|
+
const save = await this.prompt(this.t('settings.mainMenu.saveChangesBeforeQuit'));
|
|
973
|
+
|
|
850
974
|
if (save.toLowerCase() !== 'n') {
|
|
851
975
|
await this.saveSettings();
|
|
852
976
|
}
|
|
853
977
|
}
|
|
854
|
-
|
|
855
|
-
console.log(`\n${colors.green}
|
|
978
|
+
|
|
979
|
+
console.log(`\n${colors.green}${this.t('settings.goodbyeMessage')}${colors.reset}`);
|
|
856
980
|
this.rl.close();
|
|
857
981
|
process.exit(0);
|
|
858
982
|
}
|
|
@@ -22,6 +22,18 @@ class SettingsManager {
|
|
|
22
22
|
defaultLanguages: ['de', 'es', 'fr', 'ru'], // Default target languages | Example: ['de', 'es', 'fr', 'ru', 'ja', 'zh']
|
|
23
23
|
outputDir: './i18ntk-reports', // Default: './i18ntk-reports' | Example: './reports/i18n'
|
|
24
24
|
|
|
25
|
+
// Per-Script Directory Configuration (optional overrides)
|
|
26
|
+
scriptDirectories: {
|
|
27
|
+
analyze: null, // Custom sourceDir for i18ntk-analyze.js
|
|
28
|
+
init: null, // Custom sourceDir for i18ntk-init.js
|
|
29
|
+
validate: null, // Custom sourceDir for i18ntk-validate.js
|
|
30
|
+
complete: null, // Custom sourceDir for i18ntk-complete.js
|
|
31
|
+
manage: null, // Custom sourceDir for i18ntk-manage.js
|
|
32
|
+
summary: null, // Custom sourceDir for i18ntk-summary.js
|
|
33
|
+
usage: null, // Custom sourceDir for i18ntk-usage.js
|
|
34
|
+
sizing: null // Custom sourceDir for i18ntk-sizing.js
|
|
35
|
+
},
|
|
36
|
+
|
|
25
37
|
// Report Settings
|
|
26
38
|
reportLanguage: 'auto', // Default: 'auto' (matches UI language) | Options: 'auto', 'en', 'de', 'es', 'fr', 'ru', 'ja', 'zh'
|
|
27
39
|
|
|
@@ -158,6 +170,13 @@ class SettingsManager {
|
|
|
158
170
|
merged.advanced = { ...this.defaultConfig.advanced, ...loadedSettings.advanced };
|
|
159
171
|
}
|
|
160
172
|
|
|
173
|
+
if (loadedSettings.scriptDirectories) {
|
|
174
|
+
merged.scriptDirectories = {
|
|
175
|
+
...this.defaultConfig.scriptDirectories,
|
|
176
|
+
...loadedSettings.scriptDirectories
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
161
180
|
return merged;
|
|
162
181
|
}
|
|
163
182
|
|
|
@@ -1,66 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
2
|
+
"autorun": {
|
|
3
|
+
"missingRequiredFile": "[DE] Missing required file: {file}",
|
|
4
|
+
"runInitializationFirst": "[DE] Please run initialization first.",
|
|
5
|
+
"initializationCheckPassed": "[DE] Initialization check passed.",
|
|
6
|
+
"runningStep": "[DE] Running step: {stepName}",
|
|
7
|
+
"commandLabel": "[DE] Command: {command}",
|
|
8
|
+
"stepRunning": "[DE] Step '{stepName}' running...",
|
|
9
|
+
"stepCompletedWithTime": "[DE] Step '{stepName}' completed in {duration}ms.",
|
|
10
|
+
"stepCompleted": "[DE] Step '{stepName}' completed.",
|
|
11
|
+
"stepFailed": "[DE] Step '{stepName}' failed.",
|
|
12
|
+
"errorLabel": "[DE] Error: {error}",
|
|
13
|
+
"stepFailedWithError": "[DE] Step '{stepName}' failed with error: {error}",
|
|
14
|
+
"requiredStepFailed": "[DE] Required step failed. Stopping workflow.",
|
|
15
|
+
"optionalStepFailed": "[DE] Optional step failed. Continuing workflow.",
|
|
16
|
+
"startingAutoRunWorkflow": "[DE] Starting Auto-Run Workflow...",
|
|
17
|
+
"workflowIncludesSteps": "[DE] Workflow includes {count} steps:",
|
|
18
|
+
"stepRequired": "[DE] (Required)",
|
|
19
|
+
"stepOptional": "[DE] (Optional)",
|
|
20
|
+
"startingExecution": "[DE] Starting execution...",
|
|
21
|
+
"workflowStopped": "[DE] Workflow stopped.",
|
|
22
|
+
"workflowCompleted": "[DE] Workflow completed.",
|
|
23
|
+
"pressEnterToContinue": "[DE] Press Enter to continue...",
|
|
24
|
+
"runningSelectedSteps": "[DE] Running selected steps...",
|
|
25
|
+
"invalidStepNumber": "[DE] Invalid step number: {stepNum}",
|
|
26
|
+
"executionReport": "[DE] Execution Report:",
|
|
27
|
+
"successfulSteps": "[DE] Successful steps: {count}",
|
|
28
|
+
"failedSteps": "[DE] Failed steps: {count}",
|
|
29
|
+
"requiredFailedSteps": "[DE] Required steps failed: {count}",
|
|
30
|
+
"stepDetails": "[DE] Step Details:",
|
|
31
|
+
"errorDetails": "[DE] Error: {error}",
|
|
32
|
+
"reportSavedTo": "[DE] Report saved to: {path}",
|
|
33
|
+
"overallStatusSuccess": "[DE] SUCCESS",
|
|
34
|
+
"overallStatusFailed": "[DE] FAILED",
|
|
35
|
+
"overallStatus": "[DE] Overall Status: {status}",
|
|
36
|
+
"customSettingsConfiguration": "[DE] Custom Settings Configuration",
|
|
37
|
+
"pressEnterForDefaults": "[DE] Press Enter to use default settings for any prompt.",
|
|
38
|
+
"sourceDirPrompt": "[DE] Enter source directory (default: {default}): ",
|
|
39
|
+
"sourceLangPrompt": "[DE] Enter source language (default: {default}): ",
|
|
40
|
+
"targetLangsPrompt": "[DE] Enter target languages (comma-separated, default: {default}): ",
|
|
41
|
+
"translationMarkerPrompt": "[DE] Enter translation marker (default: {default}): ",
|
|
42
|
+
"outputDirPrompt": "[DE] Enter output directory for reports (default: {default}): ",
|
|
43
|
+
"settingsUpdatedSuccessfully": "[DE] Settings updated successfully!",
|
|
44
|
+
"errorConfiguringSettings": "[DE] Error configuring settings: {error}",
|
|
45
|
+
"autoRunScriptTitle": "[DE] Auto-Run Script",
|
|
46
|
+
"usageTitle": "[DE] Usage:",
|
|
47
|
+
"runAllSteps": "[DE] node i18ntk-autorun.js --all - Run all steps defined in i18ntk-config.json",
|
|
48
|
+
"configureSettingsFirst": "[DE] node i18ntk-autorun.js --config - Configure settings for the workflow",
|
|
49
|
+
"runSpecificSteps": "[DE] node i18ntk-autorun.js --steps <step_numbers> - Run specific steps (e.g., --steps 1,3,5)",
|
|
50
|
+
"showHelp": "[DE] node i18ntk-autorun.js --help - Show this help message",
|
|
51
|
+
"availableSteps": "[DE] Available Steps:",
|
|
52
|
+
"examplesTitle": "[DE] Examples:",
|
|
53
|
+
"configExample": "[DE] node i18ntk-autorun.js --config",
|
|
54
|
+
"stepsExample1": "[DE] node i18ntk-autorun.js --steps 1,2,3",
|
|
55
|
+
"stepsExample2": "[DE] node i18ntk-autorun.js --all",
|
|
56
|
+
"configurationComplete": "[DE] Configuration complete.",
|
|
57
|
+
"runAutoRunCommand": "[DE] Now you can run the auto-run command.",
|
|
58
|
+
"configurationFailed": "[DE] Configuration failed: {error}",
|
|
59
|
+
"noValidStepNumbers": "[DE] No valid step numbers provided.",
|
|
60
|
+
"autoRunFailed": "[DE] Auto-run failed: {error}",
|
|
61
|
+
"stepAnalyzeTranslations": "[DE] Analyze Translations",
|
|
62
|
+
"stepValidateTranslations": "[DE] Validate Translations",
|
|
63
|
+
"stepCheckUsage": "[DE] Check Usage",
|
|
64
|
+
"stepCompleteTranslations": "[DE] Complete Translations",
|
|
65
|
+
"stepAnalyzeSizing": "[DE] Analyze Sizing",
|
|
66
|
+
"stepGenerateSummary": "[DE] Generate Summary",
|
|
67
|
+
"translationLoadWarning": "[DE] Warning: Could not load {lang} translations",
|
|
68
|
+
"configReadError": "[DE] Error reading {file}",
|
|
69
|
+
"separator": "[DE] =================================================="
|
|
70
|
+
}
|
|
66
71
|
}
|