i18ntk 1.3.0 → 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 CHANGED
@@ -1,7 +1,34 @@
1
1
  # Changelog
2
2
 
3
3
 
4
- **Current Version:** 1.3.0 (2025-08-02) - **SCRIPT DIRECTORY CONFIGURATION & PATH RESOLUTION FIXES** 🚀
4
+ **Current Version:** 1.3.1 (2025-12-2024) - **RESET TO DEFAULT VALUES & ENHANCED SETTINGS CLI** 🔄
5
+
6
+ ### 🆕 New Features
7
+ - **Reset to Default Values**: Added `r) Reset to Default Values` option to settings CLI menu for quick configuration reset
8
+ - **Enhanced Settings CLI**: Improved user experience with clear reset confirmation prompts
9
+ - **Safety Features**: Added confirmation prompt before resetting all directory configurations
10
+
11
+ ### 🔧 Configuration Improvements
12
+ - **One-Click Reset**: Reset all 8 script directory configurations to system defaults
13
+ - **Preserved Functionality**: All existing configurations remain intact until reset is confirmed
14
+ - **Audit Logging**: Reset operations are logged for troubleshooting purposes
15
+
16
+ ### 📋 Menu Enhancement
17
+ - **New Menu Option**: Added `r) Reset to Default Values` alongside existing `b) Back to main menu`
18
+ - **Enhanced Default Handling**: Users can type "default" to restore individual settings to system defaults
19
+ - **User-Specific Defaults**: Defaults adapt to actual project directory structure
20
+ - **Clear Navigation**: Users can now reset configurations without navigating through individual settings
21
+ - **Safe Defaults**: System defaults provide reliable starting points for new projects
22
+
23
+ ### 🔧 Script Output Improvements
24
+ - **Enhanced Script Output**: Added clear display of source directory, source language, and strict mode status at the beginning of analyze and sizing script runs
25
+ - **Absolute Path Display**: Scripts now show resolved absolute paths for better debugging and verification
26
+ - **Improved Sizing Analysis**: Enhanced translation length difference warnings with more actionable guidance and specific recommendations
27
+ - **Configuration Transparency**: Users can immediately see what configuration is being used for each script
28
+
29
+ ---
30
+
31
+ **Previous Version:** 1.3.0 (2025-08-02) - **SCRIPT DIRECTORY CONFIGURATION & PATH RESOLUTION FIXES** 🚀
5
32
 
6
33
  ### 🆕 New Features
7
34
  - **Per-Script Directory Configuration**: Added support for custom directory overrides for each script type (analyze, complete, init, manage, sizing, summary, usage, validate)
package/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  # i18ntk - i18n Management Toolkit
2
2
 
