i18ntk 1.4.0 → 1.4.2

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 (107) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +410 -20
  3. package/locales/de/common.json +17 -20
  4. package/locales/en/common.json +17 -20
  5. package/locales/es/common.json +17 -20
  6. package/locales/fr/common.json +17 -20
  7. package/locales/ru/common.json +17 -20
  8. package/main/i18ntk-manage.js +52 -24
  9. package/package.json +6 -8
  10. package/{dev → scripts}/debug/README.md +9 -5
  11. package/{dev → scripts}/debug/debugger.js +84 -4
  12. package/scripts/prepublish.js +2 -2
  13. package/scripts/validate-all-translations.js +2 -2
  14. package/ui-locales/de/debug.json +5 -5
  15. package/ui-locales/de/init.json +1 -0
  16. package/ui-locales/de/language.json +11 -2
  17. package/ui-locales/de/security.json +2 -1
  18. package/ui-locales/de/sizing.json +1 -0
  19. package/ui-locales/de/usage.json +1 -0
  20. package/ui-locales/en/debug.json +5 -5
  21. package/ui-locales/en/init.json +1 -0
  22. package/ui-locales/en/language.json +11 -2
  23. package/ui-locales/en/security.json +2 -1
  24. package/ui-locales/en/sizing.json +2 -0
  25. package/ui-locales/en/usage.json +1 -0
  26. package/ui-locales/es/debug.json +5 -5
  27. package/ui-locales/es/init.json +1 -0
  28. package/ui-locales/es/language.json +11 -2
  29. package/ui-locales/es/security.json +2 -1
  30. package/ui-locales/es/sizing.json +2 -0
  31. package/ui-locales/es/usage.json +1 -0
  32. package/ui-locales/fr/debug.json +5 -5
  33. package/ui-locales/fr/init.json +1 -0
  34. package/ui-locales/fr/language.json +11 -2
  35. package/ui-locales/fr/security.json +2 -1
  36. package/ui-locales/fr/sizing.json +2 -0
  37. package/ui-locales/fr/usage.json +1 -0
  38. package/ui-locales/ja/debug.json +5 -5
  39. package/ui-locales/ja/init.json +1 -0
  40. package/ui-locales/ja/language.json +11 -2
  41. package/ui-locales/ja/security.json +2 -1
  42. package/ui-locales/ja/sizing.json +3 -0
  43. package/ui-locales/ja/usage.json +1 -0
  44. package/ui-locales/pt/debug.json +5 -5
  45. package/ui-locales/pt/init.json +1 -0
  46. package/ui-locales/pt/language.json +11 -2
  47. package/ui-locales/pt/security.json +2 -1
  48. package/ui-locales/pt/sizing.json +2 -0
  49. package/ui-locales/pt/usage.json +1 -0
  50. package/ui-locales/ru/debug.json +5 -5
  51. package/ui-locales/ru/init.json +1 -0
  52. package/ui-locales/ru/language.json +11 -2
  53. package/ui-locales/ru/security.json +2 -1
  54. package/ui-locales/ru/sizing.json +2 -0
  55. package/ui-locales/ru/usage.json +1 -0
  56. package/ui-locales/zh/debug.json +5 -5
  57. package/ui-locales/zh/init.json +1 -0
  58. package/ui-locales/zh/language.json +11 -2
  59. package/ui-locales/zh/security.json +2 -1
  60. package/ui-locales/zh/sizing.json +2 -0
  61. package/ui-locales/zh/usage.json +1 -0
  62. package/utils/test-complete-system.js +1 -1
  63. package/dev/README.md +0 -37
  64. package/docs/INSTALLATION.md +0 -98
  65. package/docs/PIN_PROTECTION_GUIDE.md +0 -265
  66. package/docs/README.md +0 -111
  67. package/docs/SCRIPT_DIRECTORY_GUIDE.md +0 -278
  68. package/docs/TODO_ROADMAP.md +0 -279
  69. package/docs/TRANSLATION_STATUS.md +0 -67
  70. package/docs/api/API_REFERENCE.md +0 -258
  71. package/docs/api/COMPONENTS.md +0 -492
  72. package/docs/api/CONFIGURATION.md +0 -676
  73. package/docs/api/NPM_PUBLISHING_GUIDE.md +0 -426
  74. package/docs/debug/DEBUG_README.md +0 -30
  75. package/docs/debug/DEBUG_TOOLS.md +0 -152
  76. package/docs/development/AGENTS.md +0 -349
  77. package/docs/development/DEVELOPMENT_RULES.md +0 -165
  78. package/docs/development/DEV_README.md +0 -41
  79. package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +0 -175
  80. package/docs/release-notes/RELEASE_NOTES_v1.0.4.md +0 -153
  81. package/docs/release-notes/RELEASE_NOTES_v1.1.2.md +0 -68
  82. package/docs/release-notes/RELEASE_NOTES_v1.1.5.md +0 -81
  83. package/docs/release-notes/RELEASE_NOTES_v1.4.0.md +0 -115
  84. package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +0 -141
  85. package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +0 -185
  86. package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +0 -199
  87. package/docs/release-notes/v1.3.0.md +0 -162
  88. package/docs/release-notes/v1.3.1.md +0 -136
  89. package/docs/reports/ANALYSIS_README.md +0 -17
  90. package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +0 -181
  91. package/docs/reports/SIZING_README.md +0 -18
  92. package/docs/reports/SUMMARY_README.md +0 -18
  93. package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +0 -129
  94. package/docs/reports/USAGE_README.md +0 -18
  95. package/docs/reports/VALIDATION_README.md +0 -18
  96. /package/{dev → scripts}/debug/complete-console-translations.js +0 -0
  97. /package/{dev → scripts}/debug/console-key-checker.js +0 -0
  98. /package/{dev → scripts}/debug/console-translations.js +0 -0
  99. /package/{dev → scripts}/debug/debug-security.js +0 -0
  100. /package/{dev → scripts}/debug/debug-translation.js +0 -0
  101. /package/{dev → scripts}/debug/export-missing-keys.js +0 -0
  102. /package/{dev → scripts}/debug/final-normalize.js +0 -0
  103. /package/{dev → scripts}/debug/find-extra-keys.js +0 -0
  104. /package/{dev → scripts}/debug/normalize-locales.js +0 -0
  105. /package/{dev → scripts}/debug/refactor-locales.js +0 -0
  106. /package/{dev → scripts}/debug/reorder-locales.js +0 -0
  107. /package/{dev → scripts}/debug/replace-hardcoded-console.js +0 -0
