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.
Files changed (86) hide show
  1. package/CHANGELOG.md +401 -0
  2. package/LICENSE +21 -0
  3. package/README.md +507 -0
  4. package/dev/README.md +37 -0
  5. package/dev/debug/README.md +30 -0
  6. package/dev/debug/complete-console-translations.js +295 -0
  7. package/dev/debug/console-key-checker.js +408 -0
  8. package/dev/debug/console-translations.js +335 -0
  9. package/dev/debug/debugger.js +408 -0
  10. package/dev/debug/export-missing-keys.js +432 -0
  11. package/dev/debug/final-normalize.js +236 -0
  12. package/dev/debug/find-extra-keys.js +68 -0
  13. package/dev/debug/normalize-locales.js +153 -0
  14. package/dev/debug/refactor-locales.js +240 -0
  15. package/dev/debug/reorder-locales.js +85 -0
  16. package/dev/debug/replace-hardcoded-console.js +378 -0
  17. package/docs/INSTALLATION.md +449 -0
  18. package/docs/README.md +222 -0
  19. package/docs/TODO_ROADMAP.md +279 -0
  20. package/docs/api/API_REFERENCE.md +377 -0
  21. package/docs/api/COMPONENTS.md +492 -0
  22. package/docs/api/CONFIGURATION.md +651 -0
  23. package/docs/api/NPM_PUBLISHING_GUIDE.md +434 -0
  24. package/docs/debug/DEBUG_README.md +30 -0
  25. package/docs/debug/DEBUG_TOOLS.md +494 -0
  26. package/docs/development/AGENTS.md +351 -0
  27. package/docs/development/DEVELOPMENT_RULES.md +165 -0
  28. package/docs/development/DEV_README.md +37 -0
  29. package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +173 -0
  30. package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +141 -0
  31. package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +185 -0
  32. package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +199 -0
  33. package/docs/reports/ANALYSIS_README.md +17 -0
  34. package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +181 -0
  35. package/docs/reports/SIZING_README.md +18 -0
  36. package/docs/reports/SUMMARY_README.md +18 -0
  37. package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +129 -0
  38. package/docs/reports/USAGE_README.md +18 -0
  39. package/docs/reports/VALIDATION_README.md +18 -0
  40. package/locales/de/auth.json +3 -0
  41. package/locales/de/common.json +16 -0
  42. package/locales/de/pagination.json +6 -0
  43. package/locales/en/auth.json +3 -0
  44. package/locales/en/common.json +16 -0
  45. package/locales/en/pagination.json +6 -0
  46. package/locales/es/auth.json +3 -0
  47. package/locales/es/common.json +16 -0
  48. package/locales/es/pagination.json +6 -0
  49. package/locales/fr/auth.json +3 -0
  50. package/locales/fr/common.json +16 -0
  51. package/locales/fr/pagination.json +6 -0
  52. package/locales/ru/auth.json +3 -0
  53. package/locales/ru/common.json +16 -0
  54. package/locales/ru/pagination.json +6 -0
  55. package/main/i18ntk-analyze.js +625 -0
  56. package/main/i18ntk-autorun.js +461 -0
  57. package/main/i18ntk-complete.js +494 -0
  58. package/main/i18ntk-init.js +686 -0
  59. package/main/i18ntk-manage.js +848 -0
  60. package/main/i18ntk-sizing.js +557 -0
  61. package/main/i18ntk-summary.js +671 -0
  62. package/main/i18ntk-usage.js +1282 -0
  63. package/main/i18ntk-validate.js +762 -0
  64. package/main/ui-i18n.js +332 -0
  65. package/package.json +152 -0
  66. package/scripts/fix-missing-translation-keys.js +214 -0
  67. package/scripts/verify-package.js +168 -0
  68. package/ui-locales/de.json +637 -0
  69. package/ui-locales/en.json +688 -0
  70. package/ui-locales/es.json +637 -0
  71. package/ui-locales/fr.json +637 -0
  72. package/ui-locales/ja.json +637 -0
  73. package/ui-locales/ru.json +637 -0
  74. package/ui-locales/zh.json +637 -0
  75. package/utils/admin-auth.js +317 -0
  76. package/utils/admin-cli.js +353 -0
  77. package/utils/admin-pin.js +409 -0
  78. package/utils/detect-language-mismatches.js +454 -0
  79. package/utils/i18n-helper.js +128 -0
  80. package/utils/maintain-language-purity.js +433 -0
  81. package/utils/native-translations.js +478 -0
  82. package/utils/security.js +384 -0
  83. package/utils/test-complete-system.js +356 -0
  84. package/utils/test-console-i18n.js +402 -0
  85. package/utils/translate-mismatches.js +571 -0
  86. 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.