i18ntk 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +410 -20
  3. package/locales/de/common.json +17 -20
  4. package/locales/en/common.json +17 -20
  5. package/locales/es/common.json +17 -20
  6. package/locales/fr/common.json +17 -20
  7. package/locales/ru/common.json +17 -20
  8. package/main/i18ntk-manage.js +52 -24
  9. package/package.json +6 -8
  10. package/{dev → scripts}/debug/README.md +9 -5
  11. package/{dev → scripts}/debug/debugger.js +84 -4
  12. package/scripts/prepublish.js +2 -2
  13. package/scripts/validate-all-translations.js +2 -2
  14. package/ui-locales/de/debug.json +5 -5
  15. package/ui-locales/de/init.json +1 -0
  16. package/ui-locales/de/language.json +11 -2
  17. package/ui-locales/de/security.json +2 -1
  18. package/ui-locales/de/sizing.json +1 -0
  19. package/ui-locales/de/usage.json +1 -0
  20. package/ui-locales/en/debug.json +5 -5
  21. package/ui-locales/en/init.json +1 -0
  22. package/ui-locales/en/language.json +11 -2
  23. package/ui-locales/en/security.json +2 -1
  24. package/ui-locales/en/sizing.json +2 -0
  25. package/ui-locales/en/usage.json +1 -0
  26. package/ui-locales/es/debug.json +5 -5
  27. package/ui-locales/es/init.json +1 -0
  28. package/ui-locales/es/language.json +11 -2
  29. package/ui-locales/es/security.json +2 -1
  30. package/ui-locales/es/sizing.json +2 -0
  31. package/ui-locales/es/usage.json +1 -0
  32. package/ui-locales/fr/debug.json +5 -5
  33. package/ui-locales/fr/init.json +1 -0
  34. package/ui-locales/fr/language.json +11 -2
  35. package/ui-locales/fr/security.json +2 -1
  36. package/ui-locales/fr/sizing.json +2 -0
  37. package/ui-locales/fr/usage.json +1 -0
  38. package/ui-locales/ja/debug.json +5 -5
  39. package/ui-locales/ja/init.json +1 -0
  40. package/ui-locales/ja/language.json +11 -2
  41. package/ui-locales/ja/security.json +2 -1
  42. package/ui-locales/ja/sizing.json +3 -0
  43. package/ui-locales/ja/usage.json +1 -0
  44. package/ui-locales/pt/debug.json +5 -5
  45. package/ui-locales/pt/init.json +1 -0
  46. package/ui-locales/pt/language.json +11 -2
  47. package/ui-locales/pt/security.json +2 -1
  48. package/ui-locales/pt/sizing.json +2 -0
  49. package/ui-locales/pt/usage.json +1 -0
  50. package/ui-locales/ru/debug.json +5 -5
  51. package/ui-locales/ru/init.json +1 -0
  52. package/ui-locales/ru/language.json +11 -2
  53. package/ui-locales/ru/security.json +2 -1
  54. package/ui-locales/ru/sizing.json +2 -0
  55. package/ui-locales/ru/usage.json +1 -0
  56. package/ui-locales/zh/debug.json +5 -5
  57. package/ui-locales/zh/init.json +1 -0
  58. package/ui-locales/zh/language.json +11 -2
  59. package/ui-locales/zh/security.json +2 -1
  60. package/ui-locales/zh/sizing.json +2 -0
  61. package/ui-locales/zh/usage.json +1 -0
  62. package/utils/test-complete-system.js +1 -1
  63. package/dev/README.md +0 -37
  64. package/docs/INSTALLATION.md +0 -98
  65. package/docs/PIN_PROTECTION_GUIDE.md +0 -265
  66. package/docs/README.md +0 -111
  67. package/docs/SCRIPT_DIRECTORY_GUIDE.md +0 -278
  68. package/docs/TODO_ROADMAP.md +0 -279
  69. package/docs/TRANSLATION_STATUS.md +0 -67
  70. package/docs/api/API_REFERENCE.md +0 -258
  71. package/docs/api/COMPONENTS.md +0 -492
  72. package/docs/api/CONFIGURATION.md +0 -676
  73. package/docs/api/NPM_PUBLISHING_GUIDE.md +0 -426
  74. package/docs/debug/DEBUG_README.md +0 -30
  75. package/docs/debug/DEBUG_TOOLS.md +0 -152
  76. package/docs/development/AGENTS.md +0 -349
  77. package/docs/development/DEVELOPMENT_RULES.md +0 -165
  78. package/docs/development/DEV_README.md +0 -41
  79. package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +0 -175
  80. package/docs/release-notes/RELEASE_NOTES_v1.0.4.md +0 -153
  81. package/docs/release-notes/RELEASE_NOTES_v1.1.2.md +0 -68
  82. package/docs/release-notes/RELEASE_NOTES_v1.1.5.md +0 -81
  83. package/docs/release-notes/RELEASE_NOTES_v1.4.0.md +0 -115
  84. package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +0 -141
  85. package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +0 -185
  86. package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +0 -199
  87. package/docs/release-notes/v1.3.0.md +0 -162
  88. package/docs/release-notes/v1.3.1.md +0 -136
  89. package/docs/reports/ANALYSIS_README.md +0 -17
  90. package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +0 -181
  91. package/docs/reports/SIZING_README.md +0 -18
  92. package/docs/reports/SUMMARY_README.md +0 -18
  93. package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +0 -129
  94. package/docs/reports/USAGE_README.md +0 -18
  95. package/docs/reports/VALIDATION_README.md +0 -18
  96. /package/{dev → scripts}/debug/complete-console-translations.js +0 -0
  97. /package/{dev → scripts}/debug/console-key-checker.js +0 -0
  98. /package/{dev → scripts}/debug/console-translations.js +0 -0
  99. /package/{dev → scripts}/debug/debug-security.js +0 -0
  100. /package/{dev → scripts}/debug/debug-translation.js +0 -0
  101. /package/{dev → scripts}/debug/export-missing-keys.js +0 -0
  102. /package/{dev → scripts}/debug/final-normalize.js +0 -0
  103. /package/{dev → scripts}/debug/find-extra-keys.js +0 -0
  104. /package/{dev → scripts}/debug/normalize-locales.js +0 -0
  105. /package/{dev → scripts}/debug/refactor-locales.js +0 -0
  106. /package/{dev → scripts}/debug/reorder-locales.js +0 -0
  107. /package/{dev → scripts}/debug/replace-hardcoded-console.js +0 -0
