i18ntk 1.10.2 → 2.0.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/LICENSE +1 -1
- package/README.md +141 -1191
- package/main/i18ntk-analyze.js +65 -84
- package/main/i18ntk-backup-class.js +420 -0
- package/main/i18ntk-backup.js +3 -3
- package/main/i18ntk-complete.js +90 -65
- package/main/i18ntk-doctor.js +123 -103
- package/main/i18ntk-fixer.js +61 -725
- package/main/i18ntk-go.js +14 -15
- package/main/i18ntk-init.js +77 -26
- package/main/i18ntk-java.js +27 -32
- package/main/i18ntk-js.js +70 -68
- package/main/i18ntk-manage.js +129 -30
- package/main/i18ntk-php.js +75 -75
- package/main/i18ntk-py.js +55 -56
- package/main/i18ntk-scanner.js +59 -57
- package/main/i18ntk-setup.js +9 -404
- package/main/i18ntk-sizing.js +6 -6
- package/main/i18ntk-summary.js +21 -18
- package/main/i18ntk-ui.js +11 -10
- package/main/i18ntk-usage.js +54 -18
- package/main/i18ntk-validate.js +13 -13
- package/main/manage/commands/AnalyzeCommand.js +1124 -0
- package/main/manage/commands/BackupCommand.js +62 -0
- package/main/manage/commands/CommandRouter.js +295 -0
- package/main/manage/commands/CompleteCommand.js +61 -0
- package/main/manage/commands/DoctorCommand.js +60 -0
- package/main/manage/commands/FixerCommand.js +624 -0
- package/main/manage/commands/InitCommand.js +62 -0
- package/main/manage/commands/ScannerCommand.js +654 -0
- package/main/manage/commands/SizingCommand.js +60 -0
- package/main/manage/commands/SummaryCommand.js +61 -0
- package/main/manage/commands/UsageCommand.js +60 -0
- package/main/manage/commands/ValidateCommand.js +978 -0
- package/main/manage/index-fixed.js +1447 -0
- package/main/manage/index.js +1462 -0
- package/main/manage/managers/DebugMenu.js +140 -0
- package/main/manage/managers/InteractiveMenu.js +177 -0
- package/main/manage/managers/LanguageMenu.js +62 -0
- package/main/manage/managers/SettingsMenu.js +53 -0
- package/main/manage/services/AuthenticationService.js +263 -0
- package/main/manage/services/ConfigurationService-fixed.js +449 -0
- package/main/manage/services/ConfigurationService.js +449 -0
- package/main/manage/services/FileManagementService.js +368 -0
- package/main/manage/services/FrameworkDetectionService.js +458 -0
- package/main/manage/services/InitService.js +1051 -0
- package/main/manage/services/SetupService.js +462 -0
- package/main/manage/services/SummaryService.js +450 -0
- package/main/manage/services/UsageService.js +1502 -0
- package/package.json +32 -29
- package/runtime/enhanced.d.ts +221 -221
- package/runtime/index.d.ts +29 -29
- package/runtime/index.full.d.ts +331 -331
- package/runtime/index.js +7 -6
- package/scripts/build-lite.js +17 -17
- package/scripts/deprecate-versions.js +23 -6
- package/scripts/export-translations.js +5 -5
- package/scripts/fix-all-i18n.js +3 -3
- package/scripts/fix-and-purify-i18n.js +3 -2
- package/scripts/fix-locale-control-chars.js +110 -0
- package/scripts/lint-locales.js +80 -0
- package/scripts/locale-optimizer.js +8 -8
- package/scripts/prepublish.js +21 -21
- package/scripts/security-check.js +117 -117
- package/scripts/sync-translations.js +4 -4
- package/scripts/sync-ui-locales.js +9 -8
- package/scripts/validate-all-translations.js +8 -7
- package/scripts/verify-deprecations.js +157 -161
- package/scripts/verify-translations.js +6 -5
- package/settings/i18ntk-config.json +282 -282
- package/settings/language-config.json +5 -5
- package/settings/settings-cli.js +9 -9
- package/settings/settings-manager.js +18 -18
- package/ui-locales/de.json +2417 -2348
- package/ui-locales/en.json +2415 -2352
- package/ui-locales/es.json +2425 -2353
- package/ui-locales/fr.json +2418 -2348
- package/ui-locales/ja.json +2463 -2361
- package/ui-locales/ru.json +2463 -2359
- package/ui-locales/zh.json +2418 -2351
- package/utils/admin-auth.js +2 -2
- package/utils/admin-cli.js +297 -297
- package/utils/admin-pin.js +9 -9
- package/utils/cli-helper.js +9 -9
- package/utils/config-helper.js +73 -104
- package/utils/config-manager.js +204 -171
- package/utils/config.js +5 -4
- package/utils/env-manager.js +249 -263
- package/utils/framework-detector.js +27 -24
- package/utils/i18n-helper.js +85 -41
- package/utils/init-helper.js +152 -94
- package/utils/json-output.js +98 -98
- package/utils/mini-commander.js +179 -0
- package/utils/missing-key-validator.js +5 -5
- package/utils/plugin-loader.js +40 -29
- package/utils/prompt.js +14 -44
- package/utils/safe-json.js +40 -0
- package/utils/secure-errors.js +3 -3
- package/utils/security-check-improved.js +390 -0
- package/utils/security-config.js +5 -5
- package/utils/security-fixed.js +607 -0
- package/utils/security.js +652 -602
- package/utils/setup-enforcer.js +136 -44
- package/utils/setup-validator.js +33 -32
- package/utils/ultra-performance-optimizer.js +11 -9
- package/utils/watch-locales.js +2 -1
- package/utils/prompt-fixed.js +0 -55
- package/utils/security-check.js +0 -454
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* I18NTK SIZING COMMAND
|
|
5
|
+
*
|
|
6
|
+
* Handles translation sizing analysis functionality.
|
|
7
|
+
*/
|
|
8
|
+
class SizingCommand {
|
|
9
|
+
constructor(config = {}, ui = null) {
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.ui = ui;
|
|
12
|
+
this.prompt = null;
|
|
13
|
+
this.isNonInteractiveMode = false;
|
|
14
|
+
this.safeClose = null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set runtime dependencies for interactive operations
|
|
19
|
+
*/
|
|
20
|
+
setRuntimeDependencies(prompt, isNonInteractiveMode, safeClose) {
|
|
21
|
+
this.prompt = prompt;
|
|
22
|
+
this.isNonInteractiveMode = isNonInteractiveMode;
|
|
23
|
+
this.safeClose = safeClose;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Execute the sizing command
|
|
28
|
+
*/
|
|
29
|
+
async execute(options = {}) {
|
|
30
|
+
try {
|
|
31
|
+
const I18nSizingAnalyzer = require('../../i18ntk-sizing');
|
|
32
|
+
const sizingAnalyzer = new I18nSizingAnalyzer();
|
|
33
|
+
await sizingAnalyzer.run(options);
|
|
34
|
+
return { success: true, command: 'sizing' };
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`Sizing command failed: ${error.message}`);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get command metadata
|
|
43
|
+
*/
|
|
44
|
+
getMetadata() {
|
|
45
|
+
return {
|
|
46
|
+
name: 'sizing',
|
|
47
|
+
description: 'Analyze translation file sizes and content metrics',
|
|
48
|
+
category: 'analysis',
|
|
49
|
+
aliases: [],
|
|
50
|
+
usage: 'sizing [options]',
|
|
51
|
+
examples: [
|
|
52
|
+
'sizing',
|
|
53
|
+
'sizing --source-dir=./src/locales',
|
|
54
|
+
'sizing --output-dir=./reports'
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = SizingCommand;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* I18NTK SUMMARY COMMAND
|
|
5
|
+
*
|
|
6
|
+
* Handles summary and status reporting functionality.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
class SummaryCommand {
|
|
10
|
+
constructor(config = {}, ui = null) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
this.ui = ui;
|
|
13
|
+
this.prompt = null;
|
|
14
|
+
this.isNonInteractiveMode = false;
|
|
15
|
+
this.safeClose = null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Set runtime dependencies for interactive operations
|
|
20
|
+
*/
|
|
21
|
+
setRuntimeDependencies(prompt, isNonInteractiveMode, safeClose) {
|
|
22
|
+
this.prompt = prompt;
|
|
23
|
+
this.isNonInteractiveMode = isNonInteractiveMode;
|
|
24
|
+
this.safeClose = safeClose;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Execute the summary command
|
|
29
|
+
*/
|
|
30
|
+
async execute(options = {}) {
|
|
31
|
+
try {
|
|
32
|
+
const summaryTool = require('../../i18ntk-summary');
|
|
33
|
+
const summary = new summaryTool();
|
|
34
|
+
await summary.run(options);
|
|
35
|
+
return { success: true, command: 'summary' };
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(`Summary command failed: ${error.message}`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get command metadata
|
|
44
|
+
*/
|
|
45
|
+
getMetadata() {
|
|
46
|
+
return {
|
|
47
|
+
name: 'summary',
|
|
48
|
+
description: 'Generate summary report of translation status',
|
|
49
|
+
category: 'reporting',
|
|
50
|
+
aliases: ['status'],
|
|
51
|
+
usage: 'summary [options]',
|
|
52
|
+
examples: [
|
|
53
|
+
'summary',
|
|
54
|
+
'summary --output-dir=./reports',
|
|
55
|
+
'summary --format=json'
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = SummaryCommand;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* I18NTK USAGE COMMAND
|
|
5
|
+
*
|
|
6
|
+
* Handles usage analysis functionality.
|
|
7
|
+
*/
|
|
8
|
+
class UsageCommand {
|
|
9
|
+
constructor(config = {}, ui = null) {
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.ui = ui;
|
|
12
|
+
this.prompt = null;
|
|
13
|
+
this.isNonInteractiveMode = false;
|
|
14
|
+
this.safeClose = null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set runtime dependencies for interactive operations
|
|
19
|
+
*/
|
|
20
|
+
setRuntimeDependencies(prompt, isNonInteractiveMode, safeClose) {
|
|
21
|
+
this.prompt = prompt;
|
|
22
|
+
this.isNonInteractiveMode = isNonInteractiveMode;
|
|
23
|
+
this.safeClose = safeClose;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Execute the usage command
|
|
28
|
+
*/
|
|
29
|
+
async execute(options = {}) {
|
|
30
|
+
try {
|
|
31
|
+
const I18nUsageAnalyzer = require('../../i18ntk-usage');
|
|
32
|
+
const usageAnalyzer = new I18nUsageAnalyzer();
|
|
33
|
+
await usageAnalyzer.run(options);
|
|
34
|
+
return { success: true, command: 'usage' };
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`Usage command failed: ${error.message}`);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get command metadata
|
|
43
|
+
*/
|
|
44
|
+
getMetadata() {
|
|
45
|
+
return {
|
|
46
|
+
name: 'usage',
|
|
47
|
+
description: 'Check translation usage in code',
|
|
48
|
+
category: 'analysis',
|
|
49
|
+
aliases: [],
|
|
50
|
+
usage: 'usage [options]',
|
|
51
|
+
examples: [
|
|
52
|
+
'usage',
|
|
53
|
+
'usage --source-dir=./src',
|
|
54
|
+
'usage --output-dir=./reports'
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = UsageCommand;
|