i18ntk 1.2.2 โ†’ 1.3.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +48 -2
  2. package/LICENSE +3 -1
  3. package/README.md +47 -46
  4. package/docs/README.md +40 -18
  5. package/docs/SCRIPT_DIRECTORY_GUIDE.md +224 -0
  6. package/docs/release-notes/v1.3.0.md +162 -0
  7. package/main/i18ntk-analyze.js +11 -6
  8. package/main/i18ntk-autorun.js +37 -36
  9. package/main/i18ntk-complete.js +9 -5
  10. package/main/i18ntk-init.js +16 -12
  11. package/main/i18ntk-manage.js +6 -4
  12. package/main/i18ntk-sizing.js +5 -1
  13. package/main/i18ntk-summary.js +6 -2
  14. package/main/i18ntk-usage.js +5 -5
  15. package/main/i18ntk-validate.js +9 -5
  16. package/package.json +12 -5
  17. package/scripts/copy-translations.js +90 -0
  18. package/settings/i18ntk-config.json +11 -1
  19. package/settings/settings-cli.js +136 -75
  20. package/settings/settings-manager.js +19 -0
  21. package/ui-locales/de/autorun.json +69 -64
  22. package/ui-locales/de/common.json +14 -1
  23. package/ui-locales/de/errors.json +11 -1
  24. package/ui-locales/de/menu.json +10 -1
  25. package/ui-locales/de/operations.json +11 -0
  26. package/ui-locales/de/security.json +2 -1
  27. package/ui-locales/de/settings.json +60 -9
  28. package/ui-locales/de/sizing.json +14 -1
  29. package/ui-locales/de/status.json +18 -1
  30. package/ui-locales/de/test-complete-system.json +13 -1
  31. package/ui-locales/en/autorun.json +68 -65
  32. package/ui-locales/en/common.json +15 -1
  33. package/ui-locales/en/init.json +20 -5
  34. package/ui-locales/en/menu.json +1 -0
  35. package/ui-locales/en/operations.json +11 -1
  36. package/ui-locales/en/settings.json +151 -34
  37. package/ui-locales/es/autorun.json +68 -65
  38. package/ui-locales/es/common.json +14 -1
  39. package/ui-locales/es/errors.json +11 -1
  40. package/ui-locales/es/menu.json +10 -1
  41. package/ui-locales/es/operations.json +11 -0
  42. package/ui-locales/es/security.json +2 -1
  43. package/ui-locales/es/settings.json +60 -9
  44. package/ui-locales/es/sizing.json +14 -1
  45. package/ui-locales/es/status.json +18 -1
  46. package/ui-locales/es/test-complete-system.json +13 -1
  47. package/ui-locales/fr/autorun.json +69 -64
  48. package/ui-locales/fr/common.json +14 -1
  49. package/ui-locales/fr/errors.json +11 -1
  50. package/ui-locales/fr/menu.json +10 -1
  51. package/ui-locales/fr/operations.json +11 -0
  52. package/ui-locales/fr/security.json +2 -1
  53. package/ui-locales/fr/settings.json +60 -9
  54. package/ui-locales/fr/sizing.json +14 -1
  55. package/ui-locales/fr/status.json +18 -1
  56. package/ui-locales/fr/test-complete-system.json +13 -1
  57. package/ui-locales/ja/autorun.json +69 -64
  58. package/ui-locales/ja/common.json +14 -1
  59. package/ui-locales/ja/errors.json +11 -1
  60. package/ui-locales/ja/menu.json +10 -1
  61. package/ui-locales/ja/operations.json +11 -0
  62. package/ui-locales/ja/security.json +2 -1
  63. package/ui-locales/ja/settings.json +60 -9
  64. package/ui-locales/ja/sizing.json +14 -1
  65. package/ui-locales/ja/status.json +18 -1
  66. package/ui-locales/ja/test-complete-system.json +13 -1
  67. package/ui-locales/pt/analyze.json +2 -1
  68. package/ui-locales/pt/autorun.json +69 -64
  69. package/ui-locales/pt/common.json +14 -1
  70. package/ui-locales/pt/errors.json +11 -1
  71. package/ui-locales/pt/init.json +5 -1
  72. package/ui-locales/pt/menu.json +10 -1
  73. package/ui-locales/pt/operations.json +11 -0
  74. package/ui-locales/pt/security.json +2 -1
  75. package/ui-locales/pt/settings.json +60 -9
  76. package/ui-locales/pt/sizing.json +14 -1
  77. package/ui-locales/pt/status.json +18 -1
  78. package/ui-locales/pt/test-complete-system.json +13 -1
  79. package/ui-locales/ru/autorun.json +69 -64
  80. package/ui-locales/ru/common.json +14 -1
  81. package/ui-locales/ru/errors.json +11 -1
  82. package/ui-locales/ru/menu.json +10 -1
  83. package/ui-locales/ru/operations.json +11 -0
  84. package/ui-locales/ru/security.json +2 -1
  85. package/ui-locales/ru/settings.json +60 -9
  86. package/ui-locales/ru/sizing.json +14 -1
  87. package/ui-locales/ru/status.json +18 -1
  88. package/ui-locales/ru/test-complete-system.json +13 -1
  89. package/ui-locales/zh/autorun.json +69 -64
  90. package/ui-locales/zh/common.json +14 -1
  91. package/ui-locales/zh/errors.json +11 -1
  92. package/ui-locales/zh/menu.json +10 -1
  93. package/ui-locales/zh/operations.json +11 -0
  94. package/ui-locales/zh/security.json +2 -1
  95. package/ui-locales/zh/settings.json +60 -9
  96. package/ui-locales/zh/sizing.json +13 -1
  97. package/ui-locales/zh/status.json +25 -8
  98. package/ui-locales/zh/test-complete-system.json +13 -1
  99. package/utils/test-complete-system.js +178 -162
  100. package/settings/backups/i18ntk-config-backup-2025-08-01T23-38-43-753Z.json +0 -117
  101. package/ui-locales/de-old.json +0 -705
  102. package/ui-locales/de.json +0 -15
  103. package/ui-locales/en-old.json +0 -709
  104. package/ui-locales/en.json +0 -15
  105. package/ui-locales/es-old.json +0 -654
  106. package/ui-locales/es.json +0 -15
  107. package/ui-locales/fr-old.json +0 -606
  108. package/ui-locales/fr.json +0 -15
  109. package/ui-locales/ja-old.json +0 -660
  110. package/ui-locales/ja.json +0 -15
  111. package/ui-locales/pt.json +0 -15
  112. package/ui-locales/ru-old.json +0 -655
  113. package/ui-locales/ru.json +0 -15
  114. package/ui-locales/zh-old.json +0 -647
  115. package/ui-locales/zh.json +0 -15
