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.
- package/CHANGELOG.md +48 -2
- package/LICENSE +3 -1
- package/README.md +47 -46
- package/docs/README.md +40 -18
- package/docs/SCRIPT_DIRECTORY_GUIDE.md +224 -0
- package/docs/release-notes/v1.3.0.md +162 -0
- package/main/i18ntk-analyze.js +11 -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 +5 -1
- package/main/i18ntk-summary.js +6 -2
- package/main/i18ntk-usage.js +5 -5
- package/main/i18ntk-validate.js +9 -5
- package/package.json +12 -5
- package/scripts/copy-translations.js +90 -0
- package/settings/i18ntk-config.json +11 -1
- package/settings/settings-cli.js +136 -75
- 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 +60 -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 +151 -34
- 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 +60 -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
|
@@ -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.
|
package/main/i18ntk-analyze.js
CHANGED
|
@@ -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:
|
|
27
|
-
sourceLanguage: settings.
|
|
28
|
-
notTranslatedMarker: settings.processing?.notTranslatedMarker || 'NOT_TRANSLATED',
|
|
29
|
-
outputDir: settings.
|
|
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
|
|
package/main/i18ntk-autorun.js
CHANGED
|
@@ -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] =
|
|
56
|
+
translations[lang] = translations[lang] || {};
|
|
57
|
+
translations[lang].autorun = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
57
58
|
} catch (error) {
|
|
58
|
-
console.warn(
|
|
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(
|
|
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
|
-
|
|
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.
|
|
103
|
-
console.log('
|
|
104
|
-
console.log(`\n${this.
|
|
105
|
-
console.log(` ${this.
|
|
106
|
-
console.log(` ${this.
|
|
107
|
-
console.log(` ${this.
|
|
108
|
-
console.log(` ${this.
|
|
109
|
-
console.log(`\n${this.
|
|
110
|
-
console.log(` ${this.
|
|
111
|
-
console.log(` ${this.
|
|
112
|
-
console.log(` ${this.
|
|
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.
|
|
119
|
-
console.log('
|
|
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.
|
|
132
|
-
console.error(`${this.
|
|
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.
|
|
137
|
-
console.log(`${this.
|
|
138
|
-
console.log('
|
|
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.
|
|
143
|
+
console.log(`โ
${this.t('stepCompleted', lang).replace('{stepName}', step.name)}`);
|
|
143
144
|
return true;
|
|
144
145
|
} catch (error) {
|
|
145
|
-
console.error(`โ ${this.
|
|
146
|
-
console.error(`${this.
|
|
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
|
|
157
|
-
|
|
158
|
-
console.log(`${this.
|
|
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
|
|
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
|
|
178
|
-
console.log(`${this.
|
|
179
|
-
console.log(`${this.
|
|
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
|
}
|
package/main/i18ntk-complete.js
CHANGED
|
@@ -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:
|
|
26
|
-
sourceLanguage: settings.
|
|
27
|
-
notTranslatedMarker: settings.
|
|
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(), '
|
|
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)) {
|
package/main/i18ntk-init.js
CHANGED
|
@@ -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:
|
|
28
|
-
sourceLanguage: settings.
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
786
|
-
console.error('
|
|
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
|
}
|
package/main/i18ntk-manage.js
CHANGED
|
@@ -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
|
|
104
|
-
|
|
105
|
-
|
|
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
|
|
package/main/i18ntk-sizing.js
CHANGED
|
@@ -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:
|
|
49
|
+
sourceDir: sourceDir,
|
|
46
50
|
outputDir: settings.outputDir || './i18ntk-reports',
|
|
47
51
|
threshold: settings.processing?.sizingThreshold || 50,
|
|
48
52
|
uiLanguage: settings.language || 'en'
|
package/main/i18ntk-summary.js
CHANGED
|
@@ -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.
|
|
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:
|
|
20
|
+
sourceDir: sourceDir,
|
|
17
21
|
uiLanguage: settings.language || 'en'
|
|
18
22
|
};
|
|
19
23
|
}
|
package/main/i18ntk-usage.js
CHANGED
|
@@ -34,9 +34,9 @@ async function getConfig() {
|
|
|
34
34
|
try {
|
|
35
35
|
const settings = settingsManager.getSettings();
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
let sourceDir = settings.
|
|
39
|
-
let i18nDir = settings.
|
|
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.
|
|
115
|
-
outputDir: settings.
|
|
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'
|
package/main/i18ntk-validate.js
CHANGED
|
@@ -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:
|
|
32
|
-
sourceLanguage: settings.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
153
|
+
"nextVersion": "1.3.1",
|
|
147
154
|
"supportedNodeVersions": ">=16.0.0",
|
|
148
155
|
"supportedFrameworks": {
|
|
149
156
|
"react-i18next": ">=11.0.0",
|