@@ -1,23 +1,20 @@
1
1
  {
2
- "offlineTitle": "NOT_TRANSLATED",
3
- "offlineMessage": "NOT_TRANSLATED",
4
- "tryReconnect": "NOT_TRANSLATED",
5
- "common": "NOT_TRANSLATED",
6
- "logout": "NOT_TRANSLATED",
7
- "login": "NOT_TRANSLATED",
8
- "amount": "NOT_TRANSLATED",
9
- "timePeriods": {
10
- "customRange": "NOT_TRANSLATED"
2
+ "common": {
3
+ "welcome": "NOT_TRANSLATED",
4
+ "hello": "NOT_TRANSLATED",
5
+ "goodbye": "NOT_TRANSLATED",
6
+ "yes": "NOT_TRANSLATED",
7
+ "no": "NOT_TRANSLATED",
8
+ "save": "NOT_TRANSLATED",
9
+ "cancel": "NOT_TRANSLATED",
10
+ "delete": "NOT_TRANSLATED",
11
+ "edit": "NOT_TRANSLATED",
12
+ "loading": "NOT_TRANSLATED"
11
13
  },
12
- "unknownUser": "NOT_TRANSLATED",
13
- "notSet": "NOT_TRANSLATED",
14
- "announcement_id": "NOT_TRANSLATED",
15
- "last_sign_in_at": "NOT_TRANSLATED",
16
- "usage": {
17
- "analysisResults": "NOT_TRANSLATED",
18
- "availableKeysCount": "NOT_TRANSLATED",
19
- "usedKeysCount": "NOT_TRANSLATED"
20
- },
21
- "success": "Succès",
22
- "error": "Erreur"
14
+ "navigation": {
15
+ "home": "NOT_TRANSLATED",
16
+ "about": "NOT_TRANSLATED",
17
+ "contact": "NOT_TRANSLATED",
18
+ "settings": "NOT_TRANSLATED"
19
+ }
23
20
  }
@@ -1,23 +1,20 @@
1
1
  {
2
- "offlineTitle": "NOT_TRANSLATED",
3
- "offlineMessage": "NOT_TRANSLATED",
4
- "tryReconnect": "NOT_TRANSLATED",
5
- "common": "NOT_TRANSLATED",
6
- "logout": "NOT_TRANSLATED",
7
- "login": "NOT_TRANSLATED",
8
- "amount": "NOT_TRANSLATED",
9
- "timePeriods": {
10
- "customRange": "NOT_TRANSLATED"
2
+ "common": {
3
+ "welcome": "NOT_TRANSLATED",
4
+ "hello": "NOT_TRANSLATED",
5
+ "goodbye": "NOT_TRANSLATED",
6
+ "yes": "NOT_TRANSLATED",
7
+ "no": "NOT_TRANSLATED",
8
+ "save": "NOT_TRANSLATED",
9
+ "cancel": "NOT_TRANSLATED",
10
+ "delete": "NOT_TRANSLATED",
11
+ "edit": "NOT_TRANSLATED",
12
+ "loading": "NOT_TRANSLATED"
11
13
  },
12
- "unknownUser": "NOT_TRANSLATED",
13
- "notSet": "NOT_TRANSLATED",
14
- "announcement_id": "NOT_TRANSLATED",
15
- "last_sign_in_at": "NOT_TRANSLATED",
16
- "usage": {
17
- "analysisResults": "NOT_TRANSLATED",
18
- "availableKeysCount": "NOT_TRANSLATED",
19
- "usedKeysCount": "NOT_TRANSLATED"
20
- },
21
- "success": "Успех",
22
- "error": "Ошибка"
14
+ "navigation": {
15
+ "home": "NOT_TRANSLATED",
16
+ "about": "NOT_TRANSLATED",
17
+ "contact": "NOT_TRANSLATED",
18
+ "settings": "NOT_TRANSLATED"
19
+ }
23
20
  }
@@ -32,7 +32,7 @@ const I18nValidator = require('./i18ntk-validate');
32
32
  const I18nUsageAnalyzer = require('./i18ntk-usage');
33
33
  const I18nSizingAnalyzer = require('./i18ntk-sizing');
34
34
  const SettingsCLI = require('../settings/settings-cli');
35
- const I18nDebugger = require('../dev/debug/debugger');
35
+ const I18nDebugger = require('../scripts/debug/debugger');
36
36
 
37
37
  // Enhanced default configuration with multiple path detection
38
38
  const DEFAULT_CONFIG = {
@@ -473,6 +473,7 @@ class I18nManager {
473
473
  console.log(`10. ${this.ui.t('menu.options.settings')}`);
474
474
  console.log(`11. ${this.ui.t('menu.options.help')}`);
475
475
  console.log(`12. ${this.ui.t('menu.options.debug')}`);
476
+ console.log(`13. ${this.ui.t('menu.options.language')}`);
476
477
  console.log(`0. ${this.ui.t('menu.options.exit')}`);
477
478
  console.log('\n' + this.ui.t('menu.nonInteractiveModeWarning'));
478
479
  console.log(this.ui.t('menu.useDirectExecution'));
@@ -496,6 +497,7 @@ class I18nManager {
496
497
  console.log(`10. ${this.ui.t('menu.options.settings')}`);
497
498
  console.log(`11. ${this.ui.t('menu.options.help')}`);
498
499
  console.log(`12. ${this.ui.t('menu.options.debug')}`);
500
+ console.log(`13. ${this.ui.t('menu.options.language')}`);
499
501
  console.log(`0. ${this.ui.t('menu.options.exit')}`);
500
502
 
501
503
  const choice = await this.prompt('\n' + this.ui.t('menu.selectOptionPrompt'));
@@ -592,6 +594,9 @@ class I18nManager {
592
594
  case '12':
593
595
  await this.showDebugMenu();
594
596
  break;
597
+ case '13':
598
+ await this.showLanguageMenu();
599
+ break;
595
600
  case '0':
596
601
  console.log(this.ui.t('menu.goodbye'));
597
602
  this.safeClose();
@@ -602,6 +607,45 @@ class I18nManager {
602
607
  }
603
608
  }
604
609
 
610
+ // Language Menu
611
+ async showLanguageMenu() {
612
+ console.log(`\n${this.ui.t('language.title')}`);
613
+ console.log(this.ui.t('language.separator'));
614
+ console.log(this.ui.t('language.current', { language: this.ui.getLanguageDisplayName(this.ui.getCurrentLanguage()) }));
615
+ console.log('\n' + this.ui.t('language.available'));
616
+
617
+ this.ui.availableLanguages.forEach((lang, index) => {
618
+ const displayName = this.ui.getLanguageDisplayName(lang);
619
+ const current = lang === this.ui.getCurrentLanguage() ? ' ✓' : '';
620
+ console.log(this.ui.t('language.languageOption', { index: index + 1, displayName, current }));
621
+ });
622
+
623
+ console.log(`0. ${this.ui.t('language.backToMainMenu')}`);
624
+
625
+ const choice = await this.prompt('\n' + this.ui.t('language.prompt'));
626
+ const choiceNum = parseInt(choice);
627
+
628
+ if (choiceNum === 0) {
629
+ await this.showInteractiveMenu();
630
+ return;
631
+ } else if (choiceNum >= 1 && choiceNum <= this.ui.availableLanguages.length) {
632
+ const selectedLang = this.ui.availableLanguages[choiceNum - 1];
633
+ this.ui.changeLanguage(selectedLang);
634
+ console.log(this.ui.t('language.changed', { language: this.ui.getLanguageDisplayName(selectedLang) }));
635
+
636
+ // Refresh the UI with new language
637
+ this.ui.refreshLanguageFromSettings();
638
+
639
+ // Return to main menu with new language
640
+ await this.prompt('\n' + this.ui.t('language.pressEnterToContinue'));
641
+ await this.showInteractiveMenu();
642
+ } else {
643
+ console.log(this.ui.t('language.invalid'));
644
+ await this.prompt('\n' + this.ui.t('language.pressEnterToContinue'));
645
+ await this.showLanguageMenu();
646
+ }
647
+ }
648
+
605
649
  // Debug Tools Menu
606
650
  async showDebugMenu() {
607
651
  // Check for PIN protection
@@ -623,13 +667,9 @@ class I18nManager {
623
667
 
624
668
  console.log(`\n${this.ui.t('debug.title')}`);
625
669
  console.log(this.ui.t('debug.separator'));
626
- console.log(`1. ${this.ui.t('debug.mainDebuggerSystemDiagnostics')}`);
627
- console.log(`2. ${this.ui.t('debug.consoleTranslationsCheck')}`);
628
- console.log(`3. ${this.ui.t('debug.exportMissingKeys')}`);
629
- console.log(`4. ${this.ui.t('debug.replaceHardcodedConsole')}`);
630
- console.log(`5. ${this.ui.t('debug.consoleKeyChecker')}`);
631
- console.log(`6. ${this.ui.t('debug.debugLogs')}`);
632
- console.log(`0. ${this.ui.t('debug.backToMainMenu')}`);
670
+ console.log(this.ui.t('debug.mainDebuggerSystemDiagnostics'));
671
+ console.log(this.ui.t('debug.debugLogs'));
672
+ console.log(this.ui.t('debug.backToMainMenu'));
633
673
 
634
674
  const choice = await this.prompt('\n' + this.ui.t('debug.selectOption'));
635
675
 
@@ -638,18 +678,6 @@ class I18nManager {
638
678
  await this.runDebugTool('debugger.js', 'Main Debugger');
639
679
  break;
640
680
  case '2':
641
- await this.runDebugTool('console-translations.js', 'Console Translations');
642
- break;
643
- case '3':
644
- await this.runDebugTool('export-missing-keys.js', 'Export Missing Keys');
645
- break;
646
- case '4':
647
- await this.runDebugTool('replace-hardcoded-console.js', 'Replace Hardcoded Console');
648
- break;
649
- case '5':
650
- await this.runDebugTool('console-key-checker.js', 'Console Key Checker');
651
- break;
652
- case '6':
653
681
  await this.viewDebugLogs();
654
682
  break;
655
683
  case '0':
@@ -665,7 +693,7 @@ class I18nManager {
665
693
  async runDebugTool(toolName, displayName) {
666
694
  console.log(this.ui.t('debug.runningDebugTool', { displayName }));
667
695
  try {
668
- const toolPath = path.join(__dirname, '..', 'dev', 'debug', toolName);
696
+ const toolPath = path.join(__dirname, '..', 'scripts', 'debug', toolName);
669
697
  if (fs.existsSync(toolPath)) {
670
698
  const { execSync } = require('child_process');
671
699
  const output = execSync(`node "${toolPath}"`, {
@@ -691,7 +719,7 @@ class I18nManager {
691
719
  console.log('============================================================');
692
720
 
693
721
  try {
694
- const logsDir = path.join(__dirname, '..', 'dev', 'debug', 'logs');
722
+ const logsDir = path.join(__dirname, '..', 'scripts', 'debug', 'logs');
695
723
  if (fs.existsSync(logsDir)) {
696
724
  const files = fs.readdirSync(logsDir)
697
725
  .filter(file => file.endsWith('.log') || file.endsWith('.txt'))
@@ -758,8 +786,8 @@ class I18nManager {
758
786
  const targetDirs = [
759
787
  { path: path.join(process.cwd(), 'i18ntk-reports'), name: 'Reports', type: 'reports' },
760
788
  { path: path.join(process.cwd(), 'reports'), name: 'Legacy Reports', type: 'reports' },
761
- { path: path.join(process.cwd(), 'dev', 'debug', 'logs'), name: 'Debug Logs', type: 'logs' },
762
- { path: path.join(process.cwd(), 'dev', 'debug', 'reports'), name: 'Debug Reports', type: 'reports' },
789
+ { path: path.join(process.cwd(), 'scripts', 'debug', 'logs'), name: 'Debug Logs', type: 'logs' },
790
+ { path: path.join(process.cwd(), 'scripts', 'debug', 'reports'), name: 'Debug Reports', type: 'reports' },
763
791
  { path: path.join(process.cwd(), 'settings', 'backups'), name: 'Backups', type: 'backups' }
764
792
  ];
765
793
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18ntk",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "i18ntk (i18n Toolkit) - A comprehensive, enterprise-grade internationalization (i18n) management toolkit for JavaScript/TypeScript projects with advanced analysis, validation, and automation features",
5
5
  "keywords": [
6
6
  "i18n",
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/sponsors/vladnoskv"
38
38
  },
39
39
  "license": "MIT",
40
- "author": "Vladimir Noskov <vladnoskv@gmail.com> (https://github.com/vladnoskv)",
40
+ "author": "Vladimir Noskov <vladno@hotmail.co.uk> (https://github.com/vladnoskv)",
41
41
  "type": "commonjs",
42
42
  "main": "main/i18ntk-manage.js",
43
43
  "bin": {
@@ -50,8 +50,7 @@
50
50
  "i18ntk-complete": "main/i18ntk-complete.js",
51
51
  "i18ntk-sizing": "main/i18ntk-sizing.js",
52
52
  "i18ntk-summary": "main/i18ntk-summary.js",
53
- "i18ntk-autorun": "main/i18ntk-autorun.js",
54
- "i18ntk-debug": "dev/debug/debugger.js"
53
+ "i18ntk-autorun": "main/i18ntk-autorun.js"
55
54
  },
56
55
  "directories": {
57
56
  "doc": "docs"
@@ -64,7 +63,6 @@
64
63
  "settings/",
65
64
  "ui-locales/",
66
65
  "locales/",
67
- "docs/",
68
66
  "README.md",
69
67
  "CHANGELOG.md",
70
68
  "LICENSE"
@@ -125,9 +123,9 @@
125
123
  },
126
124
  "preferGlobal": true,
127
125
  "versionInfo": {
128
- "version": "1.4.0",
129
- "releaseDate": "04/08/2025",
130
- "lastUpdated": "04/08/2025",
126
+ "version": "1.4.2",
127
+ "releaseDate": "08/08/2025",
128
+ "lastUpdated": "08/08/2025",
131
129
  "maintainer": "Vladimir Noskov",
132
130
  "changelog": "./CHANGELOG.md",
133
131
  "documentation": "./README.md",
@@ -13,18 +13,22 @@ This folder contains debugging tools and utilities for the i18nTK project.
13
13
 
14
14
  ```bash
15
15
  # Run main debugger
16
- node dev/debug/debugger.js
16
+ node scripts/debug/debugger.js
17
17
 
18
18
  # Validate configuration
19
- node dev/debug/config-validator.js
19
+ node scripts/debug/config-validator.js
20
20
 
21
21
  # Debug translations
22
- node dev/debug/translation-debugger.js
22
+ node scripts/debug/translation-debugger.js
23
23
 
24
24
  # Profile performance
25
- node dev/debug/performance-profiler.js
25
+ node scripts/debug/performance-profiler.js
26
26
  ```
27
27
 
28
28
  ## Debug Output
29
29
 
30
- Debug logs and reports are saved to `dev/debug/logs/` with timestamps.
30
+ Debug logs and reports are saved to `scripts/debug/logs/` with timestamps.
31
+
32
+ ## Version 1.4.2 Update
33
+
34
+ **Critical Bug Fix**: These debug tools were moved from `/dev/debug/` to `/scripts/debug/` in v1.4.2 to resolve MODULE_NOT_FOUND errors when using `npx i18ntk`.
@@ -13,8 +13,16 @@ const SecurityUtils = require('../../utils/security');
13
13
  class I18nDebugger {
14
14
  constructor(projectRoot = null) {
15
15
  // Validate and sanitize project root path
16
- const defaultRoot = path.resolve(__dirname, '../..');
17
- const validatedRoot = SecurityUtils.validatePath(projectRoot || defaultRoot, process.cwd());
16
+ let defaultRoot;
17
+
18
+ if (projectRoot) {
19
+ defaultRoot = projectRoot;
20
+ } else {
21
+ // Find the actual project root by walking up from current directory
22
+ defaultRoot = this.findProjectRoot();
23
+ }
24
+
25
+ const validatedRoot = SecurityUtils.validatePath(defaultRoot, process.cwd());
18
26
  if (!validatedRoot) {
19
27
  throw new Error('Invalid project root path provided');
20
28
  }
@@ -38,6 +46,53 @@ class I18nDebugger {
38
46
  fs.appendFileSync(this.logFile, logMessage + '\n');
39
47
  }
40
48
 
49
+ findProjectRoot() {
50
+ // Start from the current working directory and walk up to find project root
51
+ let currentDir = process.cwd();
52
+
53
+ // First, check if we're running from within node_modules/i18ntk
54
+ const nodeModulesPattern = /[\/\\]node_modules[\/\\]i18ntk/;
55
+ if (nodeModulesPattern.test(currentDir)) {
56
+ // We're running from the i18ntk package, find the actual project root
57
+ let projectDir = currentDir;
58
+ while (projectDir !== path.dirname(projectDir)) {
59
+ if (fs.existsSync(path.join(projectDir, 'package.json')) &&
60
+ !projectDir.includes('node_modules')) {
61
+ return projectDir;
62
+ }
63
+ projectDir = path.dirname(projectDir);
64
+ }
65
+ }
66
+
67
+ // Walk up the directory tree to find package.json
68
+ while (currentDir !== path.dirname(currentDir)) {
69
+ const packageJsonPath = path.join(currentDir, 'package.json');
70
+
71
+ if (fs.existsSync(packageJsonPath)) {
72
+ try {
73
+ const packageContent = fs.readFileSync(packageJsonPath, 'utf8');
74
+ const packageData = JSON.parse(packageContent);
75
+
76
+ // Skip if this is the i18ntk package itself
77
+ if (packageData.name === 'i18ntk' && currentDir.includes('node_modules')) {
78
+ currentDir = path.dirname(currentDir);
79
+ continue;
80
+ }
81
+
82
+ // Found a valid project package.json
83
+ return currentDir;
84
+ } catch (error) {
85
+ // Invalid package.json, continue searching
86
+ }
87
+ }
88
+
89
+ currentDir = path.dirname(currentDir);
90
+ }
91
+
92
+ // Fallback to the original behavior if no project root found
93
+ return path.resolve(__dirname, '../..');
94
+ }
95
+
41
96
  addIssue(issue) {
42
97
  this.issues.push(issue);
43
98
  this.log(`ISSUE: ${issue}`, 'ERROR');
@@ -287,10 +342,33 @@ class I18nDebugger {
287
342
  const packageJson = JSON.parse(fs.readFileSync(path.resolve(this.projectRoot, 'package.json'), 'utf8'));
288
343
  const dependencies = { ...packageJson.dependencies, ...packageJson.devDependencies };
289
344
 
290
- // Check if node_modules exists
345
+ // Check if node_modules exists in project root
291
346
  const nodeModulesPath = path.resolve(this.projectRoot, 'node_modules');
292
347
  if (!fs.existsSync(nodeModulesPath)) {
293
- this.addWarning('node_modules directory not found. Run npm install.');
348
+ // Also check parent directories for node_modules (monorepo support)
349
+ let currentDir = this.projectRoot;
350
+ let foundNodeModules = false;
351
+
352
+ while (currentDir !== path.dirname(currentDir)) {
353
+ const parentNodeModules = path.join(currentDir, 'node_modules');
354
+ if (fs.existsSync(parentNodeModules)) {
355
+ this.log(`Found node_modules in: ${parentNodeModules}`);
356
+ foundNodeModules = true;
357
+ break;
358
+ }
359
+ currentDir = path.dirname(currentDir);
360
+ }
361
+
362
+ if (!foundNodeModules) {
363
+ const depCount = Object.keys(dependencies).length;
364
+ if (depCount > 0) {
365
+ this.addWarning(`node_modules directory not found in project or parent directories. Run 'npm install' in ${this.projectRoot}`);
366
+ } else {
367
+ this.log('No dependencies found in package.json');
368
+ }
369
+ }
370
+ } else {
371
+ this.log(`Found node_modules in: ${nodeModulesPath}`);
294
372
  }
295
373
 
296
374
  this.log(`Found ${Object.keys(dependencies).length} dependencies`);
@@ -357,6 +435,8 @@ class I18nDebugger {
357
435
  async run() {
358
436
  this.log('Starting i18nTK Debug Analysis...');
359
437
  this.log(`Project Root: ${this.projectRoot}`);
438
+ this.log(`Working Directory: ${process.cwd()}`);
439
+ this.log(`Debug Tool Directory: ${__dirname}`);
360
440
 
361
441
  SecurityUtils.logSecurityEvent('Debug analysis started', 'info', { projectRoot: this.projectRoot });
362
442
 
@@ -13,8 +13,8 @@ class PrepublishCleaner {
13
13
  constructor() {
14
14
  this.projectRoot = path.join(__dirname, '..');
15
15
  this.directories = [
16
- 'dev/debug/logs',
17
- 'dev/debug/reports',
16
+ 'scripts/debug/logs',
17
+ 'scripts/debug/reports',
18
18
  'settings/backups',
19
19
  'i18ntk-reports',
20
20
  'reports'
@@ -69,8 +69,8 @@ class TranslationValidator {
69
69
  console.log('\n🔧 Validating Debug Tools...');
70
70
 
71
71
  const debugTools = [
72
- 'dev/debug/debugger.js',
73
- 'dev/debug/language-debug.js'
72
+ 'scripts/debug/debugger.js',
73
+ 'scripts/debug/language-debug.js'
74
74
  ];
75
75
 
76
76
  for (const tool of debugTools) {
@@ -2,11 +2,11 @@
2
2
  "title": "🔧 Debug-Tools",
3
3
  "separator": "============================================================",
4
4
  "mainDebuggerSystemDiagnostics": "1. Systemdiagnose",
5
- "consoleTranslationsCheck": "2. Konsolenübersetzungsprüfung",
6
- "exportMissingKeys": "3. Fehlende Übersetzungsschlüssel exportieren",
7
- "replaceHardcodedConsole": "4. Hartcodierte Konsolenzeichenketten ersetzen",
8
- "consoleKeyChecker": "5. Konsolenschlüsselprüfer",
9
- "debugLogs": "6. Debug-Protokolle",
5
+ "_consoleTranslationsCheck": "// 2. Konsolenübersetzungsprüfung",
6
+ "_exportMissingKeys": "// 3. Fehlende Übersetzungsschlüssel exportieren",
7
+ "_replaceHardcodedConsole": "// 4. Hartcodierte Konsolenzeichenketten ersetzen",
8
+ "_consoleKeyChecker": "// 5. Konsolenschlüsselprüfer",
9
+ "debugLogs": "2. Debug-Protokolle",
10
10
  "backToMainMenu": "0. Zurück zum Hauptmenü",
11
11
  "selectOption": "Wählen Sie ein Debug-Tool: ",
12
12
  "runningDebugTool": "Führe {displayName} aus...",
@@ -8,6 +8,7 @@
8
8
  "autoDetectedI18nDirectory": "📂 Automatisch erkanntes i18n-Verzeichnis: {directory}",
9
9
  "initializingProject": "⚙️ Projektkonfiguration wird initialisiert...",
10
10
  "languageSelectionTitle": "🌐 Sprachkonfiguration",
11
+ "createdSampleTranslationFile": "✅ Beispieleübersetzungsdatei erstellt: {file}",
11
12
  "available": "Verfügbar",
12
13
  "defaultLanguages": "📝 Standardsprachen: {languages}",
13
14
  "enterLanguageCodes": "🎯 Geben Sie Zielsprachcodes ein (kommagetrennt, z.B. de, es, fr, ru):",
@@ -1,4 +1,13 @@
1
1
  {
2
- "available": "Verfügbare Sprachen",
3
- "changeTitle": "Sprache ändern"
2
+ "title": "🌍 Sprache ändern",
3
+ "separator": "============================================================",
4
+ "current": "Aktuelle Sprache: {language}",
5
+ "available": "Verfügbare Sprachen:",
6
+ "languageOption": "{index}. {displayName}{current}",
7
+ "backToMainMenu": "Zurück zum Hauptmenü",
8
+ "prompt": "Wählen Sie eine Sprache (0-8):",
9
+ "cancelled": "Sprachänderung abgebrochen.",
10
+ "invalid": "Ungültige Auswahl. Bitte versuchen Sie es erneut.",
11
+ "changed": "Sprache geändert zu: {language}",
12
+ "pressEnterToContinue": "Drücken Sie Enter zum Fortfahren..."
4
13
  }
@@ -21,5 +21,6 @@
21
21
  "unknownCommandArg": "Unbekanntes Befehlsargument",
22
22
  "logMessage": "[SICHERHEIT {level}] {timestamp}: {event}",
23
23
  "alertMessage": "[SICHERHEITSALARM] {timestamp}: {event}",
24
- "securityWarning": "[SICHERHEITSWARNUNG] {timestamp}: {event}"
24
+ "securityWarning": "[SICHERHEITSWARNUNG] {timestamp}: {event}",
25
+ "json_parse_error": "Sicherheit: JSON-Parsing-Fehler: {errorMessage}"
25
26
  }
@@ -12,6 +12,7 @@
12
12
  "analyzing_file_sizes": "Analysiere Dateigrößen...",
13
13
  "analyzing_translation_content": "Analysiere Übersetzungsinhalt...",
14
14
  "generating_size_comparisons": "Generiere Größenvergleiche...",
15
+ "problematic_keys": "Problematische Schlüssel:",
15
16
  "problematicKeysLabel": "Problematische Schlüssel: {{problematicKeys}}",
16
17
  "no_languages_found_for_comparison": "Keine Sprachen für Vergleich gefunden",
17
18
  "sizing_analysis_results": "I18n Größenanalyse Ergebnisse",
@@ -20,6 +20,7 @@
20
20
  "detectedI18nDirectory": "Erkanntes I18n-Verzeichnis: {{i18nDir}}",
21
21
  "fileInfo": " 📄 {namespace}: {keys} Schlüssel",
22
22
  "failedToAnalyzeUsage": "❌ Nutzungsanalyse fehlgeschlagen: {error}",
23
+ "failedToAnalyzeFile": "❌ Dateianalysem fehlgeschlagen: {error}",
23
24
  "analyzerInitialized": "Analysator initialisiert",
24
25
  "analyzerInitFailed": "Analysator-Initialisierung fehlgeschlagen: {error}",
25
26
  "argsParsed": "Argumente geparst",
@@ -2,11 +2,11 @@
2
2
  "title": "🔧 Debug Tools",
3
3
  "separator": "============================================================",
4
4
  "mainDebuggerSystemDiagnostics": "1. System Diagnostics",
5
- "consoleTranslationsCheck": "2. Console Translations Check",
6
- "exportMissingKeys": "3. Export Missing Translation Keys",
7
- "replaceHardcodedConsole": "4. Replace Hardcoded Console Strings",
8
- "consoleKeyChecker": "5. Console Key Checker",
9
- "debugLogs": "6. Debug Logs",
5
+ "_consoleTranslationsCheck": "// 2. Console Translations Check",
6
+ "_exportMissingKeys": "// 3. Export Missing Translation Keys",
7
+ "_replaceHardcodedConsole": "// 4. Replace Hardcoded Console Strings",
8
+ "_consoleKeyChecker": "// 5. Console Key Checker",
9
+ "debugLogs": "2. Debug Logs",
10
10
  "backToMainMenu": "0. Back to Main Menu",
11
11
  "selectOption": "Select a debug tool: ",
12
12
  "runningDebugTool": "Running {displayName}...",
@@ -8,6 +8,7 @@
8
8
  "useExistingDirectoryPrompt": "Do you want to use the existing directory? (y/n)",
9
9
  "autoDetectedI18nDirectory": "📂 Auto-detected i18n directory: {directory}",
10
10
  "initializingProject": "⚙️ Initializing project configuration...",
11
+ "createdSampleTranslationFile": "✅ Created sample translation file: {file}",
11
12
  "languageSelectionTitle": "🌐 Language Configuration",
12
13
  "available": "Available",
13
14
  "defaultLanguages": "📝 Default languages: {languages}",
@@ -1,4 +1,13 @@
1
1
  {
2
- "available": "Available Languages",
3
- "changeTitle": "Change Language"
2
+ "title": "🌍 Change Language",
3
+ "separator": "============================================================",
4
+ "current": "Current language: {language}",
5
+ "available": "Available Languages:",
6
+ "languageOption": "{index}. {displayName}{current}",
7
+ "backToMainMenu": "Back to Main Menu",
8
+ "prompt": "Select a language (0-8):",
9
+ "cancelled": "Language change cancelled.",
10
+ "invalid": "Invalid choice. Please try again.",
11
+ "changed": "Language changed to: {language}",
12
+ "pressEnterToContinue": "Press Enter to continue..."
4
13
  }
@@ -21,5 +21,6 @@
21
21
  "unknownCommandArg": "Unknown command argument",
22
22
  "logMessage": "[SECURITY {level}] {timestamp}: {event}",
23
23
  "alertMessage": "[SECURITY ALERT] {timestamp}: {event}",
24
- "securityWarning": "[SECURITY WARNING] {timestamp}: {event}"
24
+ "securityWarning": "[SECURITY WARNING] {timestamp}: {event}",
25
+ "json_parse_error": "Security: JSON parse error: {errorMessage}"
25
26
  }
@@ -9,7 +9,9 @@
9
9
  "sourceDirectoryNotFoundError": "Source directory not found: {{sourceDir}}",
10
10
  "invalidOutputDirectoryError": "Invalid output directory path: {{outputDir}}",
11
11
  "invalidReportFileError": "Invalid report file path",
12
+ "problematic_keys": "Problematic keys: {{problematicKeys}}",
12
13
  "problematicKeysLabel": "Problematic keys: {{problematicKeys}}",
14
+ "long_translations": "Long translations: {{longTranslations}}",
13
15
  "failedToSaveReportError": "Failed to save report securely",
14
16
  "invalidCsvFileError": "Invalid CSV file path",
15
17
  "failedToSaveCsvError": "Failed to save CSV report securely",
@@ -20,6 +20,7 @@
20
20
  "detectedI18nDirectory": "Detected i18n directory: {{i18nDir}}",
21
21
  "fileInfo": " 📄 {namespace}: {keys} keys",
22
22
  "failedToAnalyzeUsage": "❌ Failed to analyze usage: {error}",
23
+ "failedToAnalyzeFile": "❌ Failed to analyze file: {error}",
23
24
  "analyzerInitialized": "Analyzer initialized",
24
25
  "analyzerInitFailed": "Analyzer initialization failed: {error}",
25
26
  "argsParsed": "Arguments parsed",
@@ -2,11 +2,11 @@
2
2
  "title": "🔧 Herramientas de Depuración",
3
3
  "separator": "============================================================",
4
4
  "mainDebuggerSystemDiagnostics": "1. Diagnósticos del Sistema",
5
- "consoleTranslationsCheck": "2. Verificación de Traducciones de Consola",
6
- "exportMissingKeys": "3. Exportar Claves de Traducción Faltantes",
7
- "replaceHardcodedConsole": "4. Reemplazar Cadenas de Consola Codificadas",
8
- "consoleKeyChecker": "5. Verificador de Claves de Consola",
9
- "debugLogs": "6. Registros de Depuración",
5
+ "_consoleTranslationsCheck": "// 2. Verificación de Traducciones de Consola",
6
+ "_exportMissingKeys": "// 3. Exportar Claves de Traducción Faltantes",
7
+ "_replaceHardcodedConsole": "// 4. Reemplazar Cadenas de Consola Codificadas",
8
+ "_consoleKeyChecker": "// 5. Verificador de Claves de Consola",
9
+ "debugLogs": "2. Registros de Depuración",
10
10
  "backToMainMenu": "0. Volver al Menú Principal",
11
11
  "selectOption": "Seleccione una herramienta de depuración: ",
12
12
  "runningDebugTool": "Ejecutando {displayName}...",
@@ -8,6 +8,7 @@
8
8
  "autoDetectedI18nDirectory": "📂 Directorio i18n detectado automáticamente: {directory}",
9
9
  "initializingProject": "⚙️ Inicializando configuración del proyecto...",
10
10
  "languageSelectionTitle": "🌐 Configuración de Idioma",
11
+ "createdSampleTranslationFile": "✅ Archivo de traducción de ejemplo creado: {file}",
11
12
  "available": "Disponible",
12
13
  "defaultLanguages": "📝 Idiomas predeterminados: {languages}",
13
14
  "enterLanguageCodes": "🎯 Ingresa códigos de idioma objetivo (separados por comas, ej. de, es, fr, ru):",
@@ -1,4 +1,13 @@
1
1
  {
2
- "available": "Idiomas Disponibles",
3
- "changeTitle": "Cambiar Idioma"
2
+ "title": "🌍 Cambiar Idioma",
3
+ "separator": "============================================================",
4
+ "current": "Idioma actual: {language}",
5
+ "available": "Idiomas disponibles:",
6
+ "languageOption": "{index}. {displayName}{current}",
7
+ "backToMainMenu": "Volver al Menú Principal",
8
+ "prompt": "Seleccione un idioma (0-8):",
9
+ "cancelled": "Cambio de idioma cancelado.",
10
+ "invalid": "Opción inválida. Por favor, inténtelo de nuevo.",
11
+ "changed": "Idioma cambiado a: {language}",
12
+ "pressEnterToContinue": "Presione Enter para continuar..."
4
13
  }