3
- [![version](https://badge.fury.io/js/i18ntk.svg)](https://badge.fury.io/js/i18ntk)
4
3
  [![npm](https://img.shields.io/npm/dt/i18ntk.svg)](https://www.npmjs.com/package/i18ntk)
5
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org/)
7
6
 
8
- **Version:** 1.3.0 – **i18ntk** (i18n Toolkit) is a comprehensive, internationalization management toolkit for JavaScript/TypeScript projects. It provides a complete CLI suite with multi-language support and advanced analysis capabilities for managing translations efficiently.
7
+ **Version:** 1.3.1 – **i18ntk** (i18n Toolkit) is a comprehensive, internationalization management toolkit for JavaScript/TypeScript projects. It provides a complete CLI suite with multi-language support and advanced analysis capabilities for managing translations efficiently.
9
8
 
10
9
  ## 🔧 Key Features
11
10
 
@@ -15,7 +14,7 @@
15
14
  - **Multi-Language Support**: UI available in 7 languages with partial internationalization
16
15
  - **Production-Ready**: Tested extensively in various environments
17
16
 
18
- **⚠️ Important Notice:** All previous versions (< 1.3.0) are now deprecated due to critical bugs and issues. Please upgrade to v1.3.0 for the most stable experience. We recommend backing up your project before upgrading and testing on a development branch first.
17
+ **⚠️ Important Notice:** All previous versions (< 1.3.1) are now deprecated due to critical bugs and issues. Please upgrade to v1.3.1 for the most stable experience. We recommend backing up your project before upgrading and testing on a development branch first.
19
18
 
20
19
  **🎉 Thank You:** 500+ downloads in the first week! Thank you for your support and patience as I resolve the functional issues. My First Published Package, please update to the latest version as any previous bugs were probably fixed.
21
20
 
@@ -88,7 +87,7 @@ npx i18ntk -v # 📋 Show detailed version information (short flag)
88
87
 
89
88
  **Important:** Direct command execution (e.g., `npx i18ntk usage`) now bypasses the interactive menu, allowing for more streamlined workflows and scripting.
90
89
 
91
- ## ✨ What's New in v1.3.0
90
+ ## ✨ What's New in v1.3.1
92
91
 
93
92
  ### 🆕 Script Directory Configuration
94
93
  - **New**: Added per-script directory configuration support for maximum flexibility
@@ -96,10 +95,11 @@ npx i18ntk -v # 📋 Show detailed version information (short flag)
96
95
  - **Enhanced**: Added comprehensive internationalization for all new configuration options
97
96
  - **Improved**: Settings CLI now includes script directory configuration menu
98
97
  - **Added**: Current working directory display and path guidance in CLI prompts
98
+ - **Reset to Defaults**: New menu option to reset all directory configurations to defaults
99
99
 
100
100
  ### 🐛 Previous Version Deprecation
101
- - **Status**: All versions < 1.3.0 are now deprecated due to critical bugs
102
- - **Recommendation**: Immediate upgrade to v1.3.0 for stable functionality
101
+ - **Status**: All versions < 1.3.1 are now deprecated due to critical bugs
102
+ - **Recommendation**: Immediate upgrade to v1.3.1 for stable functionality
103
103
  - **Migration**: Major-breaking-changes upgrading from any 1.0.x version. Uninstall, and reinstall and rerun initilization.
104
104
 
105
105
  ### ⬆️ Update Package Functionality
package/docs/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # I18N Management Toolkit - Documentation Hub
2
2
 
3
- **Version:** 1.3.0
4
- **Last Updated:** August 2, 2025
3
+ **Version:** 1.3.1
4
+ **Last Updated:** December 2024
5
5
  **Maintainer:** Vladimir Noskov
6
6
 
7
7
  ## ⚠️ Important Disclaimer
@@ -204,7 +204,8 @@ For enterprise support, custom integrations, or consulting services, please cont
204
204
  ## 🔄 Version History
205
205
 
206
206
  ### Recent Releases
207
- - **[v1.3.0](../CHANGELOG.md)** - Script Directory Configuration & Path Resolution Fixes (Current)
207
+ - **[v1.3.1](../CHANGELOG.md)** - Reset to default values option & Enhanced settings CLI (Current)
208
+ - **[v1.3.0](../CHANGELOG.md)** - Script Directory Configuration & Path Resolution Fixes
208
209
  - **[v1.2.3](../CHANGELOG.md)** - Documentation & Metadata Cleanup **(DEPRECATED)**
209
210
  - **[v1.1.5](../CHANGELOG.md)** - Internationalization Completion **(DEPRECATED)**
210
211
  - **[v1.1.4](../CHANGELOG.md)** - Translation System Enhancement **(DEPRECATED)**
@@ -1,8 +1,11 @@
1
1
  # Script Directory Configuration Guide
2
2
 
3
+ **Version:** 1.3.1
4
+ **Last Updated:** December 2024
5
+
3
6
  ## Overview
4
7
 
5
- Starting with **i18ntk v1.3.0**, we've introduced powerful new features for managing script directories and fixed critical path resolution issues. This guide explains how to configure custom directories for each script type and take advantage of the improved path handling.
8
+ Starting with **i18ntk v1.3.0**, we've introduced powerful new features for managing script directories and fixed critical path resolution issues. In **v1.3.1**, we've enhanced these features with reset functionality. This guide explains how to configure custom directories for each script type and take advantage of the improved path handling.
6
9
 
7
10
  ## 🆕 New Features in v1.3.0
8
11
 
@@ -36,7 +39,58 @@ node main/i18ntk-manage.js --command=settings
36
39
  node settings/settings-cli.js
37
40
  ```
38
41
 
39
- Navigate to **"Script Directory Configuration"** to configure individual directories for each script type.
42
+ Navigate to **"Script Directory Configuration"** to configure individual directories for each script type. In v1.3.1, you can now reset any directory to its default value using the new reset option.
43
+
44
+ #### Configuration Menu
45
+
46
+ When running the settings CLI, you'll see this menu:
47
+
48
+ ```
49
+ Enter new value (or press Enter to keep current):
50
+ 1) Analyze Script Directories
51
+ Current: /src/i18n/locales/test/
52
+ 2) Complete Setup Directories
53
+ Current: (not set)
54
+ 3) Initialize Script Directories
55
+ Current: (not set)
56
+ 4) Manage Script Directories
57
+ Current: (not set)
58
+ 5) Sizing Script Directories
59
+ Current: (not set)
60
+ 6) Summary Report Directories
61
+ Current: (not set)
62
+ 7) Usage Report Directories
63
+ Current: (not set)
64
+ 8) Validate Script Directories
65
+ Current: (not set)
66
+
67
+ b) Back to main menu
68
+ r) Reset to Default Values
69
+
70
+ Select setting to edit (or b for back, r for reset):
71
+ ```
72
+
73
+ #### Reset to Default Values
74
+
75
+ **New in v1.3.1**: You can now reset all directory configurations to their default values with a single option. When you select `r) Reset to Default Values`, the toolkit will:
76
+
77
+ - Reset all custom directory paths to their system defaults
78
+ - Clear any custom configurations you've set
79
+ - Restore the original directory structure
80
+ - Provide a confirmation prompt before proceeding
81
+
82
+ #### Using Default Values
83
+
84
+ Instead of leaving fields empty (which isn't possible after changes), you can now type `default` to restore individual settings to their default values. The defaults are based on your user directory settings:
85
+
86
+ - **Type "default"**: Use system default directory paths
87
+ - **Custom paths**: Any valid directory path will override defaults
88
+ - **Global settings**: Defaults respect your global project directory configuration
89
+
90
+ This approach provides:
91
+ - **Granular control**: Reset individual directories without affecting others
92
+ - **User-specific defaults**: Defaults adapt to your project structure
93
+ - **Better UX**: Clear "default" keyword instead of ambiguous empty inputs
40
94
 
41
95
  ### Method 2: Manual Configuration
42
96
 
@@ -0,0 +1,136 @@
1
+ # Release Notes - i18n Management Toolkit v1.3.1
2
+
3
+ **Release Date:** December 2024
4
+ **Version:** 1.3.1
5
+ **Previous Version:** 1.3.0
6
+
7
+ ## 🆕 New Features
8
+
9
+ ### Reset to Default Values Option
10
+ - **New Menu Option**: Added `r) Reset to Default Values` to the settings CLI menu
11
+ - **One-Click Reset**: Reset all directory configurations to their system defaults
12
+ - **Confirmation Prompt**: Includes safety confirmation before proceeding with reset
13
+ - **Safe Operation**: Preserves toolkit functionality while clearing custom configurations
14
+
15
+ ## 🎯 Use Cases for Reset Functionality
16
+
17
+ The new reset option is particularly useful for:
18
+
19
+ - **Testing Configurations**: Start fresh when testing different directory setups
20
+ - **Migration Scenarios**: Reset configurations when moving between project structures
21
+ - **Troubleshooting**: Clear potentially problematic custom settings
22
+ - **New Projects**: Quick setup for new projects without manual configuration cleanup
23
+
24
+ ## 🔧 Additional Improvements
25
+
26
+ ### Enhanced Script Output
27
+ - **Source Directory Display**: Added clear display of source directory, source language, and strict mode status at the beginning of analyze and sizing script runs
28
+ - **Absolute Path Display**: Scripts now show resolved absolute paths for better debugging and verification
29
+ - **Configuration Transparency**: Users can immediately see what configuration is being used
30
+
31
+ ### Improved Sizing Analysis
32
+ - **Better Recommendations**: Enhanced translation length difference warnings with more actionable guidance
33
+ - **Clear Guidance**: Sizing recommendations now provide specific, helpful advice instead of generic warnings
34
+ - **User-Friendly Output**: Improved formatting and messaging for better user experience
35
+
36
+ ## 📋 Menu Enhancement
37
+
38
+ The settings CLI now includes:
39
+
40
+ ```
41
+ Enter new value (or press Enter to keep current):
42
+ 1) Analyze Script Directories
43
+ Current: /src/i18n/locales/test/
44
+ 2) Complete Setup Directories
45
+ Current: (not set)
46
+ 3) Initialize Script Directories
47
+ Current: (not set)
48
+ 4) Manage Script Directories
49
+ Current: (not set)
50
+ 5) Sizing Script Directories
51
+ Current: (not set)
52
+ 6) Summary Report Directories
53
+ Current: (not set)
54
+ 7) Usage Report Directories
55
+ Current: (not set)
56
+ 8) Validate Script Directories
57
+ Current: (not set)
58
+
59
+ b) Back to main menu
60
+ r) Reset to Default Values
61
+
62
+ Select setting to edit (or b for back, r for reset):
63
+ ```
64
+
65
+ ### Enhanced Default Value Handling
66
+
67
+ **Improved UX**: Instead of leaving fields empty (which isn't possible after changes), users can now:
68
+
69
+ - **Type "default"**: Restore individual directory settings to system defaults
70
+ - **User-specific defaults**: Defaults adapt to your project directory structure
71
+ - **Granular control**: Reset individual settings without affecting others
72
+ - **Clear guidance**: Explicit "default" keyword instead of ambiguous empty inputs
73
+
74
+ This enhancement provides:
75
+ - **Better user experience**: Clear, unambiguous way to restore defaults
76
+ - **Flexibility**: Mix custom paths with default values as needed
77
+ - **Project-specific**: Defaults respect your actual project structure
78
+
79
+ ## 🔧 Technical Details
80
+
81
+ ### Reset Behavior
82
+ - **Scope**: Resets all 8 script directory configurations
83
+ - **Defaults**: Restores to system default directory paths
84
+ - **Safety**: Requires explicit user confirmation
85
+ - **Logging**: Logs reset operation for audit purposes
86
+
87
+ ### Compatibility
88
+ - **Backward Compatible**: All v1.3.0 features remain unchanged
89
+ - **No Breaking Changes**: Existing configurations are preserved
90
+ - **Safe Upgrade**: Users can upgrade without configuration loss
91
+
92
+ ## 📚 Documentation Updates
93
+
94
+ - Updated [Script Directory Guide](../SCRIPT_DIRECTORY_GUIDE.md) with reset functionality
95
+ - Added reset option examples and use cases
96
+ - Updated version references across all documentation
97
+ - Added troubleshooting section for reset scenarios
98
+
99
+ ## 🧪 Testing Recommendations
100
+
101
+ Before using in production:
102
+
103
+ 1. **Test Reset Function**: Verify reset works correctly with custom configurations
104
+ 2. **Backup Configurations**: Consider backing up current settings before reset
105
+ 3. **Verify Defaults**: Ensure default directory paths are appropriate for your environment
106
+ 4. **Integration Testing**: Test with existing project workflows
107
+
108
+ ## 🔄 Migration from v1.3.0
109
+
110
+ - **No Migration Required**: v1.3.1 is a minor enhancement
111
+ - **Configuration Preserved**: All existing settings remain intact
112
+ - **New Feature Only**: Reset functionality is additive, not replacement
113
+
114
+ ## 📊 Version History
115
+
116
+ - **v1.3.1**: Reset to default values option (current)
117
+ - **v1.3.0**: Per-script directory configuration, path resolution fixes
118
+ - **v1.2.x**: Previous stable releases with basic directory support
119
+
120
+ ## 🚀 Getting Started
121
+
122
+ To use the new reset functionality:
123
+
124
+ 1. Run the settings CLI: `npm run i18ntk:settings`
125
+ 2. Navigate to directory configuration
126
+ 3. Select `r) Reset to Default Values`
127
+ 4. Confirm the reset operation
128
+ 5. Verify restored default paths
129
+
130
+ ## ❓ Support
131
+
132
+ For questions about the reset functionality or any issues:
133
+
134
+ - Check the [Script Directory Guide](../SCRIPT_DIRECTORY_GUIDE.md)
135
+ - Review [troubleshooting section](../SCRIPT_DIRECTORY_GUIDE.md#troubleshooting)
136
+ - Open an issue on GitHub for technical problems
@@ -487,6 +487,9 @@ class I18nAnalyzer {
487
487
  const results = []; // Add this line to declare the results array
488
488
 
489
489
  console.log(this.t('analyze.starting') || '🔍 Starting translation analysis...');
490
+ console.log(`📁 Source directory: ${path.resolve(this.sourceDir)}`);
491
+ console.log(`🌍 Source language: ${this.config.sourceLanguage}`);
492
+ console.log(`⚙️ Strict mode: ${this.config.processing?.strictMode || this.config.strictMode ? 'ON' : 'OFF'}`);
490
493
 
491
494
  // Ensure output directory exists
492
495
  if (!fs.existsSync(this.outputDir)) {
@@ -354,27 +354,19 @@ class I18nSizingAnalyzer {
354
354
  if (data.isProblematic) {
355
355
  const comparison = data.percentageDifference > 0 ? 'longer' : 'shorter';
356
356
  const absPercentage = Math.abs(data.percentageDifference);
357
- recommendations.push(this.t('sizing.considerReviewingTranslations', {
358
- lang,
359
- percentageDifference: absPercentage,
360
- comparison
361
- }));
357
+ recommendations.push(`Review ${lang} translations - they are ${absPercentage}% ${comparison} than baseline. Consider UI layout adjustments or translation optimization.`);
362
358
  }
363
359
  });
364
360
 
365
361
  // Check for problematic keys
366
362
  if (this.stats.summary.problematicKeys.length > 0) {
367
- recommendations.push(this.t('sizing.keysHaveSignificantSizeVariations', { count: this.stats.summary.problematicKeys.length }));
363
+ recommendations.push(`${this.stats.summary.problematicKeys.length} keys have significant size variations. Check individual translations for potential layout issues.`);
368
364
  }
369
365
 
370
366
  // Check for very long translations
371
367
  Object.entries(this.stats.languages).forEach(([lang, data]) => {
372
368
  if (data.longKeys > 0) {
373
- recommendations.push(this.t('sizing.longTranslationsDetected', {
374
- lang,
375
- longKeys: data.longKeys,
376
- threshold: 100
377
- }));
369
+ recommendations.push(`${lang} has ${data.longKeys} translations exceeding 100 characters. Consider breaking into shorter segments or reviewing for conciseness.`);
378
370
  }
379
371
  });
380
372
 
@@ -383,6 +375,10 @@ class I18nSizingAnalyzer {
383
375
 
384
376
  // Display results in table format
385
377
  displayTable() {
378
+ console.log(`📁 Source directory: ${path.resolve(this.sourceDir)}`);
379
+ console.log(`🌍 Source language: ${this.config?.sourceLanguage || 'en'}`);
380
+ console.log(`⚙️ Strict mode: OFF`);
381
+ console.log();
386
382
  console.log(this.t("sizing.sizing_analysis_results"));
387
383
  console.log(this.t("sizing.separator"));
388
384
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18ntk",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "i18ntk (i18n Toolkit) - A comprehensive, enterprise-grade internationalization (i18n) management toolkit for JavaScript/TypeScript projects with advanced analysis, validation, and automation features",
5
5
  "keywords": [
6
6
  "i18n",
@@ -99,23 +99,15 @@
99
99
  "test": "node utils/test-complete-system.js"
100
100
  },
101
101
  "dependencies": {
102
- "html-parse-stringify": "^3.0.1",
103
- "i18next": "^25.3.2",
104
- "react": "^19.1.0",
105
- "react-i18next": "^15.6.1",
106
- "void-elements": "^3.1.0"
102
+ "i18next": "^25.3.2"
107
103
  },
108
104
  "devDependencies": {},
109
105
  "peerDependencies": {
110
- "i18next": ">=20.0.0",
111
- "react-i18next": "^15.6.1"
106
+ "i18next": ">=20.0.0"
112
107
  },
113
108
  "peerDependenciesMeta": {
114
109
  "i18next": {
115
110
  "optional": false
116
- },
117
- "react-i18next": {
118
- "optional": true
119
111
  }
120
112
  },
121
113
  "engines": {
@@ -126,9 +118,9 @@
126
118
  },
127
119
  "preferGlobal": true,
128
120
  "versionInfo": {
129
- "version": "1.3.0",
130
- "releaseDate": "02/08/2025",
131
- "lastUpdated": "02/08/2025",
121
+ "version": "1.3.1",
122
+ "releaseDate": "12/2024",
123
+ "lastUpdated": "12/2024",
132
124
  "maintainer": "Vladimir Noskov",
133
125
  "changelog": "./CHANGELOG.md",
134
126
  "documentation": "./README.md",
@@ -143,12 +135,14 @@
143
135
  "🐛 Marked all previous versions as deprecated due to bugs",
144
136
  "🎉 Celebrated 200+ downloads milestone",
145
137
  "🔗 Fixed repository URLs to point to correct GitHub location",
146
- "📋 Updated all version references to 1.3.0",
138
+ "📋 Updated all version references to 1.3.1",
147
139
  "🌐 Temporarily disabled UI language switching to focus on English core functionality",
148
140
  "📊 Centralized reports in i18ntk-reports/ directory",
149
- "⚙️ Organized configuration files in settings/ directory"
141
+ "⚙️ Organized configuration files in settings/ directory",
142
+ "🔄 Added reset to default values option",
143
+ "🧹 Cleaned up unused dependencies (React, react-i18next, html-parse-stringify, void-elements)"
150
144
  ],
151
- "breakingChanges": ["Removed option 10 (Change UI language) from main menu"],
145
+ "breakingChanges": ["Removed option 10 (Change UI language) from main menu (Feature under redevelopment)"],
152
146
  "deprecations": ["<1.2.0", "1.0.x", "1.1.x"],
153
147
  "nextVersion": "1.3.1",
154
148
  "supportedNodeVersions": ">=16.0.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "language": "en",
3
3
  "sizeLimit": null,
4
- "sourceDir": "./src/i18n/locales",
4
+ "sourceDir": "./locales",
5
5
  "sourceLanguage": "en",
6
6
  "defaultLanguages": [
7
7
  "de",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "outputDir": "./i18ntk-reports",
13
13
  "scriptDirectories": {
14
- "analyze": "/src/i18n/locales/test/",
14
+ "analyze": null,
15
15
  "init": null,
16
16
  "validate": null,
17
17
  "complete": null,
@@ -312,6 +312,12 @@ class SettingsCLI {
312
312
  });
313
313
 
314
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
+ }
315
321
  console.log();
316
322
 
317
323
  const choice = await this.prompt(this.t('settings.selectSettingPrompt'));
@@ -320,6 +326,12 @@ class SettingsCLI {
320
326
  return;
321
327
  }
322
328
 
329
+ if (choice.toLowerCase() === 'r' && isScriptDirectory) {
330
+ await this.resetScriptDirectories();
331
+ await this.showSettingsCategory(categorySettings);
332
+ return;
333
+ }
334
+
323
335
  const index = parseInt(choice) - 1;
324
336
  if (index >= 0 && index < keys.length) {
325
337
  const key = keys[index];
@@ -478,8 +490,19 @@ class SettingsCLI {
478
490
  return;
479
491
  }
480
492
 
481
- if (newValue.trim() === '') {
482
- return;
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
+ }
483
506
  }
484
507
 
485
508
  // Validate input
@@ -764,6 +787,46 @@ class SettingsCLI {
764
787
  await this.pause();
765
788
  }
766
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
+
767
830
  /**
768
831
  * Save current settings
769
832
  */
@@ -242,5 +242,12 @@
242
242
  "saveSuccess": "[DE] Settings saved successfully.",
243
243
  "saveFailed": "[DE] Failed to save settings.",
244
244
  "initFailed": "[DE] Failed to initialize settings: {error}",
245
- "invalidValueFormat": "[DE] Invalid value format."
245
+ "invalidValueFormat": "[DE] Invalid value format.",
246
+ "selectSettingPrompt": "Einstellung zum Bearbeiten auswählen (oder b für Zurück, r für Zurücksetzen): ",
247
+ "enterNewValue": "Neuen Wert eingeben (oder Enter drücken um aktuellen Wert zu behalten, 'default' eingeben um Systemstandard zu verwenden):",
248
+ "resetScriptDirectories": "Auf Standardwerte zurücksetzen",
249
+ "resetScriptDirectoriesTitle": "Skript-Verzeichnisse auf Standardwerte zurücksetzen",
250
+ "resetScriptDirectoriesWarning1": "Dies setzt alle Skript-Verzeichniskonfigurationen auf ihre Systemstandardwerte zurück.",
251
+ "resetScriptDirectoriesWarning2": "Alle benutzerdefinierten Verzeichnispfade werden gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.",
252
+ "resetScriptDirectoriesConfirm": "Sind Sie sicher, dass Sie alle Skript-Verzeichnisse auf Standardwerte zurücksetzen möchten? (y/N): "
246
253
  }
@@ -3,6 +3,7 @@
3
3
  "separator": "============================================================",
4
4
  "goodbyeMessage": "Thank you for using the i18ntk settings manager!",
5
5
  "relativePathHint": "Use relative paths from this directory (e.g., ./src/i18n/locales)",
6
+ "currentDirectory": "Current project directory",
6
7
  "mainMenu": {
7
8
  "title": "Main Menu:",
8
9
  "uiSettings": "UI Settings",
@@ -301,12 +302,17 @@
301
302
  },
302
303
  "current": "Current",
303
304
  "back": "Back to main menu",
304
- "selectSettingPrompt": "Select setting to edit (or b for back): ",
305
+ "selectSettingPrompt": "Select setting to edit (or b for back, r for reset): ",
305
306
  "invalidOption": "Invalid option.",
306
307
  "editing": "Editing",
307
- "enterNewValue": "Enter new value (or press Enter to keep current):",
308
+ "enterNewValue": "Enter new value (or press Enter to keep current, type 'default' to use system default):",
308
309
  "validOptions": "Valid options",
309
310
  "updatedSuccessfully": "updated successfully!",
310
- "noHelp": "No help available for this setting"
311
+ "noHelp": "No help available for this setting",
312
+ "resetScriptDirectories": "Reset to Default Values",
313
+ "resetScriptDirectoriesTitle": "Reset Script Directories to Defaults",
314
+ "resetScriptDirectoriesWarning1": "This will reset all script directory configurations to their system defaults.",
315
+ "resetScriptDirectoriesWarning2": "All custom directory paths will be cleared. This action cannot be undone.",
316
+ "resetScriptDirectoriesConfirm": "Are you sure you want to reset all script directories to defaults? (y/N): "
311
317
  }
312
318
 
@@ -14,6 +14,7 @@
14
14
  "syntaxErrorsCount": "❌ Syntax errors: {count}",
15
15
  "translationPercentage": "🎯 Translation: {percentage}% ({translated}/{total} keys)",
16
16
  "validationSummary": "📊 VALIDATION SUMMARY",
17
+ "validation_failed": "❌ Validation failed: {error}",
17
18
  "totalErrors": "❌ Total errors: {count}",
18
19
  "totalWarnings": "⚠️ Total warnings: {count}",
19
20
  "errorsSection": "❌ ERRORS",
@@ -242,5 +242,12 @@
242
242
  "saveSuccess": "[ZH] Settings saved successfully.",
243
243
  "saveFailed": "[ZH] Failed to save settings.",
244
244
  "initFailed": "[ZH] Failed to initialize settings: {error}",
245
- "invalidValueFormat": "[ZH] Invalid value format."
245
+ "invalidValueFormat": "[ZH] Invalid value format.",
246
+ "selectSettingPrompt": "选择要编辑的设置(或b返回,r重置):",
247
+ "enterNewValue": "输入新值(或按Enter键保持当前值,输入'default'使用系统默认值):",
248
+ "resetScriptDirectories": "重置为默认值",
249
+ "resetScriptDirectoriesTitle": "将脚本目录重置为默认值",
250
+ "resetScriptDirectoriesWarning1": "这将把所有脚本目录配置重置为系统默认值。",
251
+ "resetScriptDirectoriesWarning2": "所有自定义目录路径将被清除。此操作无法撤消。",
252
+ "resetScriptDirectoriesConfirm": "您确定要将所有脚本目录重置为默认值吗?(y/N):"
246
253
  }