@@ -0,0 +1,162 @@
1
+ # i18n Management Toolkit v1.3.0 Release Notes
2
+
3
+ ## ๐Ÿš€ Release Overview
4
+
5
+ **Version:** 1.3.0
6
+ **Release Date:** August 2, 2025
7
+ **Type:** Major Feature Release
8
+ **Status:** Current Stable
9
+
10
+ This release introduces significant improvements to path resolution and directory configuration, addressing long-standing issues with relative path handling while adding powerful new customization features.
11
+
12
+ ## โœจ New Features
13
+
14
+ ### ๐ŸŽฏ Per-Script Directory Configuration
15
+ - **Individual Directory Control**: Configure different source directories for each script type (`analyze`, `complete`, `init`, `manage`)
16
+ - **Flexible Structure**: Use different directory layouts for different purposes
17
+ - **CLI Override Support**: Override directories via command-line arguments
18
+ - **Backward Compatibility**: Existing configurations continue to work unchanged
19
+
20
+ ### ๐Ÿ”ง Fixed Path Resolution Logic
21
+ - **Correct Relative Path Handling**: Fixed issue where relative paths were resolved from parent directory instead of project root
22
+ - **Consistent Behavior**: All scripts now handle paths consistently
23
+ - **Settings Compliance**: Analyzing logic now correctly follows settings configuration
24
+ - **Cross-Platform Support**: Improved path resolution across Windows, macOS, and Linux
25
+
26
+ ### ๐ŸŒ Enhanced Internationalization
27
+ - **Continued Language Support**: Maintained full compatibility with existing language configurations
28
+ - **Framework Integration**: Enhanced support for React, Vue, Angular, and Next.js applications
29
+ - **Locale Validation**: Improved locale code validation and error reporting
30
+
31
+ ### โš™๏ธ Configuration Improvements
32
+ - **Custom Directory Overrides**: Override any script directory via CLI arguments
33
+ - **Settings CLI Enhancement**: Improved configuration management interface
34
+ - **Migration Support**: Built-in tools for upgrading from v1.2.x
35
+ - **Validation Tools**: Enhanced configuration validation and error detection
36
+
37
+ ## ๐Ÿ› Bug Fixes
38
+
39
+ ### Path Resolution Issues
40
+ - **Fixed**: Relative paths in `sourceDir` and `outputDir` now resolve correctly from project root
41
+ - **Fixed**: Scripts no longer use incorrect parent directory as base for relative paths
42
+ - **Fixed**: Settings file paths now respect the configured project root
43
+
44
+ ### Configuration Issues
45
+ - **Fixed**: Settings loading now correctly prioritizes CLI arguments over configuration files
46
+ - **Fixed**: Directory auto-detection improved for complex project structures
47
+ - **Fixed**: Error messages now provide clearer guidance for configuration issues
48
+
49
+ ## ๐Ÿ“Š Breaking Changes
50
+
51
+ ### โš ๏ธ Migration Required
52
+ While this release maintains backward compatibility, we **strongly recommend** testing on a development branch before production deployment due to path resolution changes.
53
+
54
+ ### No Breaking API Changes
55
+ - All existing CLI commands work identically
56
+ - All existing configuration files are compatible
57
+ - All existing directory structures are supported
58
+
59
+ ## ๐Ÿ”„ Migration Guide
60
+
61
+ ### Step 1: Backup Your Configuration
62
+ ```bash
63
+ # Backup your current settings
64
+ cp .i18ntk-settings.json .i18ntk-settings.json.backup
65
+ cp i18ntk.config.js i18ntk.config.js.backup
66
+ ```
67
+
68
+ ### Step 2: Update to v1.3.0
69
+ ```bash
70
+ # Update the package
71
+ npm update i18n-management-toolkit
72
+
73
+ # Or reinstall
74
+ npm install --save-dev i18n-management-toolkit@latest
75
+ ```
76
+
77
+ ### Step 3: Test Configuration
78
+ ```bash
79
+ # Test your current configuration
80
+ npx i18ntk analyze --dry-run
81
+ npx i18ntk complete --dry-run
82
+ ```
83
+
84
+ ### Step 4: Configure Custom Directories (Optional)
85
+ ```bash
86
+ # Configure custom directories per script type
87
+ npx i18ntk init --custom-directories
88
+ ```
89
+
90
+ ### Step 5: Verify Production Setup
91
+ ```bash
92
+ # Run comprehensive validation
93
+ npx i18ntk validate
94
+ ```
95
+
96
+ ## ๐Ÿ“– Documentation Updates
97
+
98
+ ### New Documentation
99
+ - **[Script Directory Guide](../SCRIPT_DIRECTORY_GUIDE.md)** - Complete guide to custom directory configuration
100
+ - **[Migration Guide](../SCRIPT_DIRECTORY_GUIDE.md#migration-guide)** - Step-by-step migration instructions
101
+ - **[Configuration Examples](../SCRIPT_DIRECTORY_GUIDE.md#usage-examples)** - Real-world configuration examples
102
+
103
+ ### Updated Documentation
104
+ - **[API Reference](./api/API_REFERENCE.md)** - Updated with new directory configuration options
105
+ - **[Configuration Guide](./api/CONFIGURATION.md)** - Enhanced with per-script directory examples
106
+ - **[Framework Integration](./frameworks/README.md)** - Updated path resolution examples
107
+
108
+ ## ๐Ÿงช Testing Recommendations
109
+
110
+ ### Before Production Deployment
111
+ 1. **Create Development Branch**: Always test on a separate branch first
112
+ 2. **Run Dry-Run Commands**: Use `--dry-run` flag to preview changes
113
+ 3. **Validate Configuration**: Run `npx i18ntk validate` to check setup
114
+ 4. **Test All Scripts**: Verify `analyze`, `complete`, `init`, and `manage` scripts
115
+ 5. **Check Path Resolution**: Ensure relative paths work correctly in your environment
116
+
117
+ ### Testing Checklist
118
+ - [ ] All scripts run without errors
119
+ - [ ] Relative paths resolve correctly
120
+ - [ ] Custom directory configurations work as expected
121
+ - [ ] Existing translations are not affected
122
+ - [ ] Configuration validation passes
123
+ - [ ] Framework integration tests pass
124
+
125
+ ## ๐Ÿ› Known Issues
126
+
127
+ ### Current Limitations
128
+ - **Windows Path Separators**: Some edge cases with mixed path separators on Windows
129
+ - **Deep Nested Structures**: Very deep directory structures (>10 levels) may have performance impacts
130
+ - **Symbolic Links**: Limited support for symbolic links in directory paths
131
+
132
+ ### Future Improvements
133
+ - Enhanced symbolic link support
134
+ - Performance optimizations for large projects
135
+ - Additional framework-specific integrations
136
+
137
+ ## ๐Ÿ“Š Version Comparison
138
+
139
+ | Feature | v1.2.x | v1.3.0 |
140
+ |---------|---------|---------|
141
+ | Path Resolution | โŒ Incorrect relative paths | โœ… Correct from project root |
142
+ | Per-Script Directories | โŒ Not supported | โœ… Fully configurable |
143
+ | CLI Overrides | โŒ Limited | โœ… All directories supported |
144
+ | Migration Tools | โŒ Manual | โœ… Built-in guides |
145
+ | Framework Support | โœ… Basic | โœ… Enhanced |
146
+ | Backward Compatibility | โœ… Full | โœ… Full |
147
+
148
+ ## ๐ŸŽ‰ Acknowledgments
149
+
150
+ Special thanks to the community for reporting path resolution issues and providing valuable feedback on directory configuration needs. Your contributions have made this significant improvement possible.
151
+
152
+ ## ๐Ÿ“ž Support
153
+
154
+ - **[Issues](https://github.com/your-repo/i18n-management-toolkit/issues)** - Report bugs or request features
155
+ - **[Discussions](https://github.com/your-repo/i18n-management-toolkit/discussions)** - Ask questions or share ideas
156
+ - **[Documentation](../README.md)** - Comprehensive guides and examples
157
+
158
+ ---
159
+
160
+ **Next Release Preview:** v1.4.0 - Enhanced framework integrations and performance optimizations
161
+
162
+ **Upgrade Recommendation:** **HIGH** - All users should upgrade to benefit from path resolution fixes and new configuration features.
@@ -16,18 +16,23 @@ const fs = require('fs');
16
16
  const path = require('path');
17
17
  const readline = require('readline');
18
18
  const { loadTranslations, t } = require('../utils/i18n-helper');
19
+ const PROJECT_ROOT = process.cwd();
19
20
  const settingsManager = require('../settings/settings-manager');
20
21
  const SecurityUtils = require('../utils/security');
21
22
 
22
23
  // Get configuration from settings manager
23
24
  function getConfig() {
24
25
  const settings = settingsManager.getSettings();
26
+
27
+ // Check for per-script directory override, fallback to global sourceDir
28
+ const sourceDir = settings.scriptDirectories?.analyze || settings.sourceDir || './locales';
29
+
25
30
  return {
26
- sourceDir: settings.directories?.sourceDir || './locales',
27
- sourceLanguage: settings.directories?.sourceLanguage || 'en',
28
- notTranslatedMarker: settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
29
- outputDir: settings.directories?.outputDir || './i18ntk-reports',
30
- excludeFiles: settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
31
+ sourceDir: sourceDir,
32
+ sourceLanguage: settings.sourceLanguage || 'en',
33
+ notTranslatedMarker: settings.notTranslatedMarker || settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
34
+ outputDir: settings.outputDir || './i18ntk-reports',
35
+ excludeFiles: settings.excludeFiles || settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
31
36
  uiLanguage: settings.language || 'en'
32
37
  };
33
38
  }
@@ -572,7 +577,7 @@ class I18nAnalyzer {
572
577
  // Update config if source directory is provided
573
578
  if (args.sourceDir) {
574
579
  this.config.sourceDir = args.sourceDir;
575
- this.sourceDir = path.resolve(this.config.sourceDir);
580
+ this.sourceDir = path.resolve(PROJECT_ROOT, this.config.sourceDir);
576
581
  this.sourceLanguageDir = path.join(this.sourceDir, this.config.sourceLanguage);
577
582
  }
578
583
 
@@ -53,9 +53,10 @@ class AutoRunner {
53
53
  const filePath = path.join(localesDir, lang, 'autorun.json');
54
54
  if (fs.existsSync(filePath)) {
55
55
  try {
56
- translations[lang] = JSON.parse(fs.readFileSync(filePath, 'utf8'));
56
+ translations[lang] = translations[lang] || {};
57
+ translations[lang].autorun = JSON.parse(fs.readFileSync(filePath, 'utf8'));
57
58
  } catch (error) {
58
- console.warn(`Warning: Could not load ${lang} translations`);
59
+ console.warn(this.t('translationLoadWarning', lang).replace('{lang}', lang));
59
60
  }
60
61
  }
61
62
  });
@@ -69,7 +70,7 @@ class AutoRunner {
69
70
  try {
70
71
  return JSON.parse(fs.readFileSync(this.CONFIG_FILE, 'utf8'));
71
72
  } catch (error) {
72
- console.error(`Error reading ${this.CONFIG_FILE}:`, error.message);
73
+ console.error(this.t('configReadError', this.getSystemLanguage()).replace('{file}', this.CONFIG_FILE), error.message);
73
74
  return this.DEFAULT_CONFIG;
74
75
  }
75
76
  }
@@ -81,16 +82,16 @@ class AutoRunner {
81
82
  return envLang.substring(0, 2).toLowerCase();
82
83
  }
83
84
 
84
- translate(key, lang = 'en') {
85
+ t(key, lang = 'en') {
85
86
  const translations = this.loadTranslations();
86
87
 
87
- if (translations[lang] && translations[lang][key]) {
88
- return translations[lang][key];
88
+ if (translations[lang] && translations[lang].autorun && translations[lang].autorun[key]) {
89
+ return translations[lang].autorun[key];
89
90
  }
90
91
 
91
92
  // Fallback to English
92
- if (translations['en'] && translations['en'][key]) {
93
- return translations['en'][key];
93
+ if (translations['en'] && translations['en'].autorun && translations['en'].autorun[key]) {
94
+ return translations['en'].autorun[key];
94
95
  }
95
96
 
96
97
  // Return the key as fallback
@@ -99,24 +100,24 @@ class AutoRunner {
99
100
 
100
101
  displayHelp() {
101
102
  const lang = this.getSystemLanguage();
102
- console.log(`\n${this.translate('autoRunScriptTitle', lang)}`);
103
- console.log('='.repeat(50));
104
- console.log(`\n${this.translate('usageTitle', lang)}:`);
105
- console.log(` ${this.translate('runAllSteps')}`);
106
- console.log(` ${this.translate('configureSettingsFirst')}`);
107
- console.log(` ${this.translate('runSpecificSteps')}`);
108
- console.log(` ${this.translate('showHelp')}`);
109
- console.log(`\n${this.translate('examplesTitle', lang)}:`);
110
- console.log(` ${this.translate('configExample')}`);
111
- console.log(` ${this.translate('stepsExample1')}`);
112
- console.log(` ${this.translate('stepsExample2')}`);
103
+ console.log(`\n${this.t('autoRunScriptTitle', lang)}`);
104
+ console.log(this.t('separator', lang));
105
+ console.log(`\n${this.t('usageTitle', lang)}:`);
106
+ console.log(` ${this.t('runAllSteps')}`);
107
+ console.log(` ${this.t('configureSettingsFirst')}`);
108
+ console.log(` ${this.t('runSpecificSteps')}`);
109
+ console.log(` ${this.t('showHelp')}`);
110
+ console.log(`\n${this.t('examplesTitle', lang)}:`);
111
+ console.log(` ${this.t('configExample')}`);
112
+ console.log(` ${this.t('stepsExample1')}`);
113
+ console.log(` ${this.t('stepsExample2')}`);
113
114
  console.log();
114
115
  }
115
116
 
116
117
  displayConfig() {
117
118
  const lang = this.getSystemLanguage();
118
- console.log(`\n${this.translate('customSettingsConfiguration', lang)}`);
119
- console.log('='.repeat(30));
119
+ console.log(`\n${this.t('customSettingsConfiguration', lang)}`);
120
+ console.log(this.t('separator', lang));
120
121
 
121
122
  const config = this.loadConfig();
122
123
  console.log(JSON.stringify(config, null, 2));
@@ -128,22 +129,22 @@ class AutoRunner {
128
129
  const scriptPath = path.join(__dirname, step.script);
129
130
 
130
131
  if (!fs.existsSync(scriptPath)) {
131
- console.error(`${this.translate('stepFailed', lang)}: ${step.name}`);
132
- console.error(`${this.translate('errorLabel', lang)}: ${this.translate('missingRequiredFile', lang).replace('{file}', step.script)}`);
132
+ console.error(`${this.t('stepFailed', lang)}: ${step.name}`);
133
+ console.error(`${this.t('errorLabel', lang)}: ${this.t('missingRequiredFile', lang).replace('{file}', step.script)}`);
133
134
  return false;
134
135
  }
135
136
 
136
- console.log(`\n[${stepNumber}/${totalSteps}] ${this.translate('runningStep', lang).replace('{stepName}', step.name)}`);
137
- console.log(`${this.translate('commandLabel', lang).replace('{command}', step.description)}`);
138
- console.log('-'.repeat(50));
137
+ console.log(`\n[${stepNumber}/${totalSteps}] ${this.t('runningStep', lang).replace('{stepName}', step.name)}`);
138
+ console.log(`${this.t('commandLabel', lang).replace('{command}', step.description)}`);
139
+ console.log(this.t('separator', lang));
139
140
 
140
141
  try {
141
142
  execSync(`node "${scriptPath}"`, { stdio: 'inherit' });
142
- console.log(`โœ… ${this.translate('stepCompleted', lang).replace('{stepName}', step.name)}`);
143
+ console.log(`โœ… ${this.t('stepCompleted', lang).replace('{stepName}', step.name)}`);
143
144
  return true;
144
145
  } catch (error) {
145
- console.error(`โŒ ${this.translate('stepFailed', lang).replace('{stepName}', step.name)}`);
146
- console.error(`${this.translate('errorLabel', lang)}:`, error.message);
146
+ console.error(`โŒ ${this.t('stepFailed', lang).replace('{stepName}', step.name)}`);
147
+ console.error(`${this.t('errorLabel', lang)}:`, error.message);
147
148
  return false;
148
149
  }
149
150
  }
@@ -153,9 +154,9 @@ class AutoRunner {
153
154
  const config = this.loadConfig();
154
155
 
155
156
  if (!quiet) {
156
- console.log(`\n๐Ÿš€ ${this.translate('startingAutoRunWorkflow', lang)}...`);
157
- console.log('='.repeat(50));
158
- console.log(`${this.translate('workflowIncludesSteps', lang).replace('{count}', config.steps.length)}`);
157
+ console.log(`\n${this.t('startingAutoRunWorkflow', lang)}`);
158
+ console.log(this.t('separator', lang));
159
+ console.log(`${this.t('workflowIncludesSteps', lang).replace('{count}', config.steps.length)}`);
159
160
  }
160
161
 
161
162
  let successCount = 0;
@@ -167,16 +168,16 @@ class AutoRunner {
167
168
  successCount++;
168
169
  } else {
169
170
  if (!quiet) {
170
- console.error(`\nโŒ ${this.translate('workflowStopped', lang)}`);
171
+ console.error(`\n${this.t('workflowStopped', lang)}`);
171
172
  }
172
173
  process.exit(1);
173
174
  }
174
175
  }
175
176
 
176
177
  if (!quiet) {
177
- console.log(`\nโœ… ${this.translate('workflowCompleted', lang)}`);
178
- console.log(`${this.translate('successfulSteps', lang).replace('{count}', successCount)}`);
179
- console.log(`${this.translate('failedSteps', lang).replace('{count}', config.steps.length - successCount)}`);
178
+ console.log(`\n${this.t('workflowCompleted', lang)}`);
179
+ console.log(`${this.t('successfulSteps', lang).replace('{count}', successCount)}`);
180
+ console.log(`${this.t('failedSteps', lang).replace('{count}', config.steps.length - successCount)}`);
180
181
  }
181
182
  }
182
183
  }
@@ -21,11 +21,15 @@ const settingsManager = require('../settings/settings-manager');
21
21
  async function getConfig() {
22
22
  try {
23
23
  const settings = await settingsManager.getSettings();
24
+
25
+ // Check for per-script directory override, fallback to global sourceDir
26
+ const sourceDir = settings.scriptDirectories?.complete || settings.sourceDir || './locales';
27
+
24
28
  const config = {
25
- sourceDir: settings.directories?.sourceDir || './locales',
26
- sourceLanguage: settings.directories?.sourceLanguage || 'en',
27
- notTranslatedMarker: settings.directories?.notTranslatedMarker || 'NOT_TRANSLATED',
28
- excludeFiles: settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db']
29
+ sourceDir: sourceDir,
30
+ sourceLanguage: settings.sourceLanguage || 'en',
31
+ notTranslatedMarker: settings.notTranslatedMarker || settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
32
+ excludeFiles: settings.excludeFiles || settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db']
29
33
  };
30
34
 
31
35
  // Basic validation for required fields
@@ -285,7 +289,7 @@ class I18nCompletionTool {
285
289
 
286
290
  // Get missing keys from usage analysis
287
291
  getMissingKeysFromUsage() {
288
- const usageReportPath = path.join(process.cwd(), 'scripts', 'i18n', 'reports', 'usage-analysis.txt');
292
+ const usageReportPath = path.join(process.cwd(), 'reports', 'usage-analysis.txt');
289
293
 
290
294
  // Delete old report to ensure fresh data
291
295
  if (fs.existsSync(usageReportPath)) {
@@ -23,12 +23,16 @@ const UIi18n = require('./i18ntk-ui');
23
23
  // Get configuration from settings manager
24
24
  function getConfig() {
25
25
  const settings = settingsManager.getSettings();
26
+
27
+ // Check for per-script directory override, fallback to global sourceDir
28
+ const sourceDir = settings.scriptDirectories?.init || settings.sourceDir || './locales';
29
+
26
30
  return {
27
- sourceDir: settings.directories?.sourceDir || './locales',
28
- sourceLanguage: settings.directories?.sourceLanguage || 'en',
29
- defaultLanguages: settings.processing?.defaultLanguages || ['de', 'es', 'fr', 'ru'],
30
- notTranslatedMarker: settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
31
- excludeFiles: settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
31
+ sourceDir: sourceDir,
32
+ sourceLanguage: settings.sourceLanguage || 'en',
33
+ defaultLanguages: settings.defaultLanguages || settings.processing?.defaultLanguages || ['de', 'es', 'fr', 'ru'],
34
+ notTranslatedMarker: settings.notTranslatedMarker || settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
35
+ excludeFiles: settings.excludeFiles || settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
32
36
  uiLanguage: settings.language || 'en'
33
37
  };
34
38
  }
@@ -205,7 +209,7 @@ class I18nInitializer {
205
209
 
206
210
  if (existingLocations.length > 0) {
207
211
  console.log('\n' + this.ui.t('init.existingDirectoriesFound'));
208
- console.log('=' .repeat(50));
212
+ console.log(this.ui.t('common.separator'));
209
213
 
210
214
  existingLocations.forEach((location, index) => {
211
215
  console.log(` ${index + 1}. ${location}`);
@@ -572,7 +576,7 @@ class I18nInitializer {
572
576
  const question = (query) => new Promise(resolve => rl.question(query, resolve));
573
577
 
574
578
  console.log('\n' + this.ui.t('init.languageSelectionTitle'));
575
- console.log('=' .repeat(50));
579
+ console.log(this.ui.t('common.separator'));
576
580
  console.log(this.ui.t('language.available'));
577
581
 
578
582
  Object.entries(LANGUAGE_CONFIG).forEach(([code, config], index) => {
@@ -607,7 +611,7 @@ class I18nInitializer {
607
611
  async init() {
608
612
  try {
609
613
  console.log(this.ui.t('init.initializationTitle'));
610
- console.log('=' .repeat(50));
614
+ console.log(this.ui.t('common.separator'));
611
615
 
612
616
  // Parse command line arguments
613
617
  const args = this.parseArgs();
@@ -638,7 +642,7 @@ class I18nInitializer {
638
642
  await this.initialize(hasI18n, args);
639
643
 
640
644
  } catch (error) {
641
- console.error('โŒ Initialization failed:', error.message);
645
+ console.error(this.ui.t('init.errors.initializationFailed', { error: error.message }));
642
646
  throw error;
643
647
  } finally {
644
648
  if (this.shouldCloseRL && this.rl) {
@@ -751,7 +755,7 @@ class I18nInitializer {
751
755
  // Summary report
752
756
  console.log('\n' + '=' .repeat(50));
753
757
  console.log(this.ui.t('init.initializationSummaryTitle'));
754
- console.log('=' .repeat(50));
758
+ console.log(this.ui.t('common.separator'));
755
759
 
756
760
  Object.entries(results).forEach(([lang, data]) => {
757
761
  const langName = LANGUAGE_CONFIG[lang]?.name || 'Unknown';
@@ -782,8 +786,8 @@ module.exports = I18nInitializer;
782
786
  if (require.main === module) {
783
787
  const initializer = new I18nInitializer();
784
788
  initializer.init().catch(error => {
785
- console.error('โŒ Initialization failed:', error.message);
786
- console.error('Stack trace:', error.stack);
789
+ console.error(this.ui.t('common.initializationFailed', { error: error.message }));
790
+ console.error(this.ui.t('common.stackTrace', { stack: error.stack }));
787
791
  process.exit(1);
788
792
  });
789
793
  }
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  /**
3
3
  * I18N MANAGEMENT TOOLKIT - MAIN MANAGER
4
4
  *
@@ -100,9 +100,11 @@ class I18nManager {
100
100
  detectI18nDirectory() {
101
101
  const settings = settingsManager.getSettings();
102
102
 
103
- // Use settings configuration if available
104
- if (settings.directories?.sourceDir) {
105
- this.config.sourceDir = settings.directories.sourceDir;
103
+ // Use per-script directory configuration if available, fallback to global sourceDir
104
+ const sourceDir = settings.scriptDirectories?.manage || settings.sourceDir;
105
+
106
+ if (sourceDir) {
107
+ this.config.sourceDir = sourceDir;
106
108
  return;
107
109
  }
108
110
 
@@ -41,8 +41,12 @@ const SecurityUtils = require('../utils/security');
41
41
  // Get configuration from settings manager
42
42
  function getConfig() {
43
43
  const settings = settingsManager.getSettings();
44
+
45
+ // Check for per-script directory override, fallback to global sourceDir
46
+ const sourceDir = settings.scriptDirectories?.sizing || settings.sourceDir || './locales';
47
+
44
48
  return {
45
- sourceDir: settings.sourceDir || './locales',
49
+ sourceDir: sourceDir,
46
50
  outputDir: settings.outputDir || './i18ntk-reports',
47
51
  threshold: settings.processing?.sizingThreshold || 50,
48
52
  uiLanguage: settings.language || 'en'
@@ -9,11 +9,15 @@ const UIi18n = require('./i18ntk-ui');
9
9
  // Get configuration from settings manager
10
10
  function getConfig() {
11
11
  const settings = settingsManager.getSettings();
12
+
13
+ // Check for per-script directory override, fallback to global sourceDir
14
+ const sourceDir = settings.scriptDirectories?.summary || settings.sourceDir || null;
15
+
12
16
  return {
13
- sourceLanguage: settings.directories?.sourceLanguage || 'en',
17
+ sourceLanguage: settings.sourceLanguage || 'en',
14
18
  excludeFiles: settings.processing?.excludeFiles || ['index.js', 'index.ts', '.DS_Store'],
15
19
  supportedExtensions: settings.processing?.supportedExtensions || ['.json', '.js', '.ts'],
16
- sourceDir: settings.directories?.sourceDir || null,
20
+ sourceDir: sourceDir,
17
21
  uiLanguage: settings.language || 'en'
18
22
  };
19
23
  }
@@ -34,9 +34,9 @@ async function getConfig() {
34
34
  try {
35
35
  const settings = settingsManager.getSettings();
36
36
 
37
- // Only use auto-detection if no settings are configured
38
- let sourceDir = settings.directories?.sourceDir;
39
- let i18nDir = settings.directories?.i18nDir;
37
+ // Use per-script directory configuration if available, fallback to global settings
38
+ let sourceDir = settings.scriptDirectories?.usage || settings.sourceDir;
39
+ let i18nDir = settings.scriptDirectories?.usage || settings.i18nDir;
40
40
 
41
41
  // Auto-detect only if settings don't specify directories
42
42
  if (!sourceDir) {
@@ -111,8 +111,8 @@ async function getConfig() {
111
111
  const config = {
112
112
  sourceDir: sourceDir,
113
113
  i18nDir: i18nDir,
114
- sourceLanguage: settings.directories?.sourceLanguage || settings.sourceLanguage || 'en',
115
- outputDir: settings.directories?.outputDir || settings.outputDir || './i18ntk-reports',
114
+ sourceLanguage: settings.sourceLanguage || 'en',
115
+ outputDir: settings.outputDir || './i18ntk-reports',
116
116
  excludeDirs: settings.processing?.excludeDirs || [
117
117
  'node_modules', '.git', 'dist', 'build', '.next', '.nuxt',
118
118
  'i18ntk-reports', 'reports', 'dev', 'utils', 'test', 'tests'
@@ -27,12 +27,16 @@ async function getConfig(t) {
27
27
  try {
28
28
  SecurityUtils.logSecurityEvent(t('validate.configAccess'), 'info', 'Accessing configuration for validation');
29
29
  const settings = settingsManager.getSettings();
30
+
31
+ // Check for per-script directory override, fallback to global sourceDir
32
+ const sourceDir = settings.scriptDirectories?.validate || settings.sourceDir || './locales';
33
+
30
34
  const config = {
31
- sourceDir: settings.directories?.sourceDir || settings.sourceDir || './locales',
32
- sourceLanguage: settings.directories?.sourceLanguage || settings.sourceLanguage || 'en',
33
- notTranslatedMarker: settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
34
- excludeFiles: settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
35
- strictMode: settings.processing?.strictMode || false,
35
+ sourceDir: sourceDir,
36
+ sourceLanguage: settings.sourceLanguage || 'en',
37
+ notTranslatedMarker: settings.notTranslatedMarker || settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
38
+ excludeFiles: settings.excludeFiles || settings.processing?.excludeFiles || ['.DS_Store', 'Thumbs.db'],
39
+ strictMode: settings.strictMode || settings.processing?.strictMode || false,
36
40
  uiLanguage: settings.language || 'en'
37
41
  };
38
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18ntk",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
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",
@@ -20,7 +20,9 @@
20
20
  "analysis",
21
21
  "enterprise",
22
22
  "debugging",
23
- "reporting"
23
+ "reporting",
24
+ "path-resolution",
25
+ "directory-configuration"
24
26
  ],
25
27
  "homepage": "https://github.com/vladnoskv/i18n-management-toolkit-main#readme",
26
28
  "bugs": {
@@ -124,7 +126,7 @@
124
126
  },
125
127
  "preferGlobal": true,
126
128
  "versionInfo": {
127
- "version": "1.2.2",
129
+ "version": "1.3.0",
128
130
  "releaseDate": "02/08/2025",
129
131
  "lastUpdated": "02/08/2025",
130
132
  "maintainer": "Vladimir Noskov",
@@ -132,18 +134,23 @@
132
134
  "documentation": "./README.md",
133
135
  "apiReference": "./docs/api/API_REFERENCE.md",
134
136
  "majorChanges": [
137
+ "๐Ÿ†• Added per-script directory configuration support",
138
+ "๐Ÿ”ง Fixed path resolution to use relative paths from project root",
139
+ "๐ŸŒ Enhanced internationalization with new translation keys",
140
+ "๐Ÿ“ Added custom directory override for each script type",
141
+ "โš™๏ธ Improved settings CLI with script directory configuration",
135
142
  "๐Ÿงน Enhanced documentation and cleaned up npm metadata",
136
143
  "๐Ÿ› Marked all previous versions as deprecated due to bugs",
137
144
  "๐ŸŽ‰ Celebrated 200+ downloads milestone",
138
145
  "๐Ÿ”— Fixed repository URLs to point to correct GitHub location",
139
- "๐Ÿ“‹ Updated all version references to 1.2.0",
146
+ "๐Ÿ“‹ Updated all version references to 1.3.0",
140
147
  "๐ŸŒ Temporarily disabled UI language switching to focus on English core functionality",
141
148
  "๐Ÿ“Š Centralized reports in i18ntk-reports/ directory",
142
149
  "โš™๏ธ Organized configuration files in settings/ directory"
143
150
  ],
144
151
  "breakingChanges": ["Removed option 10 (Change UI language) from main menu"],
145
152
  "deprecations": ["<1.2.0", "1.0.x", "1.1.x"],
146
- "nextVersion": "1.2.1",
153
+ "nextVersion": "1.3.1",
147
154
  "supportedNodeVersions": ">=16.0.0",
148
155
  "supportedFrameworks": {
149
156
  "react-i18next": ">=11.0.0",