@@ -1,265 +0,0 @@
1
- # PIN Protection Guide
2
-
3
- ## Overview
4
-
5
- The i18n Management Toolkit v1.4.0 introduces advanced PIN protection capabilities, providing granular security control over sensitive operations. This guide covers the complete PIN protection system, from basic setup to advanced configuration.
6
-
7
- ## PIN Protection Features
8
-
9
- ### 🔐 Core Security Features
10
- - **Global Admin PIN**: Master authentication for all sensitive settings
11
- - **Script-Specific Protection**: Individual PIN requirements for each sensitive script
12
- - **Configurable Protection**: Enable/disable protection per script
13
- - **Session Management**: Secure session handling with automatic timeout
14
- - **Failed Attempt Tracking**: Configurable lockout after failed attempts
15
-
16
- ### 🎯 Protected Scripts
17
- The following scripts can be individually protected:
18
-
19
- 1. **Debug Tools Menu** (`debugMenu`) - Access to debugging utilities
20
- 2. **Delete Reports** (`deleteReports`) - Report deletion functionality
21
- 3. **Summary Reports** (`summaryReports`) - Report generation
22
- 4. **Settings Menu** (`settingsMenu`) - Configuration access
23
- 5. **Initialize Script** (`initScript`) - Project initialization
24
-
25
- ## Configuration
26
-
27
- ### Initial Setup
28
-
29
- 1. **Enable Global PIN Protection**:
30
- ```bash
31
- npm run settings
32
- ```
33
- Navigate to Security Settings → Enable PIN Protection
34
-
35
- 2. **Set Admin PIN**:
36
- - First-time setup will prompt for PIN creation
37
- - PIN is encrypted using AES-256-GCM
38
- - Minimum 4 digits, maximum 20 characters
39
-
40
- 3. **Configure Script Protection**:
41
- - Security Settings → Configure PIN Protected Scripts
42
- - Toggle protection for individual scripts
43
- - View current protection status
44
-
45
- ### Settings Configuration
46
-
47
- Key settings in your configuration:
48
-
49
- ```json
50
- {
51
- "security": {
52
- "adminPinEnabled": true,
53
- "pinProtection": {
54
- "enabled": true,
55
- "protectedScripts": {
56
- "debugMenu": true,
57
- "deleteReports": true,
58
- "summaryReports": false,
59
- "settingsMenu": true,
60
- "initScript": false
61
- }
62
- },
63
- "maxFailedAttempts": 5,
64
- "lockoutDuration": 15,
65
- "sessionTimeout": 30
66
- }
67
- }
68
- ```
69
-
70
- ## Usage
71
-
72
- ### Accessing Protected Scripts
73
-
74
- When PIN protection is enabled, accessing protected scripts will prompt:
75
-
76
- ```
77
- 🔐 PIN Required for [Script Name]
78
- Enter PIN: ****
79
- ```
80
-
81
- ### Managing PIN Protection
82
-
83
- #### Via Settings CLI
84
- ```bash
85
- npm run settings
86
- # Navigate: Security Settings → Configure PIN Protected Scripts
87
- ```
88
-
89
- #### Via Direct Configuration
90
- Edit `settings/.i18n-admin-config.json` directly (requires existing PIN):
91
-
92
- ```json
93
- {
94
- "security": {
95
- "pinProtection": {
96
- "protectedScripts": {
97
- "debugMenu": true,
98
- "deleteReports": false,
99
- "summaryReports": true,
100
- "settingsMenu": true,
101
- "initScript": false
102
- }
103
- }
104
- }
105
- }
106
- ```
107
-
108
- ## Security Features
109
-
110
- ### 🔒 Encryption
111
- - **PIN Storage**: AES-256-GCM encryption
112
- - **Key Derivation**: PBKDF2 with 100,000 iterations
113
- - **Salt Generation**: Cryptographically secure random salt
114
- - **Session Encryption**: Encrypted session tokens
115
-
116
- ### 🛡️ Failed Attempt Protection
117
- - **Tracking**: Monitors failed PIN attempts
118
- - **Lockout**: Temporary lockout after max attempts
119
- - **Duration**: Configurable lockout period (default: 15 minutes)
120
- - **Reset**: Automatic reset after lockout period
121
-
122
- ### ⏰ Session Management
123
- - **Timeout**: Configurable session duration (default: 30 minutes)
124
- - **Cleanup**: Automatic cleanup on process termination
125
- - **Re-auth**: Required after timeout expiration
126
-
127
- ## Configuration Options
128
-
129
- ### Security Settings
130
-
131
- | Setting | Type | Default | Description |
132
- |---------|------|---------|-------------|
133
- | `adminPinEnabled` | boolean | false | Enable global admin PIN |
134
- | `pinProtection.enabled` | boolean | false | Enable script-specific protection |
135
- | `maxFailedAttempts` | number | 5 | Failed attempts before lockout |
136
- | `lockoutDuration` | number | 15 | Lockout duration in minutes |
137
- | `sessionTimeout` | number | 30 | Session timeout in minutes |
138
-
139
- ### Script Protection Mapping
140
-
141
- | Script | Description | Recommended |
142
- |--------|-------------|-------------|
143
- | `debugMenu` | Debug utilities | Yes |
144
- | `deleteReports` | Report deletion | Yes |
145
- | `summaryReports` | Report generation | Optional |
146
- | `settingsMenu` | Configuration access | Yes |
147
- | `initScript` | Project initialization | Optional |
148
-
149
- ## Internationalization
150
-
151
- PIN protection features are fully translated across all supported languages:
152
-
153
- - **English** (en)
154
- - **German** (de)
155
- - **Spanish** (es)
156
- - **French** (fr)
157
- - **Russian** (ru)
158
- - **Japanese** (ja)
159
- - **Chinese** (zh)
160
- - **Portuguese** (pt)
161
-
162
- All PIN prompts, error messages, and configuration options are localized.
163
-
164
- ## Troubleshooting
165
-
166
- ### Common Issues
167
-
168
- #### Forgotten PIN
169
- 1. Reset configuration to defaults:
170
- ```bash
171
- npm run settings
172
- # Navigate to Security Settings → Reset All PIN Protections
173
- ```
174
-
175
- 2. Manual reset (advanced):
176
- ```bash
177
- rm settings/.i18n-admin-config.json
178
- npm run init
179
- ```
180
-
181
- #### Locked Out
182
- - **Wait**: Automatic unlock after lockout duration
183
- - **Check**: Review failed attempt logs
184
- - **Reset**: Use reset functionality if authorized
185
-
186
- #### Configuration Issues
187
- - **Verify**: Check `settings/.i18n-admin-config.json` format
188
- - **Validate**: Use settings CLI validation
189
- - **Reset**: Reset to defaults if corrupted
190
-
191
- ### Debug Mode
192
-
193
- Enable debug logging:
194
- ```bash
195
- DEBUG=i18ntk:* npm run [script]
196
- ```
197
-
198
- ## Best Practices
199
-
200
- ### Security Recommendations
201
-
202
- 1. **Use Strong PINs**: Minimum 6 digits, avoid sequential patterns
203
- 2. **Enable Protection**: Protect critical scripts (debug, delete, settings)
204
- 3. **Regular Review**: Periodically review protection settings
205
- 4. **Backup Configuration**: Keep secure backups of settings
206
- 5. **Monitor Access**: Review authentication logs regularly
207
-
208
- ### Configuration Management
209
-
210
- 1. **Version Control**: Exclude `settings/.i18n-admin-config.json` from version control
211
- 2. **Environment Specific**: Use environment-specific configurations
212
- 3. **Documentation**: Document protection requirements for team members
213
- 4. **Testing**: Test PIN protection in development before production
214
-
215
- ## API Reference
216
-
217
- ### AdminAuth Class
218
-
219
- ```javascript
220
- const adminAuth = require('./utils/admin-auth');
221
-
222
- // Check if PIN is required for a script
223
- const required = adminAuth.isAuthRequiredForScript('debugMenu');
224
-
225
- // Validate PIN
226
- const valid = await adminAuth.validatePin('1234');
227
-
228
- // Get session status
229
- const session = adminAuth.getSessionStatus();
230
- ```
231
-
232
- ### Settings Manager
233
-
234
- ```javascript
235
- const settingsManager = require('./settings/settings-manager');
236
-
237
- // Get PIN protection configuration
238
- const config = settingsManager.getSettings();
239
- const protection = config.security.pinProtection;
240
-
241
- // Update protection settings
242
- await settingsManager.updateSetting('security.pinProtection.protectedScripts.debugMenu', true);
243
- ```
244
-
245
- ## Migration Guide
246
-
247
- ### From v1.3.x to v1.4.0
248
-
249
- 1. **Backup**: Create backup of existing configuration
250
- 2. **Update**: Install v1.4.0
251
- 3. **Configure**: Enable PIN protection as needed
252
- 4. **Test**: Verify all scripts work with new protection
253
-
254
- ### Configuration Migration
255
- - Existing configurations remain compatible
256
- - New PIN protection features are opt-in
257
- - No breaking changes to existing functionality
258
-
259
- ## Support
260
-
261
- For additional support:
262
- - **Issues**: Create GitHub issue with PIN protection tag
263
- - **Documentation**: Refer to project documentation
264
- - **Examples**: Check example configurations in `/examples`
265
- - **Community**: Join project discussions on GitHub
package/docs/README.md DELETED
@@ -1,111 +0,0 @@
1
- # i18ntk Documentation
2
-
3
- **Version:** 1.4.0 (04/08/2025)
4
-
5
- ## Overview
6
-
7
- i18ntk is a comprehensive internationalization toolkit for JavaScript/TypeScript projects. It provides automated translation management, validation, and reporting capabilities.
8
-
9
- ## What's New in v1.4.0
10
-
11
- - **Advanced PIN Protection System** - Script-level authentication with AES-256 encryption
12
- - **Enhanced Settings Validation** - Comprehensive input validation and reset functionality
13
- - **Prepublish Cleanup** - Automated package optimization before release
14
- - **Complete Translation Updates** - 100% coverage across 8 languages
15
- - **Enhanced Security Features** - Granular access controls and audit logging
16
-
17
- ## Quick Start
18
-
19
- ```bash
20
- npm install i18ntk --save-dev
21
- npx i18ntk init
22
- npx i18ntk analyze
23
- ```
24
-
25
- ## Core Features
26
-
27
- ### Translation Management
28
- - **Initialize** - Set up i18n structure
29
- - **Analyze** - Check translation completeness
30
- - **Validate** - Ensure file integrity
31
- - **Complete** - Fill missing translations
32
- - **Usage** - Analyze key utilization
33
-
34
- ### Security
35
- - **PIN Protection** - Configurable script-level authentication
36
- - **Session Management** - 30-minute timeout with re-authentication
37
- - **Encryption** - AES-256-GCM for secure storage
38
- - **Audit Logging** - Complete security event tracking
39
-
40
- ### Reporting
41
- - **Analysis Reports** - Translation completeness
42
- - **Validation Reports** - File integrity checks
43
- - **Usage Reports** - Key utilization patterns
44
- - **Sizing Reports** - Performance metrics
45
- - **Summary Reports** - Project overview
46
-
47
- ## Available Commands
48
-
49
- | Command | Description |
50
- |---------|-------------|
51
- | `npx i18ntk` | Interactive management menu |
52
- | `npx i18ntk init` | Initialize i18n structure |
53
- | `npx i18ntk analyze` | Analyze translation completeness |
54
- | `npx i18ntk validate` | Validate translation files |
55
- | `npx i18ntk usage` | Check key usage in source |
56
- | `npx i18ntk complete` | Complete missing translations |
57
- | `npx i18ntk sizing` | Analyze file sizes |
58
- | `npx i18ntk summary` | Generate comprehensive reports |
59
- | `npx i18ntk autorun` | Run complete workflow |
60
-
61
- ## Language Support (Now Supporting **8 Languages**)
62
-
63
- - English (en)
64
- - German (de)
65
- - Spanish (es)
66
- - French (fr)
67
- - Portuguese (pt)
68
- - Japanese (ja)
69
- - Russian (ru)
70
- - Chinese (zh)
71
-
72
- ## Documentation Structure
73
-
74
- - **[Installation Guide](INSTALLATION.md)** - Setup instructions
75
- - **[API Reference](api/API_REFERENCE.md)** - Complete command reference
76
- - **[Configuration Guide](api/CONFIGURATION.md)** - Setup options
77
- - **[PIN Protection Guide](PIN_PROTECTION_GUIDE.md)** - Security features
78
- - **[Debug Tools](debug/DEBUG_TOOLS.md)** - Diagnostic utilities
79
- - **[Development Guide](development/DEV_README.md)** - Contributing guidelines
80
-
81
- ## Configuration
82
-
83
- Create `i18ntk-config.json`:
84
-
85
- ```json
86
- {
87
- "sourceDirectory": "./src",
88
- "localesDirectory": "./locales",
89
- "defaultLanguage": "en",
90
- "supportedLanguages": ["en", "es", "fr", "de", "pt", "ja", "ru", "zh"]
91
- }
92
- ```
93
-
94
- ## Reports
95
-
96
- Generated in `i18ntk-reports/`:
97
- - Analysis reports
98
- - Validation reports
99
- - Usage reports
100
- - Sizing reports
101
- - Summary reports
102
-
103
- ## Support
104
-
105
- - **Issues:** [GitHub Issues](https://github.com/vladnoskv/i18n-management-toolkit-main/issues)
106
- - **Documentation:** This guide
107
- - **Examples:** See framework-specific examples in `examples/`
108
-
109
- ## Contributing
110
-
111
- Issues and pull requests welcome! See [Development Guide](development/DEV_README.md) for setup instructions.
@@ -1,278 +0,0 @@
1
- # Script Directory Configuration Guide
2
-
3
- **Version:** 1.3.1
4
- **Last Updated:** December 2024
5
-
6
- ## Overview
7
-
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.
9
-
10
- ## 🆕 New Features in v1.3.0
11
-
12
- ### 1. Per-Script Directory Configuration
13
-
14
- Each script type can now have its own source directory configured independently. This allows for maximum flexibility in organizing your i18n files.
15
-
16
- #### Supported Script Types
17
- - **analyze** - Translation analysis reports
18
- - **complete** - Translation completion tool
19
- - **init** - Project initialization
20
- - **manage** - Main management interface
21
- - **sizing** - Translation sizing analysis
22
- - **summary** - Summary reports
23
- - **usage** - Usage analysis
24
- - **validate** - Validation checks
25
-
26
- ### 2. Fixed Path Resolution
27
-
28
- We've corrected how relative paths are resolved to ensure they always work from your project root directory, eliminating the "Source directory not found" errors.
29
-
30
- ## Configuration Methods
31
-
32
- ### Method 1: Settings CLI (Recommended)
33
-
34
- ```bash
35
- # Launch the interactive settings manager
36
- node main/i18ntk-manage.js --command=settings
37
-
38
- # Or directly
39
- node settings/settings-cli.js
40
- ```
41
-
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
94
-
95
- ### Method 2: Manual Configuration
96
-
97
- Edit your settings file (`settings/settings.json`) to add custom directory configurations:
98
-
99
- ```json
100
- {
101
- "scriptDirectories": {
102
- "analyze": "./src/i18n/locales",
103
- "complete": "./translations",
104
- "init": "./locales",
105
- "manage": "./i18n/locales",
106
- "sizing": "./src/i18n/sizing",
107
- "summary": "./reports/i18n",
108
- "usage": "./src/i18n/usage",
109
- "validate": "./src/i18n/locales"
110
- },
111
- "sourceDir": "./locales"
112
- }
113
- ```
114
-
115
- ### Method 3: CLI Arguments
116
-
117
- Use command-line arguments to override directories for specific runs:
118
-
119
- ```bash
120
- # Override source directory for analyze
121
- node main/i18ntk-analyze.js --source-dir=./src/i18n/locales
122
-
123
- # Override for complete
124
- node main/i18ntk-complete.js --source-dir=./translations
125
- ```
126
-
127
- ## Path Resolution Priority
128
-
129
- The toolkit uses the following priority order for determining source directories:
130
-
131
- 1. **CLI Arguments** (`--source-dir`) - Highest priority
132
- 2. **Script-Specific Configuration** (`scriptDirectories.<script>`)
133
- 3. **Global Configuration** (`sourceDir`)
134
- 4. **Default Directory** (`./locales`) - Lowest priority
135
-
136
- ## Usage Examples
137
-
138
- ### Example 1: Multi-Directory Setup
139
-
140
- Organize your i18n files across multiple directories:
141
-
142
- ```
143
- project/
144
- ├── src/
145
- │ └── i18n/
146
- │ ├── locales/ # Main translations
147
- │ ├── admin-locales/ # Admin interface translations
148
- │ └── public-locales/ # Public-facing translations
149
- ├── legacy/
150
- │ └── translations/ # Legacy translation files
151
- └── settings/
152
- └── settings.json
153
- ```
154
-
155
- Configuration:
156
-
157
- ```json
158
- {
159
- "scriptDirectories": {
160
- "analyze": "./src/i18n/locales",
161
- "complete": "./legacy/translations",
162
- "manage": "./src/i18n/admin-locales"
163
- }
164
- }
165
- ```
166
-
167
- ### Example 2: Development vs Production
168
-
169
- Use different directories for development and production:
170
-
171
- ```json
172
- {
173
- "scriptDirectories": {
174
- "analyze": "./src/i18n/dev-locales",
175
- "validate": "./src/i18n/prod-locales"
176
- }
177
- }
178
- ```
179
-
180
- ## Path Guidance Features
181
-
182
- ### Current Working Directory Display
183
-
184
- The settings CLI now displays your current working directory and provides helpful hints:
185
-
186
- ```
187
- 📁 Current directory: /home/user/myproject
188
- 💡 Tip: Use relative paths like "./src/i18n/locales" or "../translations"
189
- ```
190
-
191
- ### Relative Path Examples
192
-
193
- - ✅ `./src/i18n/locales` - Relative to project root
194
- - ✅ `../translations` - Relative to parent directory
195
- - ✅ `/absolute/path/to/locales` - Absolute path
196
- - ❌ `src/i18n/locales` - Missing `./` prefix (may cause issues)
197
-
198
- ## Migration Guide
199
-
200
- ### From v1.2.x to v1.3.0
201
-
202
- 1. **No Breaking Changes**: Your existing configurations will continue to work
203
- 2. **Optional Upgrade**: The new features are opt-in
204
- 3. **Path Resolution**: Existing relative paths will now work correctly
205
-
206
- ### Testing Your Configuration
207
-
208
- Before deploying to production, test your configuration:
209
-
210
- ```bash
211
- # Test with a specific directory
212
- node main/i18ntk-analyze.js --source-dir=./test-locales --dry-run
213
-
214
- # Verify all scripts work with your new configuration
215
- npm run i18ntk:settings
216
- ```
217
-
218
- ## Internationalization Support
219
-
220
- All new configuration options are fully internationalized with support for:
221
- - English (en)
222
- - German (de)
223
- - Spanish (es)
224
- - French (fr)
225
- - Portuguese (pt)
226
- - Russian (ru)
227
- - Japanese (ja)
228
- - Chinese (zh)
229
-
230
- ## Troubleshooting
231
-
232
- ### Common Issues
233
-
234
- 1. **"Source directory not found"**
235
- - Ensure the directory exists
236
- - Use relative paths from project root
237
- - Check file permissions
238
-
239
- 2. **Settings not applied**
240
- - Verify `scriptDirectories` configuration in settings.json
241
- - Check for syntax errors in JSON
242
- - Ensure settings file is in the correct location
243
-
244
- 3. **CLI arguments not working**
245
- - Use the correct argument format: `--source-dir=./path`
246
- - Ensure no spaces around the equals sign
247
-
248
- ### Debug Commands
249
-
250
- ```bash
251
- # Check current settings
252
- node settings/settings-cli.js --show
253
-
254
- # Test path resolution
255
- node main/i18ntk-analyze.js --source-dir=./test-path --dry-run
256
-
257
- # Validate configuration
258
- node main/i18ntk-validate.js --config-only
259
- ```
260
-
261
- ## Best Practices
262
-
263
- 1. **Use Relative Paths**: Always use relative paths from project root for portability
264
- 2. **Test Before Deploying**: Always test directory configurations on a development branch
265
- 3. **Document Your Setup**: Keep a record of your directory structure and configurations
266
- 4. **Use Version Control**: Commit your settings.json to version control for team consistency
267
- 5. **Backup Settings**: Create backups before making significant configuration changes
268
-
269
- ## Support
270
-
271
- For issues or questions:
272
- - Check the [troubleshooting section](#troubleshooting)
273
- - Review the [CHANGELOG.md](../CHANGELOG.md)
274
- - Open an issue on [GitHub](https://github.com/vladnoskv/i18n-management-toolkit-main/issues)
275
-
276
- ---
277
-
278
- *This guide is part of i18ntk v1.3.0. For previous versions, see the [documentation](../docs/).*