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,351 @@
|
|
|
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
|
+
โ โโโ ui-i18n.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
|
+
โ โโโ user-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
|
+
โ โโโ reportGenerator.json
|
|
153
|
+
โ โโโ validationStep.json
|
|
154
|
+
โโโ de/ # German translations
|
|
155
|
+
โโโ es/ # Spanish translations
|
|
156
|
+
โโโ fr/ # French translations
|
|
157
|
+
โโโ ru/ # Russian translations
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Security Architecture
|
|
161
|
+
```
|
|
162
|
+
settings/
|
|
163
|
+
โโโ admin-pin.json # Encrypted PIN storage (AES-256-GCM)
|
|
164
|
+
โโโ admin-config.json # Admin configuration
|
|
165
|
+
โโโ user-config.json # User preferences
|
|
166
|
+
|
|
167
|
+
utils/
|
|
168
|
+
โโโ admin-pin.js # Enhanced PIN security with session management
|
|
169
|
+
โโโ admin-auth.js # Legacy authentication (deprecated)
|
|
170
|
+
โโโ security.js # Security utilities
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## ๐ง Enhanced Translation Workflow for AI Agents (v1.5.0)
|
|
174
|
+
|
|
175
|
+
### Step 1: Comprehensive Analysis & Detection
|
|
176
|
+
1. Search for `[NOT_TRANSLATED]` markers in project files
|
|
177
|
+
2. Run `node dev/debug/console-key-checker.js` to identify missing UI translations
|
|
178
|
+
3. Use `node main/i18ntk-analyze.js` for detailed translation analysis
|
|
179
|
+
4. Determine target language from file path context
|
|
180
|
+
5. Understand the context (UI, console output, error message, documentation, etc.)
|
|
181
|
+
|
|
182
|
+
### Step 2: Automated Translation Processing
|
|
183
|
+
1. Use `node utils/native-translations.js` to replace `[NOT_TRANSLATED]` placeholders
|
|
184
|
+
2. Translate content accurately and contextually
|
|
185
|
+
3. Maintain technical terminology consistency across all 7 supported languages
|
|
186
|
+
4. Consider cultural appropriateness and formality levels
|
|
187
|
+
5. Preserve formatting, variables, and special characters
|
|
188
|
+
|
|
189
|
+
### Step 3: Advanced Validation & Quality Assurance
|
|
190
|
+
1. Remove `[NOT_TRANSLATED]` markers after translation
|
|
191
|
+
2. Use `node main/i18ntk-validate.js` for comprehensive integrity checks
|
|
192
|
+
3. Run `node main/i18ntk-usage.js` to analyze translation usage patterns
|
|
193
|
+
4. Ensure JSON syntax remains valid across all files
|
|
194
|
+
5. Verify placeholder variables are preserved (e.g., `{{variable}}`)
|
|
195
|
+
6. Check for consistency with existing translations
|
|
196
|
+
7. Generate reports with `node main/i18ntk-summary.js` and `node main/i18ntk-sizing.js`
|
|
197
|
+
|
|
198
|
+
### Step 4: Security & Session Management
|
|
199
|
+
1. Use enhanced admin PIN system for secure access to management tools
|
|
200
|
+
2. Session-based authentication with 30-minute timeout
|
|
201
|
+
3. Encrypted configuration storage with AES-256-GCM
|
|
202
|
+
4. Secure backup and restore functionality
|
|
203
|
+
|
|
204
|
+
## ๐จ Critical Rules
|
|
205
|
+
|
|
206
|
+
### DO:
|
|
207
|
+
- โ
Always search for `[TRANSLATED]` markers
|
|
208
|
+
- โ
Identify language from file path context
|
|
209
|
+
- โ
Maintain JSON structure and syntax
|
|
210
|
+
- โ
Preserve placeholder variables (e.g., `{{variable}}`)
|
|
211
|
+
- โ
Use appropriate formality level for context
|
|
212
|
+
- โ
Maintain consistency with existing translations
|
|
213
|
+
|
|
214
|
+
### DON'T:
|
|
215
|
+
- โ Translate technical configuration keys
|
|
216
|
+
- โ Modify JSON structure or syntax
|
|
217
|
+
- โ Remove or alter placeholder variables
|
|
218
|
+
- โ Use machine translation without context consideration
|
|
219
|
+
- โ Mix languages within the same file
|
|
220
|
+
- โ Leave `[TRANSLATED]` markers after translation
|
|
221
|
+
|
|
222
|
+
## ๐ Enhanced Search Commands for AI Agents (v1.5.0)
|
|
223
|
+
|
|
224
|
+
### Essential Search Patterns
|
|
225
|
+
```bash
|
|
226
|
+
# Find all translation markers (updated for v1.5.0)
|
|
227
|
+
grep -r "\[NOT_TRANSLATED\]" .
|
|
228
|
+
grep -r "\[TRANSLATED\]" .
|
|
229
|
+
|
|
230
|
+
# Find specific language files in project locales
|
|
231
|
+
find . -path "*/locales/de/*" -name "*.json"
|
|
232
|
+
find . -path "*/locales/es/*" -name "*.json"
|
|
233
|
+
find . -path "*/locales/fr/*" -name "*.json"
|
|
234
|
+
find . -path "*/locales/ru/*" -name "*.json"
|
|
235
|
+
find . -path "*/locales/ja/*" -name "*.json"
|
|
236
|
+
find . -path "*/locales/zh/*" -name "*.json"
|
|
237
|
+
|
|
238
|
+
# Find UI locale files (toolkit's own translations)
|
|
239
|
+
ls ui-locales/*.json
|
|
240
|
+
|
|
241
|
+
# Search for translation function usage
|
|
242
|
+
grep -r "t(\|\$t(\|i18n\.t(" --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" .
|
|
243
|
+
|
|
244
|
+
# Check for English text in foreign language files
|
|
245
|
+
grep -r "[a-zA-Z]" locales/de/ --include="*.json" | grep -v "\"[a-zA-Z]*\":"
|
|
246
|
+
grep -r "[a-zA-Z]" locales/es/ --include="*.json" | grep -v "\"[a-zA-Z]*\":"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### V1.5.0 Diagnostic Commands
|
|
250
|
+
```bash
|
|
251
|
+
# Run comprehensive translation analysis
|
|
252
|
+
node main/i18ntk-analyze.js
|
|
253
|
+
|
|
254
|
+
# Check for missing console translations
|
|
255
|
+
node dev/debug/console-key-checker.js
|
|
256
|
+
|
|
257
|
+
# Validate all translations
|
|
258
|
+
node main/i18ntk-validate.js
|
|
259
|
+
|
|
260
|
+
# Generate translation usage report
|
|
261
|
+
node main/i18ntk-usage.js
|
|
262
|
+
|
|
263
|
+
# Create summary and sizing reports
|
|
264
|
+
node main/i18ntk-summary.js
|
|
265
|
+
node main/i18ntk-sizing.js
|
|
266
|
+
|
|
267
|
+
# Replace [NOT_TRANSLATED] placeholders
|
|
268
|
+
node utils/native-translations.js
|
|
269
|
+
|
|
270
|
+
# Complete missing translations workflow
|
|
271
|
+
node main/i18ntk-complete.js
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## ๐ Example Translation Process
|
|
275
|
+
|
|
276
|
+
### Before Translation
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"welcome": "[TRANSLATED]Welcome to the application",
|
|
280
|
+
"error": {
|
|
281
|
+
"fileNotFound": "[TRANSLATED]File {{filename}} not found",
|
|
282
|
+
"invalidInput": "[TRANSLATED]Please enter a valid value"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### After Translation (German)
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"welcome": "Willkommen in der Anwendung",
|
|
291
|
+
"error": {
|
|
292
|
+
"fileNotFound": "Datei {{filename}} nicht gefunden",
|
|
293
|
+
"invalidInput": "Bitte geben Sie einen gรผltigen Wert ein"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## ๐ ๏ธ Enhanced Tools and Validation (v1.5.0)
|
|
299
|
+
|
|
300
|
+
### Core Validation Commands
|
|
301
|
+
```bash
|
|
302
|
+
# Validate JSON syntax
|
|
303
|
+
node -e "console.log(JSON.parse(require('fs').readFileSync('path/to/file.json', 'utf8')))"
|
|
304
|
+
|
|
305
|
+
# Check for remaining translation markers
|
|
306
|
+
grep -r "\[NOT_TRANSLATED\]" locales/
|
|
307
|
+
grep -r "\[TRANSLATED\]" locales/
|
|
308
|
+
|
|
309
|
+
# Run comprehensive toolkit validation
|
|
310
|
+
node main/i18ntk-validate.js
|
|
311
|
+
|
|
312
|
+
# Main management interface
|
|
313
|
+
node main/i18ntk-manage.js
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Security and Authentication
|
|
317
|
+
```bash
|
|
318
|
+
# Access admin features (requires PIN)
|
|
319
|
+
node utils/admin-cli.js
|
|
320
|
+
|
|
321
|
+
# Settings management with enhanced security
|
|
322
|
+
node settings/settings-manager.js
|
|
323
|
+
node settings/settings-cli.js
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Advanced Analysis Tools
|
|
327
|
+
```bash
|
|
328
|
+
# Complete workflow automation
|
|
329
|
+
node main/i18ntk-autorun.js
|
|
330
|
+
|
|
331
|
+
# Initialize new i18n projects
|
|
332
|
+
node main/i18ntk-init.js
|
|
333
|
+
|
|
334
|
+
# Debug and development tools
|
|
335
|
+
node dev/debug/console-key-checker.js
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## ๐ Support and Resources (v1.5.0)
|
|
339
|
+
|
|
340
|
+
- **Enhanced Security**: Modern AES-256-GCM encryption with session management
|
|
341
|
+
- **Settings Configuration**: See `settings/settings-manager.js` for advanced configuration options
|
|
342
|
+
- **Admin Authentication**: Enhanced PIN system with `utils/admin-pin.js`
|
|
343
|
+
- **Translation Patterns**: Check `processing.translationPatterns` in settings
|
|
344
|
+
- **Validation**: Use built-in validation tools with comprehensive reporting
|
|
345
|
+
- **Console Translation**: 100% internationalized console output
|
|
346
|
+
- **Documentation**: Comprehensive docs in `docs/` directory
|
|
347
|
+
- **Development Tools**: Advanced debugging utilities in `dev/debug/`
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
**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.
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
โโโ i18n-reports/ # Organized report structure
|
|
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
|
+
โโโ user-config.json # Main configuration
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Testing Requirements
|
|
52
|
+
- **ALWAYS** test scripts after making changes
|
|
53
|
+
- **ALWAYS** run the full workflow: `npm run 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: `npm run 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
|
+
- `npm run i18ntk` - Full workflow validation
|
|
105
|
+
- `node i18ntk-validate.js` - Translation validation
|
|
106
|
+
- `node i18ntk-usage.js` - 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!**
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Development Scripts and Tools
|
|
2
|
+
|
|
3
|
+
This folder contains development scripts, test files, and debugging tools to help maintain and improve the i18nTK toolkit.
|
|
4
|
+
|
|
5
|
+
## ๐ Folder Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
dev/
|
|
9
|
+
โโโ tests/ # Test scripts and test data
|
|
10
|
+
โโโ debug/ # Debugging tools and utilities
|
|
11
|
+
โโโ reports/ # Development reports and analysis
|
|
12
|
+
โโโ scripts/ # Development helper scripts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## ๐งช Test Scripts
|
|
16
|
+
|
|
17
|
+
- **test-complete-system.js** - Complete system integration tests
|
|
18
|
+
- **test-features.js** - Feature-specific tests
|
|
19
|
+
- **test-console-i18n.js** - Console i18n functionality tests
|
|
20
|
+
|
|
21
|
+
## ๐ Debug Tools
|
|
22
|
+
|
|
23
|
+
- **debugger.js** - Main debugging utility for identifying issues
|
|
24
|
+
- **debug-config.js** - Configuration debugging helper
|
|
25
|
+
|
|
26
|
+
## ๐ Reports
|
|
27
|
+
|
|
28
|
+
Development reports are organized by type:
|
|
29
|
+
- **analysis/** - Translation analysis reports
|
|
30
|
+
- **validation/** - Validation reports
|
|
31
|
+
- **usage/** - Usage analysis reports
|
|
32
|
+
- **sizing/** - File sizing reports
|
|
33
|
+
- **summary/** - Summary reports
|
|
34
|
+
|
|
35
|
+
## ๐ง Development Rules
|
|
36
|
+
|
|
37
|
+
See `DEVELOPMENT_RULES.md` for coding standards and best practices.
|