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.
- package/CHANGELOG.md +61 -1
- package/README.md +410 -20
- package/locales/de/common.json +17 -20
- package/locales/en/common.json +17 -20
- package/locales/es/common.json +17 -20
- package/locales/fr/common.json +17 -20
- package/locales/ru/common.json +17 -20
- package/main/i18ntk-manage.js +52 -24
- package/package.json +6 -8
- package/{dev → scripts}/debug/README.md +9 -5
- package/{dev → scripts}/debug/debugger.js +84 -4
- package/scripts/prepublish.js +2 -2
- package/scripts/validate-all-translations.js +2 -2
- package/ui-locales/de/debug.json +5 -5
- package/ui-locales/de/init.json +1 -0
- package/ui-locales/de/language.json +11 -2
- package/ui-locales/de/security.json +2 -1
- package/ui-locales/de/sizing.json +1 -0
- package/ui-locales/de/usage.json +1 -0
- package/ui-locales/en/debug.json +5 -5
- package/ui-locales/en/init.json +1 -0
- package/ui-locales/en/language.json +11 -2
- package/ui-locales/en/security.json +2 -1
- package/ui-locales/en/sizing.json +2 -0
- package/ui-locales/en/usage.json +1 -0
- package/ui-locales/es/debug.json +5 -5
- package/ui-locales/es/init.json +1 -0
- package/ui-locales/es/language.json +11 -2
- package/ui-locales/es/security.json +2 -1
- package/ui-locales/es/sizing.json +2 -0
- package/ui-locales/es/usage.json +1 -0
- package/ui-locales/fr/debug.json +5 -5
- package/ui-locales/fr/init.json +1 -0
- package/ui-locales/fr/language.json +11 -2
- package/ui-locales/fr/security.json +2 -1
- package/ui-locales/fr/sizing.json +2 -0
- package/ui-locales/fr/usage.json +1 -0
- package/ui-locales/ja/debug.json +5 -5
- package/ui-locales/ja/init.json +1 -0
- package/ui-locales/ja/language.json +11 -2
- package/ui-locales/ja/security.json +2 -1
- package/ui-locales/ja/sizing.json +3 -0
- package/ui-locales/ja/usage.json +1 -0
- package/ui-locales/pt/debug.json +5 -5
- package/ui-locales/pt/init.json +1 -0
- package/ui-locales/pt/language.json +11 -2
- package/ui-locales/pt/security.json +2 -1
- package/ui-locales/pt/sizing.json +2 -0
- package/ui-locales/pt/usage.json +1 -0
- package/ui-locales/ru/debug.json +5 -5
- package/ui-locales/ru/init.json +1 -0
- package/ui-locales/ru/language.json +11 -2
- package/ui-locales/ru/security.json +2 -1
- package/ui-locales/ru/sizing.json +2 -0
- package/ui-locales/ru/usage.json +1 -0
- package/ui-locales/zh/debug.json +5 -5
- package/ui-locales/zh/init.json +1 -0
- package/ui-locales/zh/language.json +11 -2
- package/ui-locales/zh/security.json +2 -1
- package/ui-locales/zh/sizing.json +2 -0
- package/ui-locales/zh/usage.json +1 -0
- package/utils/test-complete-system.js +1 -1
- package/dev/README.md +0 -37
- package/docs/INSTALLATION.md +0 -98
- package/docs/PIN_PROTECTION_GUIDE.md +0 -265
- package/docs/README.md +0 -111
- package/docs/SCRIPT_DIRECTORY_GUIDE.md +0 -278
- package/docs/TODO_ROADMAP.md +0 -279
- package/docs/TRANSLATION_STATUS.md +0 -67
- package/docs/api/API_REFERENCE.md +0 -258
- package/docs/api/COMPONENTS.md +0 -492
- package/docs/api/CONFIGURATION.md +0 -676
- package/docs/api/NPM_PUBLISHING_GUIDE.md +0 -426
- package/docs/debug/DEBUG_README.md +0 -30
- package/docs/debug/DEBUG_TOOLS.md +0 -152
- package/docs/development/AGENTS.md +0 -349
- package/docs/development/DEVELOPMENT_RULES.md +0 -165
- package/docs/development/DEV_README.md +0 -41
- package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +0 -175
- package/docs/release-notes/RELEASE_NOTES_v1.0.4.md +0 -153
- package/docs/release-notes/RELEASE_NOTES_v1.1.2.md +0 -68
- package/docs/release-notes/RELEASE_NOTES_v1.1.5.md +0 -81
- package/docs/release-notes/RELEASE_NOTES_v1.4.0.md +0 -115
- package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +0 -141
- package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +0 -185
- package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +0 -199
- package/docs/release-notes/v1.3.0.md +0 -162
- package/docs/release-notes/v1.3.1.md +0 -136
- package/docs/reports/ANALYSIS_README.md +0 -17
- package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +0 -181
- package/docs/reports/SIZING_README.md +0 -18
- package/docs/reports/SUMMARY_README.md +0 -18
- package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +0 -129
- package/docs/reports/USAGE_README.md +0 -18
- package/docs/reports/VALIDATION_README.md +0 -18
- /package/{dev → scripts}/debug/complete-console-translations.js +0 -0
- /package/{dev → scripts}/debug/console-key-checker.js +0 -0
- /package/{dev → scripts}/debug/console-translations.js +0 -0
- /package/{dev → scripts}/debug/debug-security.js +0 -0
- /package/{dev → scripts}/debug/debug-translation.js +0 -0
- /package/{dev → scripts}/debug/export-missing-keys.js +0 -0
- /package/{dev → scripts}/debug/final-normalize.js +0 -0
- /package/{dev → scripts}/debug/find-extra-keys.js +0 -0
- /package/{dev → scripts}/debug/normalize-locales.js +0 -0
- /package/{dev → scripts}/debug/refactor-locales.js +0 -0
- /package/{dev → scripts}/debug/reorder-locales.js +0 -0
- /package/{dev → scripts}/debug/replace-hardcoded-console.js +0 -0
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
# 🤖 AI Agent Guidelines for I18N Management Toolkit v1.5.0
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides essential guidelines for AI agents working with the I18N Management Toolkit v1.5.0. It explains how to properly handle translations, understand the enhanced security architecture, and ensure accurate localization with complete console translation support.
|
|
6
|
-
|
|
7
|
-
## 🆕 Version 1.5.0 Key Features
|
|
8
|
-
|
|
9
|
-
- **🌐 100% Console Translation Support**: All console output is fully internationalized
|
|
10
|
-
- **🔒 Enhanced Admin PIN Security**: Modern encrypted PIN with session-based authentication
|
|
11
|
-
- **🛡️ Session Management**: 30-minute timeout with automatic re-authentication
|
|
12
|
-
- **📁 Improved Architecture**: Better organized file structure and modular design
|
|
13
|
-
- **🔧 Advanced Security**: AES-256-GCM encryption replacing deprecated crypto functions
|
|
14
|
-
|
|
15
|
-
## 🔍 Key Search Patterns
|
|
16
|
-
|
|
17
|
-
### Translation Markers
|
|
18
|
-
|
|
19
|
-
When working with this codebase, AI agents must search for and understand these critical patterns:
|
|
20
|
-
|
|
21
|
-
#### 1. `[NOT_TRANSLATED]` Markers
|
|
22
|
-
|
|
23
|
-
**CRITICAL**: Always search the codebase for `[NOT_TRANSLATED]` markers. These indicate content that needs translation.
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
// Example patterns to look for:
|
|
27
|
-
const message = '[NOT_TRANSLATED]Hello, world!';
|
|
28
|
-
const error = '[TRANSLATED]File not found';
|
|
29
|
-
const status = '[TRANSLATED]Processing complete';
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Action Required**: When you find `[NOT_TRANSLATED]` markers:
|
|
33
|
-
1. Identify the target language from the file path (e.g., `/de/`, `/es/`, `/fr/`, `/ru/`, `/ja/`, `/zh/`)
|
|
34
|
-
2. Translate the content into the appropriate native language
|
|
35
|
-
3. Remove the `[NOT_TRANSLATED]` marker after translation
|
|
36
|
-
4. Ensure cultural and contextual appropriateness
|
|
37
|
-
|
|
38
|
-
#### 2. Language Detection from File Paths
|
|
39
|
-
|
|
40
|
-
**File Path Examples**:
|
|
41
|
-
- `/locales/de/common.json` → German (Deutsch)
|
|
42
|
-
- `/locales/es/auth.json` → Spanish (Español)
|
|
43
|
-
- `/locales/fr/validation.json` → French (Français)
|
|
44
|
-
- `/locales/ru/errors.json` → Russian (Русский)
|
|
45
|
-
- `/locales/ja/messages.json` → Japanese (日本語)
|
|
46
|
-
- `/locales/zh/interface.json` → Chinese (中文)
|
|
47
|
-
- `/ui-locales/de.json` → German UI translations
|
|
48
|
-
|
|
49
|
-
#### 3. Translation Key Patterns
|
|
50
|
-
|
|
51
|
-
```javascript
|
|
52
|
-
// Common translation function patterns:
|
|
53
|
-
t('key.name') // Standard i18next
|
|
54
|
-
$t('key.name') // Vue i18n
|
|
55
|
-
i18n.t('key.name') // Direct i18next
|
|
56
|
-
translate('key.name') // Custom function
|
|
57
|
-
formatMessage({ id: 'key.name' }) // React Intl
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## 🌍 Language-Specific Guidelines
|
|
61
|
-
|
|
62
|
-
### German (de)
|
|
63
|
-
- Use formal "Sie" form unless context suggests informal "du"
|
|
64
|
-
- Compound words should be properly formed
|
|
65
|
-
- Technical terms may remain in English if commonly used
|
|
66
|
-
- Example: `[TRANSLATED]Settings` → `Einstellungen`
|
|
67
|
-
|
|
68
|
-
### Spanish (es)
|
|
69
|
-
- Use neutral Spanish (avoid regional variants)
|
|
70
|
-
- Maintain gender agreement
|
|
71
|
-
- Use formal "usted" for professional contexts
|
|
72
|
-
- Example: `[TRANSLATED]Welcome` → `Bienvenido/a`
|
|
73
|
-
|
|
74
|
-
### French (fr)
|
|
75
|
-
- Use formal language for professional contexts
|
|
76
|
-
- Maintain proper accent marks
|
|
77
|
-
- Consider gender agreement for adjectives
|
|
78
|
-
- Example: `[TRANSLATED]Configuration` → `Configuration`
|
|
79
|
-
|
|
80
|
-
### Russian (ru)
|
|
81
|
-
- Use appropriate case endings
|
|
82
|
-
- Consider formal vs informal contexts
|
|
83
|
-
- Maintain Cyrillic script consistency
|
|
84
|
-
- Example: `[TRANSLATED]Error` → `Ошибка`
|
|
85
|
-
|
|
86
|
-
### Japanese (ja)
|
|
87
|
-
- Use appropriate politeness levels (keigo)
|
|
88
|
-
- Consider context for hiragana vs katakana
|
|
89
|
-
- Technical terms may use katakana
|
|
90
|
-
- Example: `[TRANSLATED]File` → `ファイル`
|
|
91
|
-
|
|
92
|
-
### Chinese (zh)
|
|
93
|
-
- Use Simplified Chinese unless specified otherwise
|
|
94
|
-
- Consider context for technical vs everyday terms
|
|
95
|
-
- Maintain consistency in terminology
|
|
96
|
-
- Example: `[TRANSLATED]Settings` → `设置`
|
|
97
|
-
|
|
98
|
-
## 📁 File Structure Understanding (v1.5.0)
|
|
99
|
-
|
|
100
|
-
### Core Architecture
|
|
101
|
-
```
|
|
102
|
-
i18n-management-toolkit/
|
|
103
|
-
├── main/ # Core i18ntk scripts
|
|
104
|
-
│ ├── i18ntk-analyze.js # Translation analysis
|
|
105
|
-
│ ├── i18ntk-autorun.js # Automated workflow
|
|
106
|
-
│ ├── i18ntk-complete.js # Complete missing translations
|
|
107
|
-
│ ├── i18ntk-init.js # Initialize i18n setup
|
|
108
|
-
│ ├── i18ntk-manage.js # Main management interface
|
|
109
|
-
│ ├── i18ntk-sizing.js # Generate sizing reports
|
|
110
|
-
│ ├── i18ntk-summary.js # Generate summary reports
|
|
111
|
-
│ ├── i18ntk-usage.js # Analyze translation usage
|
|
112
|
-
│ ├── i18ntk-validate.js # Validate translations
|
|
113
|
-
│ └── i18ntk-ui.js # UI internationalization helper
|
|
114
|
-
├── utils/ # Utility scripts and helpers
|
|
115
|
-
│ ├── admin-auth.js # Admin authentication (legacy)
|
|
116
|
-
│ ├── admin-cli.js # Admin command-line interface
|
|
117
|
-
│ ├── admin-pin.js # Enhanced PIN security system
|
|
118
|
-
│ ├── i18n-helper.js # i18n utility functions
|
|
119
|
-
│ ├── native-translations.js # Native translation replacer
|
|
120
|
-
│ ├── security.js # Security utilities
|
|
121
|
-
│ └── [other utilities] # Language validation, testing tools
|
|
122
|
-
├── settings/ # Configuration management
|
|
123
|
-
│ ├── settings-manager.js # Main settings manager
|
|
124
|
-
│ ├── settings-cli.js # Settings command-line interface
|
|
125
|
-
│ ├── i18ntk-config.json # User configuration
|
|
126
|
-
│ ├── admin-config.json # Admin configuration
|
|
127
|
-
│ └── backups/ # Configuration backups
|
|
128
|
-
├── dev/ # Development and debugging tools
|
|
129
|
-
│ ├── debug/ # Debug utilities and analyzers
|
|
130
|
-
│ └── tests/ # Test suite
|
|
131
|
-
├── docs/ # Comprehensive documentation
|
|
132
|
-
│ ├── api/ # API documentation
|
|
133
|
-
│ ├── development/ # Development guides
|
|
134
|
-
│ └── reports/ # Report documentation
|
|
135
|
-
└── ui-locales/ # Toolkit's UI translations (7 languages)
|
|
136
|
-
├── en.json # English (source)
|
|
137
|
-
├── de.json # German
|
|
138
|
-
├── es.json # Spanish
|
|
139
|
-
├── fr.json # French
|
|
140
|
-
├── ru.json # Russian
|
|
141
|
-
├── ja.json # Japanese
|
|
142
|
-
└── zh.json # Chinese
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Project Locale Files Structure
|
|
146
|
-
```
|
|
147
|
-
locales/ # Your project's translation files
|
|
148
|
-
├── en/ # English (source language)
|
|
149
|
-
│ ├── common.json
|
|
150
|
-
│ ├── auth.json
|
|
151
|
-
│ └── pagination.json
|
|
152
|
-
├── de/ # German translations
|
|
153
|
-
├── es/ # Spanish translations
|
|
154
|
-
├── fr/ # French translations
|
|
155
|
-
└── ru/ # Russian translations
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Security Architecture
|
|
159
|
-
```
|
|
160
|
-
settings/
|
|
161
|
-
├── admin-pin.json # Encrypted PIN storage (AES-256-GCM)
|
|
162
|
-
├── admin-config.json # Admin configuration
|
|
163
|
-
└── i18ntk-config.json # User preferences
|
|
164
|
-
|
|
165
|
-
utils/
|
|
166
|
-
├── admin-pin.js # Enhanced PIN security with session management
|
|
167
|
-
├── admin-auth.js # Legacy authentication (deprecated)
|
|
168
|
-
└── security.js # Security utilities
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## 🔧 Enhanced Translation Workflow for AI Agents (v1.5.0)
|
|
172
|
-
|
|
173
|
-
### Step 1: Comprehensive Analysis & Detection
|
|
174
|
-
1. Search for `[NOT_TRANSLATED]` markers in project files
|
|
175
|
-
2. Run `node dev/debug/console-key-checker.js` to identify missing UI translations
|
|
176
|
-
3. Use `node main/i18ntk-analyze.js` for detailed translation analysis
|
|
177
|
-
4. Determine target language from file path context
|
|
178
|
-
5. Understand the context (UI, console output, error message, documentation, etc.)
|
|
179
|
-
|
|
180
|
-
### Step 2: Automated Translation Processing
|
|
181
|
-
1. Use `node utils/native-translations.js` to replace `[NOT_TRANSLATED]` placeholders
|
|
182
|
-
2. Translate content accurately and contextually
|
|
183
|
-
3. Maintain technical terminology consistency across all 7 supported languages
|
|
184
|
-
4. Consider cultural appropriateness and formality levels
|
|
185
|
-
5. Preserve formatting, variables, and special characters
|
|
186
|
-
|
|
187
|
-
### Step 3: Advanced Validation & Quality Assurance
|
|
188
|
-
1. Remove `[NOT_TRANSLATED]` markers after translation
|
|
189
|
-
2. Use `node main/i18ntk-validate.js` for comprehensive integrity checks
|
|
190
|
-
3. Run `node main/i18ntk-usage.js` to analyze translation usage patterns
|
|
191
|
-
4. Ensure JSON syntax remains valid across all files
|
|
192
|
-
5. Verify placeholder variables are preserved (e.g., `{{variable}}`)
|
|
193
|
-
6. Check for consistency with existing translations
|
|
194
|
-
7. Generate reports with `node main/i18ntk-summary.js` and `node main/i18ntk-sizing.js`
|
|
195
|
-
|
|
196
|
-
### Step 4: Security & Session Management
|
|
197
|
-
1. Use enhanced admin PIN system for secure access to management tools
|
|
198
|
-
2. Session-based authentication with 30-minute timeout
|
|
199
|
-
3. Encrypted configuration storage with AES-256-GCM
|
|
200
|
-
4. Secure backup and restore functionality
|
|
201
|
-
|
|
202
|
-
## 🚨 Critical Rules
|
|
203
|
-
|
|
204
|
-
### DO:
|
|
205
|
-
- ✅ Always search for `[TRANSLATED]` markers
|
|
206
|
-
- ✅ Identify language from file path context
|
|
207
|
-
- ✅ Maintain JSON structure and syntax
|
|
208
|
-
- ✅ Preserve placeholder variables (e.g., `{{variable}}`)
|
|
209
|
-
- ✅ Use appropriate formality level for context
|
|
210
|
-
- ✅ Maintain consistency with existing translations
|
|
211
|
-
|
|
212
|
-
### DON'T:
|
|
213
|
-
- ❌ Translate technical configuration keys
|
|
214
|
-
- ❌ Modify JSON structure or syntax
|
|
215
|
-
- ❌ Remove or alter placeholder variables
|
|
216
|
-
- ❌ Use machine translation without context consideration
|
|
217
|
-
- ❌ Mix languages within the same file
|
|
218
|
-
- ❌ Leave `[TRANSLATED]` markers after translation
|
|
219
|
-
|
|
220
|
-
## 🔍 Enhanced Search Commands for AI Agents (v1.5.0)
|
|
221
|
-
|
|
222
|
-
### Essential Search Patterns
|
|
223
|
-
```bash
|
|
224
|
-
# Find all translation markers (updated for v1.5.0)
|
|
225
|
-
grep -r "\[NOT_TRANSLATED\]" .
|
|
226
|
-
grep -r "\[TRANSLATED\]" .
|
|
227
|
-
|
|
228
|
-
# Find specific language files in project locales
|
|
229
|
-
find . -path "*/locales/de/*" -name "*.json"
|
|
230
|
-
find . -path "*/locales/es/*" -name "*.json"
|
|
231
|
-
find . -path "*/locales/fr/*" -name "*.json"
|
|
232
|
-
find . -path "*/locales/ru/*" -name "*.json"
|
|
233
|
-
find . -path "*/locales/ja/*" -name "*.json"
|
|
234
|
-
find . -path "*/locales/zh/*" -name "*.json"
|
|
235
|
-
|
|
236
|
-
# Find UI locale files (toolkit's own translations)
|
|
237
|
-
ls ui-locales/*.json
|
|
238
|
-
|
|
239
|
-
# Search for translation function usage
|
|
240
|
-
grep -r "t(\|\$t(\|i18n\.t(" --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" .
|
|
241
|
-
|
|
242
|
-
# Check for English text in foreign language files
|
|
243
|
-
grep -r "[a-zA-Z]" locales/de/ --include="*.json" | grep -v "\"[a-zA-Z]*\":"
|
|
244
|
-
grep -r "[a-zA-Z]" locales/es/ --include="*.json" | grep -v "\"[a-zA-Z]*\":"
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### V1.5.0 Diagnostic Commands
|
|
248
|
-
```bash
|
|
249
|
-
# Run comprehensive translation analysis
|
|
250
|
-
node main/i18ntk-analyze.js
|
|
251
|
-
|
|
252
|
-
# Check for missing console translations
|
|
253
|
-
node dev/debug/console-key-checker.js
|
|
254
|
-
|
|
255
|
-
# Validate all translations
|
|
256
|
-
node main/i18ntk-validate.js
|
|
257
|
-
|
|
258
|
-
# Generate translation usage report
|
|
259
|
-
node main/i18ntk-usage.js
|
|
260
|
-
|
|
261
|
-
# Create summary and sizing reports
|
|
262
|
-
node main/i18ntk-summary.js
|
|
263
|
-
node main/i18ntk-sizing.js
|
|
264
|
-
|
|
265
|
-
# Replace [NOT_TRANSLATED] placeholders
|
|
266
|
-
node utils/native-translations.js
|
|
267
|
-
|
|
268
|
-
# Complete missing translations workflow
|
|
269
|
-
node main/i18ntk-complete.js
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
## 📝 Example Translation Process
|
|
273
|
-
|
|
274
|
-
### Before Translation
|
|
275
|
-
```json
|
|
276
|
-
{
|
|
277
|
-
"welcome": "[TRANSLATED]Welcome to the application",
|
|
278
|
-
"error": {
|
|
279
|
-
"fileNotFound": "[TRANSLATED]File {{filename}} not found",
|
|
280
|
-
"invalidInput": "[TRANSLATED]Please enter a valid value"
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### After Translation (German)
|
|
286
|
-
```json
|
|
287
|
-
{
|
|
288
|
-
"welcome": "Willkommen in der Anwendung",
|
|
289
|
-
"error": {
|
|
290
|
-
"fileNotFound": "Datei {{filename}} nicht gefunden",
|
|
291
|
-
"invalidInput": "Bitte geben Sie einen gültigen Wert ein"
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
## 🛠️ Enhanced Tools and Validation (v1.5.0)
|
|
297
|
-
|
|
298
|
-
### Core Validation Commands
|
|
299
|
-
```bash
|
|
300
|
-
# Validate JSON syntax
|
|
301
|
-
node -e "console.log(JSON.parse(require('fs').readFileSync('path/to/file.json', 'utf8')))"
|
|
302
|
-
|
|
303
|
-
# Check for remaining translation markers
|
|
304
|
-
grep -r "\[NOT_TRANSLATED\]" locales/
|
|
305
|
-
grep -r "\[TRANSLATED\]" locales/
|
|
306
|
-
|
|
307
|
-
# Run comprehensive toolkit validation
|
|
308
|
-
node main/i18ntk-validate.js
|
|
309
|
-
|
|
310
|
-
# Main management interface
|
|
311
|
-
node main/i18ntk-manage.js
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### Security and Authentication
|
|
315
|
-
```bash
|
|
316
|
-
# Access admin features (requires PIN)
|
|
317
|
-
node utils/admin-cli.js
|
|
318
|
-
|
|
319
|
-
# Settings management with enhanced security
|
|
320
|
-
node settings/settings-manager.js
|
|
321
|
-
node settings/settings-cli.js
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Advanced Analysis Tools
|
|
325
|
-
```bash
|
|
326
|
-
# Complete workflow automation
|
|
327
|
-
node main/i18ntk-autorun.js
|
|
328
|
-
|
|
329
|
-
# Initialize new i18n projects
|
|
330
|
-
node main/i18ntk-init.js
|
|
331
|
-
|
|
332
|
-
# Debug and development tools
|
|
333
|
-
node dev/debug/console-key-checker.js
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
## 📞 Support and Resources (v1.5.0)
|
|
337
|
-
|
|
338
|
-
- **Enhanced Security**: Modern AES-256-GCM encryption with session management
|
|
339
|
-
- **Settings Configuration**: See `settings/settings-manager.js` for advanced configuration options
|
|
340
|
-
- **Admin Authentication**: Enhanced PIN system with `utils/admin-pin.js`
|
|
341
|
-
- **Translation Patterns**: Check `processing.translationPatterns` in settings
|
|
342
|
-
- **Validation**: Use built-in validation tools with comprehensive reporting
|
|
343
|
-
- **Console Translation**: 100% internationalized console output
|
|
344
|
-
- **Documentation**: Comprehensive docs in `docs/` directory
|
|
345
|
-
- **Development Tools**: Advanced debugging utilities in `dev/debug/`
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
**Remember**: The goal is to provide native, contextually appropriate translations that maintain the technical accuracy and user experience of the original content. Always prioritize clarity and cultural appropriateness over literal translation.
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
# i18nTK Development Rules
|
|
2
|
-
|
|
3
|
-
This document outlines the essential rules and guidelines that must be followed to maintain code quality, prevent issues, and ensure the stability of the i18nTK project.
|
|
4
|
-
|
|
5
|
-
## 🚨 Critical Rules (MUST FOLLOW)
|
|
6
|
-
|
|
7
|
-
### 1. File Naming Conventions
|
|
8
|
-
- **NEVER** use old numbered naming conventions (e.g., `01-init-i18n.js`, `04-check-usage.js`)
|
|
9
|
-
- **ALWAYS** use the `i18ntk-` prefix for core scripts (e.g., `i18ntk-init.js`, `i18ntk-usage.js`)
|
|
10
|
-
- **ALWAYS** update ALL references when renaming files (code, documentation, package.json, etc.)
|
|
11
|
-
|
|
12
|
-
### 2. Translation Key Management
|
|
13
|
-
- **NEVER** commit code with missing translation keys
|
|
14
|
-
- **ALWAYS** ensure all UI locale files have complete translation coverage
|
|
15
|
-
- **ALWAYS** run translation validation before committing
|
|
16
|
-
- **NEVER** hardcode text strings in code - use translation keys
|
|
17
|
-
|
|
18
|
-
### 3. Configuration Management
|
|
19
|
-
- **ALWAYS** use the `SettingsManager` class for configuration access
|
|
20
|
-
- **NEVER** hardcode file paths or settings in scripts
|
|
21
|
-
- **ALWAYS** validate configuration before using it
|
|
22
|
-
- **ALWAYS** provide fallback values for optional settings
|
|
23
|
-
|
|
24
|
-
### 4. Code References
|
|
25
|
-
- **ALWAYS** update ALL file references when renaming scripts
|
|
26
|
-
- **NEVER** leave dead references to old file names
|
|
27
|
-
- **ALWAYS** use relative paths consistently
|
|
28
|
-
- **ALWAYS** check for references in: code files, package.json, documentation, locale files
|
|
29
|
-
|
|
30
|
-
## 📋 Development Guidelines
|
|
31
|
-
|
|
32
|
-
### File Organization
|
|
33
|
-
```
|
|
34
|
-
project-root/
|
|
35
|
-
├── i18ntk-*.js # Core scripts with i18ntk- prefix
|
|
36
|
-
├── dev/ # Development tools and tests
|
|
37
|
-
│ ├── tests/ # Test scripts
|
|
38
|
-
│ ├── debug/ # Debug tools
|
|
39
|
-
│ └── scripts/ # Development utilities
|
|
40
|
-
├── i18ntk-reports/ # Organized report structure (all reports centralized here)
|
|
41
|
-
│ ├── analysis/ # Analysis reports
|
|
42
|
-
│ ├── validation/ # Validation reports
|
|
43
|
-
│ ├── usage/ # Usage reports
|
|
44
|
-
│ ├── sizing/ # Sizing reports
|
|
45
|
-
│ └── summary/ # Summary reports
|
|
46
|
-
├── ui-locales/ # UI translation files
|
|
47
|
-
├── locales/ # Project translation files
|
|
48
|
-
└── settings/i18ntk-config.json # Main configuration (in settings folder)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Testing Requirements
|
|
52
|
-
- **ALWAYS** test scripts after making changes
|
|
53
|
-
- **ALWAYS** run the full workflow: `npx i18ntk`
|
|
54
|
-
- **ALWAYS** check for errors in all supported languages
|
|
55
|
-
- **ALWAYS** validate configuration changes
|
|
56
|
-
|
|
57
|
-
### Documentation Standards
|
|
58
|
-
- **ALWAYS** update README.md when changing commands or structure
|
|
59
|
-
- **ALWAYS** update CHANGELOG.md for version changes
|
|
60
|
-
- **ALWAYS** document new features and breaking changes
|
|
61
|
-
- **ALWAYS** keep documentation in sync with code
|
|
62
|
-
|
|
63
|
-
## 🔧 Pre-Commit Checklist
|
|
64
|
-
|
|
65
|
-
Before committing any changes, ensure:
|
|
66
|
-
|
|
67
|
-
- [ ] All tests pass: `npm test` (if available)
|
|
68
|
-
- [ ] Full workflow runs successfully: `npx i18ntk`
|
|
69
|
-
- [ ] No missing translation keys: `node dev/debug/debugger.js`
|
|
70
|
-
- [ ] No old file references remain
|
|
71
|
-
- [ ] Documentation is updated
|
|
72
|
-
- [ ] Configuration is valid
|
|
73
|
-
- [ ] No hardcoded paths or settings
|
|
74
|
-
|
|
75
|
-
## 🚫 Common Mistakes to Avoid
|
|
76
|
-
|
|
77
|
-
### File Naming Issues
|
|
78
|
-
- ❌ Using numbered prefixes: `01-script.js`
|
|
79
|
-
- ❌ Inconsistent naming: `i18n-script.js` vs `i18ntk-script.js`
|
|
80
|
-
- ❌ Leaving old files after renaming
|
|
81
|
-
|
|
82
|
-
### Translation Issues
|
|
83
|
-
- ❌ Missing translation keys in any language
|
|
84
|
-
- ❌ Inconsistent key structures across languages
|
|
85
|
-
- ❌ Hardcoded text in code
|
|
86
|
-
- ❌ Invalid JSON in locale files
|
|
87
|
-
|
|
88
|
-
### Configuration Issues
|
|
89
|
-
- ❌ Hardcoded file paths
|
|
90
|
-
- ❌ Missing fallback values
|
|
91
|
-
- ❌ Invalid configuration structure
|
|
92
|
-
- ❌ Not using SettingsManager
|
|
93
|
-
|
|
94
|
-
### Reference Issues
|
|
95
|
-
- ❌ Dead references to renamed files
|
|
96
|
-
- ❌ Inconsistent path formats
|
|
97
|
-
- ❌ Missing updates in package.json
|
|
98
|
-
- ❌ Outdated documentation
|
|
99
|
-
|
|
100
|
-
## 🛠️ Debug and Validation Tools
|
|
101
|
-
|
|
102
|
-
### Available Tools
|
|
103
|
-
- `node dev/debug/debugger.js` - Main debugging script
|
|
104
|
-
- `npx i18ntk` - Full workflow validation
|
|
105
|
-
- `npx i18ntk validate` - Translation validation
|
|
106
|
-
- `npx i18ntk usage` - Usage analysis
|
|
107
|
-
|
|
108
|
-
### When to Use Debug Tools
|
|
109
|
-
- Before committing changes
|
|
110
|
-
- After renaming files
|
|
111
|
-
- When adding new translations
|
|
112
|
-
- When modifying configuration
|
|
113
|
-
- When encountering errors
|
|
114
|
-
|
|
115
|
-
## 📝 Version Control Guidelines
|
|
116
|
-
|
|
117
|
-
### Commit Messages
|
|
118
|
-
- Use clear, descriptive commit messages
|
|
119
|
-
- Reference issue numbers when applicable
|
|
120
|
-
- Use conventional commit format when possible
|
|
121
|
-
|
|
122
|
-
### Branch Management
|
|
123
|
-
- Create feature branches for significant changes
|
|
124
|
-
- Test thoroughly before merging
|
|
125
|
-
- Keep main branch stable
|
|
126
|
-
|
|
127
|
-
### Release Process
|
|
128
|
-
- Update version in package.json
|
|
129
|
-
- Update CHANGELOG.md
|
|
130
|
-
- Run full test suite
|
|
131
|
-
- Validate all translations
|
|
132
|
-
- Test installation process
|
|
133
|
-
|
|
134
|
-
## 🔍 Code Review Requirements
|
|
135
|
-
|
|
136
|
-
When reviewing code changes, check for:
|
|
137
|
-
- Compliance with naming conventions
|
|
138
|
-
- Complete translation coverage
|
|
139
|
-
- Proper configuration usage
|
|
140
|
-
- Updated documentation
|
|
141
|
-
- No hardcoded values
|
|
142
|
-
- Consistent code style
|
|
143
|
-
|
|
144
|
-
## 📞 Getting Help
|
|
145
|
-
|
|
146
|
-
If you encounter issues:
|
|
147
|
-
1. Run the debugger: `node dev/debug/debugger.js`
|
|
148
|
-
2. Check the logs in `dev/debug/logs/`
|
|
149
|
-
3. Review this rules document
|
|
150
|
-
4. Check existing issues and documentation
|
|
151
|
-
5. Create a detailed issue report if needed
|
|
152
|
-
|
|
153
|
-
## 🎯 Quality Metrics
|
|
154
|
-
|
|
155
|
-
Maintain these quality standards:
|
|
156
|
-
- 0 missing translation keys
|
|
157
|
-
- 0 dead file references
|
|
158
|
-
- 100% test coverage for critical paths
|
|
159
|
-
- Clear, up-to-date documentation
|
|
160
|
-
- Consistent code style
|
|
161
|
-
- Proper error handling
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
**Remember: Following these rules prevents issues and maintains project quality. When in doubt, run the debugger and validate your changes!**
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# i18ntk Development Guide
|
|
2
|
-
|
|
3
|
-
**Version:** 1.4.0 (04/08/2025)
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Development resources and tools for contributing to i18ntk.
|
|
8
|
-
|
|
9
|
-
## Structure
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
dev/
|
|
13
|
-
├── tests/ # Test scripts and data
|
|
14
|
-
├── debug/ # Debugging utilities
|
|
15
|
-
├── reports/ # Development reports
|
|
16
|
-
└── scripts/ # Helper scripts
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Test Scripts
|
|
20
|
-
|
|
21
|
-
- `test-complete-system.js` - Full integration tests
|
|
22
|
-
- `test-features.js` - Feature-specific tests
|
|
23
|
-
- `test-console-i18n.js` - Console i18n tests
|
|
24
|
-
|
|
25
|
-
## Debug Tools
|
|
26
|
-
|
|
27
|
-
- `debugger.js` - Main debugging utility
|
|
28
|
-
- `debug-config.js` - Configuration helper
|
|
29
|
-
|
|
30
|
-
## Reports
|
|
31
|
-
|
|
32
|
-
Organized by type:
|
|
33
|
-
- `analysis/` - Translation analysis
|
|
34
|
-
- `validation/` - Validation reports
|
|
35
|
-
- `usage/` - Usage analysis
|
|
36
|
-
- `sizing/` - File sizing
|
|
37
|
-
- `summary/` - Project summaries
|
|
38
|
-
|
|
39
|
-
## Development
|
|
40
|
-
|
|
41
|
-
See `DEVELOPMENT_RULES.md` for coding standards and best practices.
|