i18ntk 1.0.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 +401 -0
- package/LICENSE +21 -0
- package/README.md +507 -0
- package/dev/README.md +37 -0
- package/dev/debug/README.md +30 -0
- package/dev/debug/complete-console-translations.js +295 -0
- package/dev/debug/console-key-checker.js +408 -0
- package/dev/debug/console-translations.js +335 -0
- package/dev/debug/debugger.js +408 -0
- package/dev/debug/export-missing-keys.js +432 -0
- package/dev/debug/final-normalize.js +236 -0
- package/dev/debug/find-extra-keys.js +68 -0
- package/dev/debug/normalize-locales.js +153 -0
- package/dev/debug/refactor-locales.js +240 -0
- package/dev/debug/reorder-locales.js +85 -0
- package/dev/debug/replace-hardcoded-console.js +378 -0
- package/docs/INSTALLATION.md +449 -0
- package/docs/README.md +222 -0
- package/docs/TODO_ROADMAP.md +279 -0
- package/docs/api/API_REFERENCE.md +377 -0
- package/docs/api/COMPONENTS.md +492 -0
- package/docs/api/CONFIGURATION.md +651 -0
- package/docs/api/NPM_PUBLISHING_GUIDE.md +434 -0
- package/docs/debug/DEBUG_README.md +30 -0
- package/docs/debug/DEBUG_TOOLS.md +494 -0
- package/docs/development/AGENTS.md +351 -0
- package/docs/development/DEVELOPMENT_RULES.md +165 -0
- package/docs/development/DEV_README.md +37 -0
- package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +173 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +141 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +185 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +199 -0
- package/docs/reports/ANALYSIS_README.md +17 -0
- package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +181 -0
- package/docs/reports/SIZING_README.md +18 -0
- package/docs/reports/SUMMARY_README.md +18 -0
- package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +129 -0
- package/docs/reports/USAGE_README.md +18 -0
- package/docs/reports/VALIDATION_README.md +18 -0
- package/locales/de/auth.json +3 -0
- package/locales/de/common.json +16 -0
- package/locales/de/pagination.json +6 -0
- package/locales/en/auth.json +3 -0
- package/locales/en/common.json +16 -0
- package/locales/en/pagination.json +6 -0
- package/locales/es/auth.json +3 -0
- package/locales/es/common.json +16 -0
- package/locales/es/pagination.json +6 -0
- package/locales/fr/auth.json +3 -0
- package/locales/fr/common.json +16 -0
- package/locales/fr/pagination.json +6 -0
- package/locales/ru/auth.json +3 -0
- package/locales/ru/common.json +16 -0
- package/locales/ru/pagination.json +6 -0
- package/main/i18ntk-analyze.js +625 -0
- package/main/i18ntk-autorun.js +461 -0
- package/main/i18ntk-complete.js +494 -0
- package/main/i18ntk-init.js +686 -0
- package/main/i18ntk-manage.js +848 -0
- package/main/i18ntk-sizing.js +557 -0
- package/main/i18ntk-summary.js +671 -0
- package/main/i18ntk-usage.js +1282 -0
- package/main/i18ntk-validate.js +762 -0
- package/main/ui-i18n.js +332 -0
- package/package.json +152 -0
- package/scripts/fix-missing-translation-keys.js +214 -0
- package/scripts/verify-package.js +168 -0
- package/ui-locales/de.json +637 -0
- package/ui-locales/en.json +688 -0
- package/ui-locales/es.json +637 -0
- package/ui-locales/fr.json +637 -0
- package/ui-locales/ja.json +637 -0
- package/ui-locales/ru.json +637 -0
- package/ui-locales/zh.json +637 -0
- package/utils/admin-auth.js +317 -0
- package/utils/admin-cli.js +353 -0
- package/utils/admin-pin.js +409 -0
- package/utils/detect-language-mismatches.js +454 -0
- package/utils/i18n-helper.js +128 -0
- package/utils/maintain-language-purity.js +433 -0
- package/utils/native-translations.js +478 -0
- package/utils/security.js +384 -0
- package/utils/test-complete-system.js +356 -0
- package/utils/test-console-i18n.js +402 -0
- package/utils/translate-mismatches.js +571 -0
- package/utils/validate-language-purity.js +531 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# i18ntk Development Roadmap & TODO
|
|
2
|
+
|
|
3
|
+
**Current Version:** 1.6.0
|
|
4
|
+
**Status:** 🚀 Public Release Ready
|
|
5
|
+
**Last Updated:** July 28, 2025
|
|
6
|
+
|
|
7
|
+
## 🎯 Immediate Priorities (v1.6.1 - v1.7.0)
|
|
8
|
+
|
|
9
|
+
### 🌍 Phase 1: Complete Console Internationalization
|
|
10
|
+
**Priority:** HIGH | **Target:** v1.6.1-1.6.3
|
|
11
|
+
|
|
12
|
+
#### Console Statement Translation Implementation
|
|
13
|
+
- [ ] **Systematic Translation Key Conversion** (200+ console.log statements)
|
|
14
|
+
- [ ] `utils/maintain-language-purity.js` (25+ statements)
|
|
15
|
+
- [ ] `settings/settings-cli.js` (50+ statements)
|
|
16
|
+
- [ ] `utils/validate-language-purity.js` (20+ statements)
|
|
17
|
+
- [ ] `main/i18ntk-manage.js` (30+ statements)
|
|
18
|
+
- [ ] `settings/settings-manager.js` (15+ statements)
|
|
19
|
+
- [ ] `main/i18ntk-usage.js` (15+ statements)
|
|
20
|
+
- [ ] `utils/translate-mismatches.js` (10+ statements)
|
|
21
|
+
- [ ] `main/i18ntk-autorun.js` (10+ statements)
|
|
22
|
+
- [ ] `utils/native-translations.js` (10+ statements)
|
|
23
|
+
- [ ] `main/ui-i18n.js` (8+ statements)
|
|
24
|
+
|
|
25
|
+
- [ ] **Error Message Translation** (50+ console.error statements)
|
|
26
|
+
- [ ] `settings/settings-manager.js` (15+ error messages)
|
|
27
|
+
- [ ] `scripts/verify-package.js` (12+ error messages)
|
|
28
|
+
- [ ] `main/ui-i18n.js` (4+ error messages)
|
|
29
|
+
- [ ] `utils/i18n-helper.js` (4+ error messages)
|
|
30
|
+
- [ ] `dev/debug/final-normalize.js` (3+ error messages)
|
|
31
|
+
- [ ] `utils/detect-language-mismatches.js` (3+ error messages)
|
|
32
|
+
|
|
33
|
+
- [ ] **Warning Message Translation** (30+ console.warn statements)
|
|
34
|
+
- [ ] `utils/security.js` (9+ warning messages)
|
|
35
|
+
- [ ] `utils/i18n-helper.js` (3+ warning messages)
|
|
36
|
+
- [ ] `main/ui-i18n.js` (3+ warning messages)
|
|
37
|
+
- [ ] `main/i18ntk-usage.js` (3+ warning messages)
|
|
38
|
+
- [ ] `main/i18ntk-init.js` (1+ warning messages)
|
|
39
|
+
|
|
40
|
+
#### Translation Key Structure
|
|
41
|
+
- [ ] **Create Comprehensive Translation Keys**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"console": {
|
|
45
|
+
"status": {
|
|
46
|
+
"processing": "Processing {filename}...",
|
|
47
|
+
"completed": "✅ {operation} completed successfully",
|
|
48
|
+
"failed": "❌ {operation} failed: {error}"
|
|
49
|
+
},
|
|
50
|
+
"validation": {
|
|
51
|
+
"violations": "⚠️ {count} violations found",
|
|
52
|
+
"passed": "✅ Validation passed",
|
|
53
|
+
"summary": "📊 {valid}/{total} files valid"
|
|
54
|
+
},
|
|
55
|
+
"workflow": {
|
|
56
|
+
"starting": "🚀 Starting {workflow}...",
|
|
57
|
+
"step": "📋 Step {step}: {description}",
|
|
58
|
+
"report": "📄 Report saved to: {path}"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- [ ] **Update All Language Files** (de, es, fr, ja, ru, zh)
|
|
65
|
+
- [ ] Add console translation keys to all 7 language files
|
|
66
|
+
- [ ] Ensure consistent terminology across languages
|
|
67
|
+
- [ ] Validate translation quality and accuracy
|
|
68
|
+
|
|
69
|
+
### 🔧 Phase 2: UI Locales Refactoring
|
|
70
|
+
**Priority:** MEDIUM | **Target:** v1.7.0
|
|
71
|
+
|
|
72
|
+
#### Multi-Language Object Format Implementation
|
|
73
|
+
- [ ] **Refactor ui-locales Structure**
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"analyzeTranslations": {
|
|
77
|
+
"reportTitle": {
|
|
78
|
+
"en": "TRANSLATION ANALYSIS REPORT FOR {language}",
|
|
79
|
+
"de": "ÜBERSETZUNGSANALYSENBERICHT FÜR {language}",
|
|
80
|
+
"fr": "RAPPORT D'ANALYSE DE TRADUCTION POUR {language}",
|
|
81
|
+
"es": "INFORME DE ANÁLISIS DE TRADUCCIÓN PARA {language}",
|
|
82
|
+
"ru": "ОТЧЁТ О АНАЛИЗЕ ПЕРЕВОДА ДЛЯ {language}",
|
|
83
|
+
"ja": "{language} の翻訳分析レポート",
|
|
84
|
+
"zh": "{language} 翻译分析报告"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- [ ] **Migration Strategy**
|
|
91
|
+
- [ ] Create migration script for existing ui-locales
|
|
92
|
+
- [ ] Update ui-i18n.js to handle new format
|
|
93
|
+
- [ ] Maintain backward compatibility during transition
|
|
94
|
+
- [ ] Test all language switching functionality
|
|
95
|
+
|
|
96
|
+
- [ ] **Benefits Implementation**
|
|
97
|
+
- [ ] Single source of truth for all translations
|
|
98
|
+
- [ ] Easier maintenance and consistency checking
|
|
99
|
+
- [ ] Reduced file duplication
|
|
100
|
+
- [ ] Better translation management workflow
|
|
101
|
+
|
|
102
|
+
## 🚀 Medium-Term Goals (v1.7.0 - v2.0.0)
|
|
103
|
+
|
|
104
|
+
### 📊 Enhanced Reporting & Analytics
|
|
105
|
+
**Priority:** MEDIUM | **Target:** v1.8.0
|
|
106
|
+
|
|
107
|
+
- [ ] **Advanced Report Generation**
|
|
108
|
+
- [ ] Interactive HTML reports with charts and graphs
|
|
109
|
+
- [ ] Translation progress tracking over time
|
|
110
|
+
- [ ] Detailed usage analytics with heatmaps
|
|
111
|
+
- [ ] Export reports in multiple formats (PDF, CSV, JSON)
|
|
112
|
+
|
|
113
|
+
- [ ] **Performance Metrics**
|
|
114
|
+
- [ ] Translation loading performance analysis
|
|
115
|
+
- [ ] Memory usage optimization reports
|
|
116
|
+
- [ ] Large project scalability metrics
|
|
117
|
+
- [ ] Benchmark comparisons with other i18n tools
|
|
118
|
+
|
|
119
|
+
### 🔧 Developer Experience Improvements
|
|
120
|
+
**Priority:** MEDIUM | **Target:** v1.9.0
|
|
121
|
+
|
|
122
|
+
- [ ] **Enhanced Debug Tools**
|
|
123
|
+
- [ ] Real-time translation key usage monitoring
|
|
124
|
+
- [ ] Interactive debugging console
|
|
125
|
+
- [ ] Visual translation coverage maps
|
|
126
|
+
- [ ] Automated issue detection and suggestions
|
|
127
|
+
|
|
128
|
+
- [ ] **IDE Integration**
|
|
129
|
+
- [ ] VS Code extension for translation management
|
|
130
|
+
- [ ] IntelliSense support for translation keys
|
|
131
|
+
- [ ] Inline translation previews
|
|
132
|
+
- [ ] Quick actions for missing translations
|
|
133
|
+
|
|
134
|
+
### 🌐 Framework Integration Expansion
|
|
135
|
+
**Priority:** MEDIUM | **Target:** v1.10.0
|
|
136
|
+
|
|
137
|
+
- [ ] **Enhanced React Support**
|
|
138
|
+
- [ ] React hooks for translation management
|
|
139
|
+
- [ ] Component-level translation analysis
|
|
140
|
+
- [ ] Hot-reload translation updates
|
|
141
|
+
- [ ] React DevTools integration
|
|
142
|
+
|
|
143
|
+
- [ ] **Vue.js Integration**
|
|
144
|
+
- [ ] Vue 3 Composition API support
|
|
145
|
+
- [ ] Vue-specific translation components
|
|
146
|
+
- [ ] Vuex integration for translation state
|
|
147
|
+
- [ ] Vue CLI plugin
|
|
148
|
+
|
|
149
|
+
- [ ] **Angular Integration**
|
|
150
|
+
- [ ] Angular service for translation management
|
|
151
|
+
- [ ] Angular CLI schematics
|
|
152
|
+
- [ ] Ivy renderer optimization
|
|
153
|
+
- [ ] Angular Universal SSR support
|
|
154
|
+
|
|
155
|
+
## 🎯 Long-Term Vision (v2.0.0+)
|
|
156
|
+
|
|
157
|
+
### 🏢 Enterprise Features
|
|
158
|
+
**Priority:** LOW | **Target:** v2.0.0
|
|
159
|
+
|
|
160
|
+
- [ ] **Team Collaboration**
|
|
161
|
+
- [ ] Multi-user translation workflows
|
|
162
|
+
- [ ] Translation approval processes
|
|
163
|
+
- [ ] Conflict resolution for concurrent edits
|
|
164
|
+
- [ ] Role-based access control
|
|
165
|
+
|
|
166
|
+
- [ ] **Cloud Integration**
|
|
167
|
+
- [ ] Cloud-based translation storage
|
|
168
|
+
- [ ] Real-time synchronization across teams
|
|
169
|
+
- [ ] Translation memory and suggestions
|
|
170
|
+
- [ ] Professional translator integration
|
|
171
|
+
|
|
172
|
+
### 🤖 AI-Powered Features
|
|
173
|
+
**Priority:** LOW | **Target:** v2.1.0
|
|
174
|
+
|
|
175
|
+
- [ ] **Intelligent Translation Assistance**
|
|
176
|
+
- [ ] AI-powered translation suggestions
|
|
177
|
+
- [ ] Context-aware translation recommendations
|
|
178
|
+
- [ ] Automatic translation quality scoring
|
|
179
|
+
- [ ] Smart missing translation detection
|
|
180
|
+
|
|
181
|
+
- [ ] **Automated Optimization**
|
|
182
|
+
- [ ] Automatic code refactoring for i18n
|
|
183
|
+
- [ ] Smart key naming suggestions
|
|
184
|
+
- [ ] Performance optimization recommendations
|
|
185
|
+
- [ ] Automated testing for translation coverage
|
|
186
|
+
|
|
187
|
+
### 🌍 Global Expansion
|
|
188
|
+
**Priority:** LOW | **Target:** v2.2.0
|
|
189
|
+
|
|
190
|
+
- [ ] **Additional Language Support**
|
|
191
|
+
- [ ] Arabic (RTL support)
|
|
192
|
+
- [ ] Hindi
|
|
193
|
+
- [ ] Portuguese
|
|
194
|
+
- [ ] Korean
|
|
195
|
+
- [ ] Thai
|
|
196
|
+
- [ ] Hebrew (RTL support)
|
|
197
|
+
|
|
198
|
+
- [ ] **Cultural Adaptation**
|
|
199
|
+
- [ ] Date/time format localization
|
|
200
|
+
- [ ] Number format localization
|
|
201
|
+
- [ ] Currency format support
|
|
202
|
+
- [ ] Cultural color and symbol preferences
|
|
203
|
+
|
|
204
|
+
## 🔧 Technical Debt & Maintenance
|
|
205
|
+
|
|
206
|
+
### 📋 Ongoing Tasks
|
|
207
|
+
- [ ] **Code Quality**
|
|
208
|
+
- [ ] Increase test coverage to 95%+
|
|
209
|
+
- [ ] Implement comprehensive error handling
|
|
210
|
+
- [ ] Add TypeScript definitions
|
|
211
|
+
- [ ] Performance optimization for large projects
|
|
212
|
+
|
|
213
|
+
- [ ] **Documentation**
|
|
214
|
+
- [ ] Video tutorials for common workflows
|
|
215
|
+
- [ ] Interactive documentation with examples
|
|
216
|
+
- [ ] Migration guides for major versions
|
|
217
|
+
- [ ] Best practices documentation
|
|
218
|
+
|
|
219
|
+
- [ ] **Community**
|
|
220
|
+
- [ ] Contribution guidelines
|
|
221
|
+
- [ ] Code of conduct
|
|
222
|
+
- [ ] Issue templates
|
|
223
|
+
- [ ] Pull request templates
|
|
224
|
+
|
|
225
|
+
### 🐛 Known Issues to Address
|
|
226
|
+
- [ ] **Minor Translation Gaps**
|
|
227
|
+
- [ ] 30 non-critical missing translation keys
|
|
228
|
+
- [ ] Inconsistent terminology in some languages
|
|
229
|
+
- [ ] Missing context for some translation keys
|
|
230
|
+
|
|
231
|
+
- [ ] **Performance Optimizations**
|
|
232
|
+
- [ ] Large file processing optimization
|
|
233
|
+
- [ ] Memory usage reduction for big projects
|
|
234
|
+
- [ ] Faster translation key lookup
|
|
235
|
+
|
|
236
|
+
## 📊 Success Metrics
|
|
237
|
+
|
|
238
|
+
### 📈 Version 1.6.x Goals
|
|
239
|
+
- [ ] **Translation Coverage:** 100% of console output internationalized
|
|
240
|
+
- [ ] **Test Coverage:** Maintain 100% test pass rate
|
|
241
|
+
- [ ] **Documentation:** Complete API documentation
|
|
242
|
+
- [ ] **Community:** 50+ GitHub stars, 10+ contributors
|
|
243
|
+
|
|
244
|
+
### 📈 Version 1.7.x Goals
|
|
245
|
+
- [ ] **Performance:** 50% faster processing for large projects
|
|
246
|
+
- [ ] **Features:** UI locales refactoring completed
|
|
247
|
+
- [ ] **Adoption:** 100+ npm downloads per week
|
|
248
|
+
- [ ] **Quality:** Zero critical bugs reported
|
|
249
|
+
|
|
250
|
+
### 📈 Version 2.0.x Goals
|
|
251
|
+
- [ ] **Enterprise Ready:** Full team collaboration features
|
|
252
|
+
- [ ] **Market Position:** Top 3 i18n tools on npm
|
|
253
|
+
- [ ] **Community:** 500+ GitHub stars, 50+ contributors
|
|
254
|
+
- [ ] **Integration:** Official framework partnerships
|
|
255
|
+
|
|
256
|
+
## 🤝 Contributing Guidelines
|
|
257
|
+
|
|
258
|
+
### 🎯 How to Contribute
|
|
259
|
+
1. **Pick a Task:** Choose from the TODO items above
|
|
260
|
+
2. **Create Issue:** Discuss the implementation approach
|
|
261
|
+
3. **Fork & Branch:** Create a feature branch
|
|
262
|
+
4. **Implement:** Follow coding standards and add tests
|
|
263
|
+
5. **Test:** Ensure all tests pass
|
|
264
|
+
6. **Document:** Update relevant documentation
|
|
265
|
+
7. **Pull Request:** Submit for review
|
|
266
|
+
|
|
267
|
+
### 📋 Priority Labels
|
|
268
|
+
- **🔥 Critical:** Security issues, major bugs
|
|
269
|
+
- **⚡ High:** Core functionality, user experience
|
|
270
|
+
- **📋 Medium:** New features, improvements
|
|
271
|
+
- **🔧 Low:** Nice-to-have, future enhancements
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**This roadmap is a living document and will be updated regularly based on community feedback, user needs, and project evolution.**
|
|
276
|
+
|
|
277
|
+
**Last Updated:** July 28, 2025
|
|
278
|
+
**Next Review:** August 15, 2025
|
|
279
|
+
**Maintainer:** Vladimir Noskov
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# I18N Management Toolkit - API Reference
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Last Updated:** 27/07/2025
|
|
5
|
+
**Maintainer:** Vladimir Noskov
|
|
6
|
+
|
|
7
|
+
## 📋 Overview
|
|
8
|
+
|
|
9
|
+
This document provides a comprehensive API reference for the I18N Management Toolkit, including all available commands, configuration options, and programmatic interfaces.
|
|
10
|
+
|
|
11
|
+
## 🚀 Command Line Interface (CLI)
|
|
12
|
+
|
|
13
|
+
### Core Commands
|
|
14
|
+
|
|
15
|
+
#### `npm run i18ntk`
|
|
16
|
+
**Description:** Interactive management menu
|
|
17
|
+
**Usage:** `npm run i18ntk`
|
|
18
|
+
**Options:** None
|
|
19
|
+
**Output:** Interactive menu with 12 options
|
|
20
|
+
|
|
21
|
+
#### `npm run i18ntk:init`
|
|
22
|
+
**Description:** Initialize i18n structure for new projects
|
|
23
|
+
**Usage:** `npm run i18ntk:init [options]`
|
|
24
|
+
**Options:**
|
|
25
|
+
- `--source-dir <path>` - Source directory to scan (default: ./src)
|
|
26
|
+
- `--locales-dir <path>` - Locales directory (default: ./locales)
|
|
27
|
+
- `--languages <langs>` - Comma-separated language codes (default: en,es,fr,de)
|
|
28
|
+
- `--framework <name>` - i18n framework (react-i18next, i18next, vue-i18n)
|
|
29
|
+
|
|
30
|
+
#### `npm run i18ntk:analyze`
|
|
31
|
+
**Description:** Analyze translation completeness across all languages
|
|
32
|
+
**Usage:** `npm run i18ntk:analyze [options]`
|
|
33
|
+
**Options:**
|
|
34
|
+
- `--detailed` - Show detailed analysis
|
|
35
|
+
- `--output <format>` - Output format (json, csv, html)
|
|
36
|
+
- `--threshold <number>` - Completion threshold percentage
|
|
37
|
+
|
|
38
|
+
#### `npm run i18ntk:validate`
|
|
39
|
+
**Description:** Validate translation files for syntax and consistency
|
|
40
|
+
**Usage:** `npm run i18ntk:validate [options]`
|
|
41
|
+
**Options:**
|
|
42
|
+
- `--strict` - Enable strict validation mode
|
|
43
|
+
- `--fix` - Auto-fix common issues
|
|
44
|
+
- `--format <type>` - Validation format (json, yaml)
|
|
45
|
+
|
|
46
|
+
#### `npm run i18ntk:usage`
|
|
47
|
+
**Description:** Check translation key usage in source code
|
|
48
|
+
**Usage:** `npm run i18ntk:usage [options]`
|
|
49
|
+
**Options:**
|
|
50
|
+
- `--unused` - Show only unused keys
|
|
51
|
+
- `--missing` - Show only missing keys
|
|
52
|
+
- `--source-dir <path>` - Source directory to scan
|
|
53
|
+
|
|
54
|
+
#### `npm run i18ntk:complete`
|
|
55
|
+
**Description:** Complete missing translations using AI or manual input
|
|
56
|
+
**Usage:** `npm run i18ntk:complete [options]`
|
|
57
|
+
**Options:**
|
|
58
|
+
- `--auto` - Use automatic translation
|
|
59
|
+
- `--language <code>` - Target specific language
|
|
60
|
+
- `--provider <name>` - Translation provider (google, deepl, openai)
|
|
61
|
+
|
|
62
|
+
#### `npm run i18ntk:sizing`
|
|
63
|
+
**Description:** Analyze translation sizing and memory usage
|
|
64
|
+
**Usage:** `npm run i18ntk:sizing [options]`
|
|
65
|
+
**Options:**
|
|
66
|
+
- `--detailed` - Show detailed sizing analysis
|
|
67
|
+
- `--format <type>` - Output format (json, table)
|
|
68
|
+
- `--threshold <size>` - Size threshold in bytes
|
|
69
|
+
|
|
70
|
+
#### `npm run i18ntk:summary`
|
|
71
|
+
**Description:** Generate comprehensive project summary report
|
|
72
|
+
**Usage:** `npm run i18ntk:summary [options]`
|
|
73
|
+
**Options:**
|
|
74
|
+
- `--format <type>` - Report format (html, pdf, json)
|
|
75
|
+
- `--include <sections>` - Comma-separated sections to include
|
|
76
|
+
|
|
77
|
+
#### `npm run i18ntk:autorun`
|
|
78
|
+
**Description:** Run full workflow automation
|
|
79
|
+
**Usage:** `npm run i18ntk:autorun [options]`
|
|
80
|
+
**Options:**
|
|
81
|
+
- `--config <path>` - Configuration file path
|
|
82
|
+
- `--skip <steps>` - Comma-separated steps to skip
|
|
83
|
+
|
|
84
|
+
### Debug Commands
|
|
85
|
+
|
|
86
|
+
#### `npm run i18ntk:debug`
|
|
87
|
+
**Description:** Run debug analysis and diagnostics
|
|
88
|
+
**Usage:** `npm run i18ntk:debug [options]`
|
|
89
|
+
**Options:**
|
|
90
|
+
- `--verbose` - Enable verbose output
|
|
91
|
+
- `--component <name>` - Debug specific component
|
|
92
|
+
|
|
93
|
+
#### `npm run i18ntk:settings`
|
|
94
|
+
**Description:** Manage toolkit settings and configuration
|
|
95
|
+
**Usage:** `npm run i18ntk:settings [options]`
|
|
96
|
+
**Options:**
|
|
97
|
+
- `--reset` - Reset to default settings
|
|
98
|
+
- `--export <path>` - Export current settings
|
|
99
|
+
- `--import <path>` - Import settings from file
|
|
100
|
+
|
|
101
|
+
## 🔧 Configuration API
|
|
102
|
+
|
|
103
|
+
### Configuration Files
|
|
104
|
+
|
|
105
|
+
#### `user-config.json`
|
|
106
|
+
**Location:** Project root
|
|
107
|
+
**Purpose:** User-specific configuration settings
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"defaultLanguage": "en",
|
|
112
|
+
"supportedLanguages": ["en", "es", "fr", "de"],
|
|
113
|
+
"sourceDirectory": "./src",
|
|
114
|
+
"localesDirectory": "./locales",
|
|
115
|
+
"framework": "react-i18next",
|
|
116
|
+
"autoTranslate": false,
|
|
117
|
+
"translationProvider": "google",
|
|
118
|
+
"validationStrict": true,
|
|
119
|
+
"reportFormat": "html"
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### `admin-config.json`
|
|
124
|
+
**Location:** Project root
|
|
125
|
+
**Purpose:** Administrative settings and security configuration
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"adminMode": false,
|
|
130
|
+
"securityLevel": "standard",
|
|
131
|
+
"backupEnabled": true,
|
|
132
|
+
"backupRetention": 30,
|
|
133
|
+
"auditLogging": true,
|
|
134
|
+
"apiKeys": {
|
|
135
|
+
"encrypted": true,
|
|
136
|
+
"providers": []
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Environment Variables
|
|
142
|
+
|
|
143
|
+
| Variable | Description | Default | Required |
|
|
144
|
+
|----------|-------------|---------|----------|
|
|
145
|
+
| `I18N_SOURCE_DIR` | Source directory path | `./src` | No |
|
|
146
|
+
| `I18N_LOCALES_DIR` | Locales directory path | `./locales` | No |
|
|
147
|
+
| `I18N_DEFAULT_LANG` | Default language code | `en` | No |
|
|
148
|
+
| `I18N_FRAMEWORK` | i18n framework | `react-i18next` | No |
|
|
149
|
+
| `I18N_AUTO_TRANSLATE` | Enable auto-translation | `false` | No |
|
|
150
|
+
| `GOOGLE_TRANSLATE_API_KEY` | Google Translate API key | - | For auto-translate |
|
|
151
|
+
| `DEEPL_API_KEY` | DeepL API key | - | For auto-translate |
|
|
152
|
+
| `OPENAI_API_KEY` | OpenAI API key | - | For AI translation |
|
|
153
|
+
|
|
154
|
+
## 📊 Programmatic API
|
|
155
|
+
|
|
156
|
+
### Core Classes
|
|
157
|
+
|
|
158
|
+
#### `I18nManager`
|
|
159
|
+
**Description:** Main management class for i18n operations
|
|
160
|
+
|
|
161
|
+
```javascript
|
|
162
|
+
const { I18nManager } = require('i18n-management-toolkit');
|
|
163
|
+
|
|
164
|
+
const manager = new I18nManager({
|
|
165
|
+
sourceDir: './src',
|
|
166
|
+
localesDir: './locales',
|
|
167
|
+
defaultLanguage: 'en'
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Initialize project
|
|
171
|
+
await manager.initialize();
|
|
172
|
+
|
|
173
|
+
// Analyze translations
|
|
174
|
+
const analysis = await manager.analyze();
|
|
175
|
+
|
|
176
|
+
// Validate translations
|
|
177
|
+
const validation = await manager.validate();
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### `I18nAnalyzer`
|
|
181
|
+
**Description:** Translation analysis and reporting
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
const { I18nAnalyzer } = require('i18n-management-toolkit');
|
|
185
|
+
|
|
186
|
+
const analyzer = new I18nAnalyzer(config);
|
|
187
|
+
const report = await analyzer.generateReport();
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### `I18nValidator`
|
|
191
|
+
**Description:** Translation validation and quality assurance
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
const { I18nValidator } = require('i18n-management-toolkit');
|
|
195
|
+
|
|
196
|
+
const validator = new I18nValidator(config);
|
|
197
|
+
const results = await validator.validateAll();
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Utility Functions
|
|
201
|
+
|
|
202
|
+
#### `detectFramework()`
|
|
203
|
+
**Description:** Auto-detect i18n framework in project
|
|
204
|
+
**Returns:** `string` - Framework name
|
|
205
|
+
|
|
206
|
+
#### `scanSourceFiles(directory)`
|
|
207
|
+
**Description:** Scan source files for translation keys
|
|
208
|
+
**Parameters:** `directory` (string) - Directory to scan
|
|
209
|
+
**Returns:** `Array<string>` - Found translation keys
|
|
210
|
+
|
|
211
|
+
#### `validateLanguageFile(filePath)`
|
|
212
|
+
**Description:** Validate individual language file
|
|
213
|
+
**Parameters:** `filePath` (string) - Path to language file
|
|
214
|
+
**Returns:** `Object` - Validation results
|
|
215
|
+
|
|
216
|
+
## 🔒 Security API
|
|
217
|
+
|
|
218
|
+
### Authentication
|
|
219
|
+
|
|
220
|
+
#### `AdminAuth`
|
|
221
|
+
**Description:** Administrative authentication system
|
|
222
|
+
|
|
223
|
+
```javascript
|
|
224
|
+
const { AdminAuth } = require('i18n-management-toolkit');
|
|
225
|
+
|
|
226
|
+
const auth = new AdminAuth();
|
|
227
|
+
const isAuthenticated = await auth.verify(credentials);
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Security Utils
|
|
231
|
+
|
|
232
|
+
#### `SecurityUtils`
|
|
233
|
+
**Description:** Security utilities and encryption
|
|
234
|
+
|
|
235
|
+
```javascript
|
|
236
|
+
const { SecurityUtils } = require('i18n-management-toolkit');
|
|
237
|
+
|
|
238
|
+
// Encrypt sensitive data
|
|
239
|
+
const encrypted = SecurityUtils.encrypt(data);
|
|
240
|
+
|
|
241
|
+
// Decrypt sensitive data
|
|
242
|
+
const decrypted = SecurityUtils.decrypt(encrypted);
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## 📈 Reporting API
|
|
246
|
+
|
|
247
|
+
### Report Types
|
|
248
|
+
|
|
249
|
+
| Report Type | Description | Output Formats |
|
|
250
|
+
|-------------|-------------|----------------|
|
|
251
|
+
| Analysis | Translation completeness analysis | JSON, HTML, CSV |
|
|
252
|
+
| Validation | Translation validation results | JSON, HTML |
|
|
253
|
+
| Usage | Translation key usage analysis | JSON, HTML, CSV |
|
|
254
|
+
| Sizing | Translation file sizing analysis | JSON, HTML |
|
|
255
|
+
| Summary | Comprehensive project summary | HTML, PDF, JSON |
|
|
256
|
+
|
|
257
|
+
### Report Generation
|
|
258
|
+
|
|
259
|
+
```javascript
|
|
260
|
+
const { ReportGenerator } = require('i18n-management-toolkit');
|
|
261
|
+
|
|
262
|
+
const generator = new ReportGenerator(config);
|
|
263
|
+
|
|
264
|
+
// Generate analysis report
|
|
265
|
+
const analysisReport = await generator.generateAnalysis();
|
|
266
|
+
|
|
267
|
+
// Generate summary report
|
|
268
|
+
const summaryReport = await generator.generateSummary();
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## 🌐 Internationalization Support
|
|
272
|
+
|
|
273
|
+
### Supported Languages
|
|
274
|
+
|
|
275
|
+
- **English (en)** - Default
|
|
276
|
+
- **Spanish (es)**
|
|
277
|
+
- **French (fr)**
|
|
278
|
+
- **German (de)**
|
|
279
|
+
- **Russian (ru)**
|
|
280
|
+
- **Japanese (ja)**
|
|
281
|
+
- **Chinese (zh)**
|
|
282
|
+
|
|
283
|
+
### UI Language Switching
|
|
284
|
+
|
|
285
|
+
```javascript
|
|
286
|
+
const { UIi18n } = require('i18n-management-toolkit');
|
|
287
|
+
|
|
288
|
+
const ui = new UIi18n();
|
|
289
|
+
ui.setLanguage('es'); // Switch to Spanish
|
|
290
|
+
const message = ui.t('common.welcome'); // Get translated message
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## 🔄 Workflow API
|
|
294
|
+
|
|
295
|
+
### Automated Workflows
|
|
296
|
+
|
|
297
|
+
#### Full Analysis Workflow
|
|
298
|
+
```javascript
|
|
299
|
+
const workflow = {
|
|
300
|
+
steps: [
|
|
301
|
+
'initialize',
|
|
302
|
+
'analyze',
|
|
303
|
+
'validate',
|
|
304
|
+
'checkUsage',
|
|
305
|
+
'generateReport'
|
|
306
|
+
],
|
|
307
|
+
config: {
|
|
308
|
+
autoFix: true,
|
|
309
|
+
generateSummary: true
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
await manager.runWorkflow(workflow);
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## 📝 Error Handling
|
|
317
|
+
|
|
318
|
+
### Error Types
|
|
319
|
+
|
|
320
|
+
| Error Type | Description | Resolution |
|
|
321
|
+
|------------|-------------|------------|
|
|
322
|
+
| `ConfigurationError` | Invalid configuration | Check config files |
|
|
323
|
+
| `ValidationError` | Translation validation failed | Fix translation files |
|
|
324
|
+
| `FileSystemError` | File system access issues | Check permissions |
|
|
325
|
+
| `NetworkError` | API/network connectivity | Check internet connection |
|
|
326
|
+
| `AuthenticationError` | Authentication failed | Verify credentials |
|
|
327
|
+
|
|
328
|
+
### Error Handling Example
|
|
329
|
+
|
|
330
|
+
```javascript
|
|
331
|
+
try {
|
|
332
|
+
await manager.analyze();
|
|
333
|
+
} catch (error) {
|
|
334
|
+
if (error instanceof ValidationError) {
|
|
335
|
+
console.error('Validation failed:', error.details);
|
|
336
|
+
} else {
|
|
337
|
+
console.error('Unexpected error:', error.message);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 📚 Examples
|
|
343
|
+
|
|
344
|
+
### Basic Usage
|
|
345
|
+
|
|
346
|
+
```javascript
|
|
347
|
+
// Initialize and analyze project
|
|
348
|
+
const manager = new I18nManager();
|
|
349
|
+
await manager.initialize();
|
|
350
|
+
const analysis = await manager.analyze();
|
|
351
|
+
console.log(`Completion: ${analysis.completionPercentage}%`);
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Advanced Configuration
|
|
355
|
+
|
|
356
|
+
```javascript
|
|
357
|
+
const config = {
|
|
358
|
+
sourceDir: './src',
|
|
359
|
+
localesDir: './locales',
|
|
360
|
+
languages: ['en', 'es', 'fr', 'de'],
|
|
361
|
+
framework: 'react-i18next',
|
|
362
|
+
validation: {
|
|
363
|
+
strict: true,
|
|
364
|
+
autoFix: true
|
|
365
|
+
},
|
|
366
|
+
reporting: {
|
|
367
|
+
format: 'html',
|
|
368
|
+
includeCharts: true
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const manager = new I18nManager(config);
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
**Note:** This API reference is maintained for version 1.0.0. For the latest updates, please refer to the [Changelog](../../CHANGELOG.md).
|