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
|
@@ -1,283 +1,283 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.10.2",
|
|
3
|
-
"language": "en",
|
|
4
|
-
"uiLanguage": "en",
|
|
5
|
-
"theme": "dark",
|
|
6
|
-
"projectRoot": "/",
|
|
7
|
-
"sourceDir": "./locales",
|
|
8
|
-
"i18nDir": "./i18n",
|
|
9
|
-
"outputDir": "./i18ntk-reports",
|
|
10
|
-
"setup": {
|
|
11
|
-
"completed":
|
|
12
|
-
"completedAt":
|
|
13
|
-
"version":
|
|
14
|
-
"setupId":
|
|
15
|
-
},
|
|
16
|
-
"framework": {
|
|
17
|
-
"detected": false,
|
|
18
|
-
"preference": "none",
|
|
19
|
-
"prompt": "always",
|
|
20
|
-
"lastPromptedVersion": null
|
|
21
|
-
},
|
|
22
|
-
"scriptDirectories": {
|
|
23
|
-
"main": "./main",
|
|
24
|
-
"utils": "./utils",
|
|
25
|
-
"scripts": "./scripts",
|
|
26
|
-
"settings": "./settings",
|
|
27
|
-
"uiLocales": "./ui-locales"
|
|
28
|
-
},
|
|
29
|
-
"processing": {
|
|
30
|
-
"mode": "extreme",
|
|
31
|
-
"cacheEnabled": true,
|
|
32
|
-
"batchSize": 1000,
|
|
33
|
-
"maxWorkers": 4,
|
|
34
|
-
"timeout": 30000,
|
|
35
|
-
"retryAttempts": 3,
|
|
36
|
-
"parallelProcessing": true,
|
|
37
|
-
"memoryOptimization": true,
|
|
38
|
-
"compression": true
|
|
39
|
-
},
|
|
40
|
-
"reports": {
|
|
41
|
-
"format": "json",
|
|
42
|
-
"includeSource": false,
|
|
43
|
-
"includeStats": true,
|
|
44
|
-
"includeRecommendations": true,
|
|
45
|
-
"includeSecurity": true,
|
|
46
|
-
"includePerformance": true,
|
|
47
|
-
"saveToFile": true,
|
|
48
|
-
"fileName": "i18n-report-[timestamp].json",
|
|
49
|
-
"outputPath": "./i18ntk-reports",
|
|
50
|
-
"compress": true
|
|
51
|
-
},
|
|
52
|
-
"ui": {
|
|
53
|
-
"showProgress": true,
|
|
54
|
-
"showColors": true,
|
|
55
|
-
"showTimestamps": true,
|
|
56
|
-
"showTips": true,
|
|
57
|
-
"showWarnings": true,
|
|
58
|
-
"showErrors": true,
|
|
59
|
-
"interactive": true,
|
|
60
|
-
"confirmActions": true,
|
|
61
|
-
"autoComplete": true,
|
|
62
|
-
"syntaxHighlighting": true
|
|
63
|
-
},
|
|
64
|
-
"behavior": {
|
|
65
|
-
"autoSave": true,
|
|
66
|
-
"autoBackup": true,
|
|
67
|
-
"backupFrequency": "weekly",
|
|
68
|
-
"maxBackups": 10,
|
|
69
|
-
"confirmDestructive": true,
|
|
70
|
-
"validateOnSave": true,
|
|
71
|
-
"formatOnSave": true,
|
|
72
|
-
"lintOnSave": true,
|
|
73
|
-
"autoFix": false,
|
|
74
|
-
"strictMode": false,
|
|
75
|
-
"devMode": false
|
|
76
|
-
},
|
|
77
|
-
"notifications": {
|
|
78
|
-
"enabled": true,
|
|
79
|
-
"desktop": true,
|
|
80
|
-
"sound": false,
|
|
81
|
-
"types": {
|
|
82
|
-
"success": true,
|
|
83
|
-
"warning": true,
|
|
84
|
-
"error": true,
|
|
85
|
-
"info": true,
|
|
86
|
-
"debug": false
|
|
87
|
-
},
|
|
88
|
-
"timeout": 5000,
|
|
89
|
-
"maxNotifications": 5
|
|
90
|
-
},
|
|
91
|
-
"dateTime": {
|
|
92
|
-
"timezone": "auto",
|
|
93
|
-
"format": "YYYY-MM-DD HH:mm:ss",
|
|
94
|
-
"locale": "en-US",
|
|
95
|
-
"dateFormat": "YYYY-MM-DD",
|
|
96
|
-
"timeFormat": "HH:mm:ss",
|
|
97
|
-
"use24Hour": true,
|
|
98
|
-
"showTimezone": false
|
|
99
|
-
},
|
|
100
|
-
"advanced": {
|
|
101
|
-
"debugMode": false,
|
|
102
|
-
"verboseLogging": false,
|
|
103
|
-
"performanceTracking": true,
|
|
104
|
-
"memoryProfiling": false,
|
|
105
|
-
"stackTraces": false,
|
|
106
|
-
"experimentalFeatures": false,
|
|
107
|
-
"customExtractors": [],
|
|
108
|
-
"customValidators": [],
|
|
109
|
-
"customFormatters": []
|
|
110
|
-
},
|
|
111
|
-
"backup": {
|
|
112
|
-
"enabled": true,
|
|
113
|
-
"location": "./backups",
|
|
114
|
-
"frequency": "daily",
|
|
115
|
-
"retention": 7,
|
|
116
|
-
"compression": true,
|
|
117
|
-
"encryption": true,
|
|
118
|
-
"autoCleanup": true,
|
|
119
|
-
"maxSize": "100MB",
|
|
120
|
-
"includeReports": true,
|
|
121
|
-
"includeLogs": true
|
|
122
|
-
},
|
|
123
|
-
"security": {
|
|
124
|
-
"enabled": true,
|
|
125
|
-
"adminPinEnabled": false,
|
|
126
|
-
"sessionTimeout": 1800000,
|
|
127
|
-
"maxFailedAttempts": 3,
|
|
128
|
-
"lockoutDuration": 300000,
|
|
129
|
-
"encryption": {
|
|
130
|
-
"enabled": true,
|
|
131
|
-
"algorithm": "aes-256-gcm",
|
|
132
|
-
"keyDerivation": "pbkdf2",
|
|
133
|
-
"iterations": 100000
|
|
134
|
-
},
|
|
135
|
-
"pinProtection": {
|
|
136
|
-
"enabled": false,
|
|
137
|
-
"pin": null,
|
|
138
|
-
"protectedScripts": {
|
|
139
|
-
"init": false,
|
|
140
|
-
"analyze": false,
|
|
141
|
-
"validate": false,
|
|
142
|
-
"fix": false,
|
|
143
|
-
"manage": true,
|
|
144
|
-
"settings": true,
|
|
145
|
-
"admin": true
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"auditLog": true,
|
|
149
|
-
"sanitizeInput": true,
|
|
150
|
-
"validatePaths": true,
|
|
151
|
-
"restrictAccess": false
|
|
152
|
-
},
|
|
153
|
-
"debug": {
|
|
154
|
-
"enabled": false,
|
|
155
|
-
"logLevel": "info",
|
|
156
|
-
"logFile": "./i18ntk-debug.log",
|
|
157
|
-
"maxFileSize": "10MB",
|
|
158
|
-
"maxFiles": 5,
|
|
159
|
-
"includeStackTrace": false,
|
|
160
|
-
"includeMemoryUsage": false,
|
|
161
|
-
"performanceMetrics": false
|
|
162
|
-
},
|
|
163
|
-
"sizeLimit": null,
|
|
164
|
-
"placeholderStyles": {
|
|
165
|
-
"en": [
|
|
166
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
167
|
-
"%\\\\{[^}]+\\\\}",
|
|
168
|
-
"%[sdif]",
|
|
169
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
170
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
171
|
-
"__\\\\w+__",
|
|
172
|
-
"\\\\{\\\\w+\\\\}",
|
|
173
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
174
|
-
"\\\\{\\\\{t\\\\s+['\"][^'\"]*['\"]\\\\}\\\\}",
|
|
175
|
-
"t\\\\(['\"][^'\"]*['\"]",
|
|
176
|
-
"i18n\\\\.t\\\\(['\"][^'\"]*['\"]"
|
|
177
|
-
],
|
|
178
|
-
"de": [
|
|
179
|
-
"%\\\\{[^}]+\\\\}",
|
|
180
|
-
"%[sdif]",
|
|
181
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
182
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
183
|
-
"__\\\\w+__",
|
|
184
|
-
"\\\\{\\\\w+\\\\}",
|
|
185
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
186
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}"
|
|
187
|
-
],
|
|
188
|
-
"es": [
|
|
189
|
-
"%\\\\{[^}]+\\\\}",
|
|
190
|
-
"%[sdif]",
|
|
191
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
192
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
193
|
-
"__\\\\w+__",
|
|
194
|
-
"\\\\{\\\\w+\\\\}",
|
|
195
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
196
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}"
|
|
197
|
-
],
|
|
198
|
-
"fr": [
|
|
199
|
-
"%\\\\{[^}]+\\\\}",
|
|
200
|
-
"%[sdif]",
|
|
201
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
202
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
203
|
-
"__\\\\w+__",
|
|
204
|
-
"\\\\{\\\\w+\\\\}",
|
|
205
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
206
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
207
|
-
"\\\\{\\\\d+\\\\}"
|
|
208
|
-
],
|
|
209
|
-
"ru": [
|
|
210
|
-
"%\\\\{[^}]+\\\\}",
|
|
211
|
-
"%[sdif]",
|
|
212
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
213
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
214
|
-
"__\\\\w+__",
|
|
215
|
-
"\\\\{\\\\w+\\\\}",
|
|
216
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
217
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
218
|
-
"\\\\{\\\\d+\\\\}"
|
|
219
|
-
],
|
|
220
|
-
"zh": [
|
|
221
|
-
"%\\\\{[^}]+\\\\}",
|
|
222
|
-
"%[sdif]",
|
|
223
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
224
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
225
|
-
"__\\\\w+__",
|
|
226
|
-
"\\\\{\\\\w+\\\\}",
|
|
227
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
228
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
229
|
-
"\\\\{\\\\d+\\\\}"
|
|
230
|
-
],
|
|
231
|
-
"ja": [
|
|
232
|
-
"%\\\\{[^}]+\\\\}",
|
|
233
|
-
"%[sdif]",
|
|
234
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
235
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
236
|
-
"__\\\\w+__",
|
|
237
|
-
"\\\\{\\\\w+\\\\}",
|
|
238
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
239
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
240
|
-
"\\\\{\\\\d+\\\\}"
|
|
241
|
-
],
|
|
242
|
-
"universal": [
|
|
243
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
244
|
-
"%\\\\{[^}]+\\\\}",
|
|
245
|
-
"%[sdif]",
|
|
246
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
247
|
-
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
248
|
-
"__\\\\w+__",
|
|
249
|
-
"\\\\{\\\\w+\\\\}",
|
|
250
|
-
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
251
|
-
"\\\\{\\\\d+\\\\}",
|
|
252
|
-
"\\\\{\\\\d*\\\\}"
|
|
253
|
-
],
|
|
254
|
-
"frameworks": {
|
|
255
|
-
"react": [
|
|
256
|
-
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
257
|
-
"\\\\$\\\\{[^}]+\\\\}",
|
|
258
|
-
"t\\\\(['\"][^'\"]*['\"]",
|
|
259
|
-
"i18n\\\\.t\\\\(['\"][^'\"]*['\"]",
|
|
260
|
-
"useTranslation\\\\s*\\\\([^)]*\\\\)",
|
|
261
|
-
"<Trans[^>]*>.*?</Trans>"
|
|
262
|
-
],
|
|
263
|
-
"vue": [
|
|
264
|
-
"\\\\$t\\\\(['\"][^'\"]*['\"]",
|
|
265
|
-
"\\\\$tc\\\\(['\"][^'\"]*['\"]",
|
|
266
|
-
"\\\\{\\\\{\\\\$t\\\\([^)]+\\\\)\\\\}\\\\}",
|
|
267
|
-
"v-t=['\"][^'\"]*['\"]"
|
|
268
|
-
],
|
|
269
|
-
"angular": [
|
|
270
|
-
"'[^']*'\\\\s*\\\\|\\\\s*translate",
|
|
271
|
-
"\\\\{[^}]*'[^']*'\\\\s*\\\\|\\\\s*translate[^}]*\\\\}",
|
|
272
|
-
"translate\\\\s*:\\s*['\"][^'\"]*['\"]"
|
|
273
|
-
],
|
|
274
|
-
"nextjs": [
|
|
275
|
-
"t\\\\(['\"][^'\"]*['\"]",
|
|
276
|
-
"router\\\\.locale",
|
|
277
|
-
"useTranslation\\\\s*\\\\([^)]*\\\\)",
|
|
278
|
-
"getStaticProps\\\\s*\\\\([^)]*\\\\)",
|
|
279
|
-
"getServerSideProps\\\\s*\\\\([^)]*\\\\)"
|
|
280
|
-
]
|
|
281
|
-
}
|
|
282
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "1.10.2",
|
|
3
|
+
"language": "en",
|
|
4
|
+
"uiLanguage": "en",
|
|
5
|
+
"theme": "dark",
|
|
6
|
+
"projectRoot": "/",
|
|
7
|
+
"sourceDir": "./locales",
|
|
8
|
+
"i18nDir": "./i18n",
|
|
9
|
+
"outputDir": "./i18ntk-reports",
|
|
10
|
+
"setup": {
|
|
11
|
+
"completed": true,
|
|
12
|
+
"completedAt": "2025-08-23T16:47:49.232Z",
|
|
13
|
+
"version": "1.10.2",
|
|
14
|
+
"setupId": "setup_1755967669233_0xhzlh1fs"
|
|
15
|
+
},
|
|
16
|
+
"framework": {
|
|
17
|
+
"detected": false,
|
|
18
|
+
"preference": "none",
|
|
19
|
+
"prompt": "always",
|
|
20
|
+
"lastPromptedVersion": null
|
|
21
|
+
},
|
|
22
|
+
"scriptDirectories": {
|
|
23
|
+
"main": "./main",
|
|
24
|
+
"utils": "./utils",
|
|
25
|
+
"scripts": "./scripts",
|
|
26
|
+
"settings": "./settings",
|
|
27
|
+
"uiLocales": "./ui-locales"
|
|
28
|
+
},
|
|
29
|
+
"processing": {
|
|
30
|
+
"mode": "extreme",
|
|
31
|
+
"cacheEnabled": true,
|
|
32
|
+
"batchSize": 1000,
|
|
33
|
+
"maxWorkers": 4,
|
|
34
|
+
"timeout": 30000,
|
|
35
|
+
"retryAttempts": 3,
|
|
36
|
+
"parallelProcessing": true,
|
|
37
|
+
"memoryOptimization": true,
|
|
38
|
+
"compression": true
|
|
39
|
+
},
|
|
40
|
+
"reports": {
|
|
41
|
+
"format": "json",
|
|
42
|
+
"includeSource": false,
|
|
43
|
+
"includeStats": true,
|
|
44
|
+
"includeRecommendations": true,
|
|
45
|
+
"includeSecurity": true,
|
|
46
|
+
"includePerformance": true,
|
|
47
|
+
"saveToFile": true,
|
|
48
|
+
"fileName": "i18n-report-[timestamp].json",
|
|
49
|
+
"outputPath": "./i18ntk-reports",
|
|
50
|
+
"compress": true
|
|
51
|
+
},
|
|
52
|
+
"ui": {
|
|
53
|
+
"showProgress": true,
|
|
54
|
+
"showColors": true,
|
|
55
|
+
"showTimestamps": true,
|
|
56
|
+
"showTips": true,
|
|
57
|
+
"showWarnings": true,
|
|
58
|
+
"showErrors": true,
|
|
59
|
+
"interactive": true,
|
|
60
|
+
"confirmActions": true,
|
|
61
|
+
"autoComplete": true,
|
|
62
|
+
"syntaxHighlighting": true
|
|
63
|
+
},
|
|
64
|
+
"behavior": {
|
|
65
|
+
"autoSave": true,
|
|
66
|
+
"autoBackup": true,
|
|
67
|
+
"backupFrequency": "weekly",
|
|
68
|
+
"maxBackups": 10,
|
|
69
|
+
"confirmDestructive": true,
|
|
70
|
+
"validateOnSave": true,
|
|
71
|
+
"formatOnSave": true,
|
|
72
|
+
"lintOnSave": true,
|
|
73
|
+
"autoFix": false,
|
|
74
|
+
"strictMode": false,
|
|
75
|
+
"devMode": false
|
|
76
|
+
},
|
|
77
|
+
"notifications": {
|
|
78
|
+
"enabled": true,
|
|
79
|
+
"desktop": true,
|
|
80
|
+
"sound": false,
|
|
81
|
+
"types": {
|
|
82
|
+
"success": true,
|
|
83
|
+
"warning": true,
|
|
84
|
+
"error": true,
|
|
85
|
+
"info": true,
|
|
86
|
+
"debug": false
|
|
87
|
+
},
|
|
88
|
+
"timeout": 5000,
|
|
89
|
+
"maxNotifications": 5
|
|
90
|
+
},
|
|
91
|
+
"dateTime": {
|
|
92
|
+
"timezone": "auto",
|
|
93
|
+
"format": "YYYY-MM-DD HH:mm:ss",
|
|
94
|
+
"locale": "en-US",
|
|
95
|
+
"dateFormat": "YYYY-MM-DD",
|
|
96
|
+
"timeFormat": "HH:mm:ss",
|
|
97
|
+
"use24Hour": true,
|
|
98
|
+
"showTimezone": false
|
|
99
|
+
},
|
|
100
|
+
"advanced": {
|
|
101
|
+
"debugMode": false,
|
|
102
|
+
"verboseLogging": false,
|
|
103
|
+
"performanceTracking": true,
|
|
104
|
+
"memoryProfiling": false,
|
|
105
|
+
"stackTraces": false,
|
|
106
|
+
"experimentalFeatures": false,
|
|
107
|
+
"customExtractors": [],
|
|
108
|
+
"customValidators": [],
|
|
109
|
+
"customFormatters": []
|
|
110
|
+
},
|
|
111
|
+
"backup": {
|
|
112
|
+
"enabled": true,
|
|
113
|
+
"location": "./backups",
|
|
114
|
+
"frequency": "daily",
|
|
115
|
+
"retention": 7,
|
|
116
|
+
"compression": true,
|
|
117
|
+
"encryption": true,
|
|
118
|
+
"autoCleanup": true,
|
|
119
|
+
"maxSize": "100MB",
|
|
120
|
+
"includeReports": true,
|
|
121
|
+
"includeLogs": true
|
|
122
|
+
},
|
|
123
|
+
"security": {
|
|
124
|
+
"enabled": true,
|
|
125
|
+
"adminPinEnabled": false,
|
|
126
|
+
"sessionTimeout": 1800000,
|
|
127
|
+
"maxFailedAttempts": 3,
|
|
128
|
+
"lockoutDuration": 300000,
|
|
129
|
+
"encryption": {
|
|
130
|
+
"enabled": true,
|
|
131
|
+
"algorithm": "aes-256-gcm",
|
|
132
|
+
"keyDerivation": "pbkdf2",
|
|
133
|
+
"iterations": 100000
|
|
134
|
+
},
|
|
135
|
+
"pinProtection": {
|
|
136
|
+
"enabled": false,
|
|
137
|
+
"pin": null,
|
|
138
|
+
"protectedScripts": {
|
|
139
|
+
"init": false,
|
|
140
|
+
"analyze": false,
|
|
141
|
+
"validate": false,
|
|
142
|
+
"fix": false,
|
|
143
|
+
"manage": true,
|
|
144
|
+
"settings": true,
|
|
145
|
+
"admin": true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"auditLog": true,
|
|
149
|
+
"sanitizeInput": true,
|
|
150
|
+
"validatePaths": true,
|
|
151
|
+
"restrictAccess": false
|
|
152
|
+
},
|
|
153
|
+
"debug": {
|
|
154
|
+
"enabled": false,
|
|
155
|
+
"logLevel": "info",
|
|
156
|
+
"logFile": "./i18ntk-debug.log",
|
|
157
|
+
"maxFileSize": "10MB",
|
|
158
|
+
"maxFiles": 5,
|
|
159
|
+
"includeStackTrace": false,
|
|
160
|
+
"includeMemoryUsage": false,
|
|
161
|
+
"performanceMetrics": false
|
|
162
|
+
},
|
|
163
|
+
"sizeLimit": null,
|
|
164
|
+
"placeholderStyles": {
|
|
165
|
+
"en": [
|
|
166
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
167
|
+
"%\\\\{[^}]+\\\\}",
|
|
168
|
+
"%[sdif]",
|
|
169
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
170
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
171
|
+
"__\\\\w+__",
|
|
172
|
+
"\\\\{\\\\w+\\\\}",
|
|
173
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
174
|
+
"\\\\{\\\\{t\\\\s+['\"][^'\"]*['\"]\\\\}\\\\}",
|
|
175
|
+
"t\\\\(['\"][^'\"]*['\"]",
|
|
176
|
+
"i18n\\\\.t\\\\(['\"][^'\"]*['\"]"
|
|
177
|
+
],
|
|
178
|
+
"de": [
|
|
179
|
+
"%\\\\{[^}]+\\\\}",
|
|
180
|
+
"%[sdif]",
|
|
181
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
182
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
183
|
+
"__\\\\w+__",
|
|
184
|
+
"\\\\{\\\\w+\\\\}",
|
|
185
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
186
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}"
|
|
187
|
+
],
|
|
188
|
+
"es": [
|
|
189
|
+
"%\\\\{[^}]+\\\\}",
|
|
190
|
+
"%[sdif]",
|
|
191
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
192
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
193
|
+
"__\\\\w+__",
|
|
194
|
+
"\\\\{\\\\w+\\\\}",
|
|
195
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
196
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}"
|
|
197
|
+
],
|
|
198
|
+
"fr": [
|
|
199
|
+
"%\\\\{[^}]+\\\\}",
|
|
200
|
+
"%[sdif]",
|
|
201
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
202
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
203
|
+
"__\\\\w+__",
|
|
204
|
+
"\\\\{\\\\w+\\\\}",
|
|
205
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
206
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
207
|
+
"\\\\{\\\\d+\\\\}"
|
|
208
|
+
],
|
|
209
|
+
"ru": [
|
|
210
|
+
"%\\\\{[^}]+\\\\}",
|
|
211
|
+
"%[sdif]",
|
|
212
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
213
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
214
|
+
"__\\\\w+__",
|
|
215
|
+
"\\\\{\\\\w+\\\\}",
|
|
216
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
217
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
218
|
+
"\\\\{\\\\d+\\\\}"
|
|
219
|
+
],
|
|
220
|
+
"zh": [
|
|
221
|
+
"%\\\\{[^}]+\\\\}",
|
|
222
|
+
"%[sdif]",
|
|
223
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
224
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
225
|
+
"__\\\\w+__",
|
|
226
|
+
"\\\\{\\\\w+\\\\}",
|
|
227
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
228
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
229
|
+
"\\\\{\\\\d+\\\\}"
|
|
230
|
+
],
|
|
231
|
+
"ja": [
|
|
232
|
+
"%\\\\{[^}]+\\\\}",
|
|
233
|
+
"%[sdif]",
|
|
234
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
235
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
236
|
+
"__\\\\w+__",
|
|
237
|
+
"\\\\{\\\\w+\\\\}",
|
|
238
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
239
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
240
|
+
"\\\\{\\\\d+\\\\}"
|
|
241
|
+
],
|
|
242
|
+
"universal": [
|
|
243
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
244
|
+
"%\\\\{[^}]+\\\\}",
|
|
245
|
+
"%[sdif]",
|
|
246
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
247
|
+
"\\\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
|
248
|
+
"__\\\\w+__",
|
|
249
|
+
"\\\\{\\\\w+\\\\}",
|
|
250
|
+
"\\\\[\\\\[\\\\w+\\\\]\\\\]",
|
|
251
|
+
"\\\\{\\\\d+\\\\}",
|
|
252
|
+
"\\\\{\\\\d*\\\\}"
|
|
253
|
+
],
|
|
254
|
+
"frameworks": {
|
|
255
|
+
"react": [
|
|
256
|
+
"\\\\{\\\\{[^}]+\\\\}\\\\}",
|
|
257
|
+
"\\\\$\\\\{[^}]+\\\\}",
|
|
258
|
+
"t\\\\(['\"][^'\"]*['\"]",
|
|
259
|
+
"i18n\\\\.t\\\\(['\"][^'\"]*['\"]",
|
|
260
|
+
"useTranslation\\\\s*\\\\([^)]*\\\\)",
|
|
261
|
+
"<Trans[^>]*>.*?</Trans>"
|
|
262
|
+
],
|
|
263
|
+
"vue": [
|
|
264
|
+
"\\\\$t\\\\(['\"][^'\"]*['\"]",
|
|
265
|
+
"\\\\$tc\\\\(['\"][^'\"]*['\"]",
|
|
266
|
+
"\\\\{\\\\{\\\\$t\\\\([^)]+\\\\)\\\\}\\\\}",
|
|
267
|
+
"v-t=['\"][^'\"]*['\"]"
|
|
268
|
+
],
|
|
269
|
+
"angular": [
|
|
270
|
+
"'[^']*'\\\\s*\\\\|\\\\s*translate",
|
|
271
|
+
"\\\\{[^}]*'[^']*'\\\\s*\\\\|\\\\s*translate[^}]*\\\\}",
|
|
272
|
+
"translate\\\\s*:\\s*['\"][^'\"]*['\"]"
|
|
273
|
+
],
|
|
274
|
+
"nextjs": [
|
|
275
|
+
"t\\\\(['\"][^'\"]*['\"]",
|
|
276
|
+
"router\\\\.locale",
|
|
277
|
+
"useTranslation\\\\s*\\\\([^)]*\\\\)",
|
|
278
|
+
"getStaticProps\\\\s*\\\\([^)]*\\\\)",
|
|
279
|
+
"getServerSideProps\\\\s*\\\\([^)]*\\\\)"
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
283
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"selectedLanguage": "en",
|
|
3
|
-
"keepAllLanguages": true,
|
|
4
|
-
"backupCreated": false,
|
|
5
|
-
"lastCleanup": null
|
|
1
|
+
{
|
|
2
|
+
"selectedLanguage": "en",
|
|
3
|
+
"keepAllLanguages": true,
|
|
4
|
+
"backupCreated": false,
|
|
5
|
+
"lastCleanup": null
|
|
6
6
|
}
|
package/settings/settings-cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const settingsManager = new SettingsManager();
|
|
|
12
12
|
const UIi18n = require('../main/i18ntk-ui');
|
|
13
13
|
const configManager = require('../utils/config-manager');
|
|
14
14
|
const { loadTranslations, t } = require('../utils/i18n-helper');
|
|
15
|
-
loadTranslations(
|
|
15
|
+
loadTranslations(null, path.resolve(__dirname, '..', 'resources', 'i18n', 'ui-locales'));
|
|
16
16
|
|
|
17
17
|
const AdminAuth = require('../utils/admin-auth');
|
|
18
18
|
const uiI18n = new UIi18n();
|
|
@@ -1226,7 +1226,7 @@ class SettingsCLI {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
1228
|
try {
|
|
1229
|
-
|
|
1229
|
+
SecurityUtils.safeWriteFileSync(exportFile, exportData, path.dirname(exportFile));
|
|
1230
1230
|
const stats = fs.statSync(exportFile);
|
|
1231
1231
|
this.success(`Settings exported to ${exportFile}`);
|
|
1232
1232
|
console.log(` Size: ${Math.round(stats.size / 1024)}KB`);
|
|
@@ -1259,13 +1259,13 @@ class SettingsCLI {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
1261
|
try {
|
|
1262
|
-
if (!
|
|
1262
|
+
if (!SecurityUtils.safeExistsSync(filename)) {
|
|
1263
1263
|
this.error('File not found.');
|
|
1264
1264
|
await this.pause();
|
|
1265
1265
|
return;
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
1268
|
-
const fileContent =
|
|
1268
|
+
const fileContent = SecurityUtils.safeReadFileSync(filename, path.dirname(filename), 'utf8');
|
|
1269
1269
|
let importedSettings;
|
|
1270
1270
|
|
|
1271
1271
|
try {
|
|
@@ -1339,7 +1339,7 @@ class SettingsCLI {
|
|
|
1339
1339
|
try {
|
|
1340
1340
|
const source = configManager.CONFIG_PATH;
|
|
1341
1341
|
const backupDir = path.join(path.dirname(source), 'backups');
|
|
1342
|
-
if (!
|
|
1342
|
+
if (!SecurityUtils.safeExistsSync(backupDir)) {
|
|
1343
1343
|
fs.mkdirSync(backupDir, { recursive: true });
|
|
1344
1344
|
}
|
|
1345
1345
|
const backupFile = path.join(backupDir, `config-backup-${Date.now()}.json`);
|
|
@@ -1378,7 +1378,7 @@ class SettingsCLI {
|
|
|
1378
1378
|
try {
|
|
1379
1379
|
const backupDir = path.join(path.dirname(configManager.CONFIG_PATH), 'backups');
|
|
1380
1380
|
|
|
1381
|
-
if (!
|
|
1381
|
+
if (!SecurityUtils.safeExistsSync(backupDir)) {
|
|
1382
1382
|
this.error('No backup directory found.');
|
|
1383
1383
|
await this.pause();
|
|
1384
1384
|
return;
|
|
@@ -1420,7 +1420,7 @@ class SettingsCLI {
|
|
|
1420
1420
|
|
|
1421
1421
|
const confirm = await this.prompt(`Restore from ${selectedBackup.name}? This will overwrite current settings. (y/n): `);
|
|
1422
1422
|
if (confirm.toLowerCase() === 'y') {
|
|
1423
|
-
const importedSettings = JSON.parse(
|
|
1423
|
+
const importedSettings = JSON.parse(SecurityUtils.safeReadFileSync(selectedBackup.path, path.dirname(selectedBackup.path), 'utf8'));
|
|
1424
1424
|
|
|
1425
1425
|
// Validate imported settings
|
|
1426
1426
|
if (!settingsManager.validateSettings(importedSettings)) {
|
|
@@ -1464,7 +1464,7 @@ class SettingsCLI {
|
|
|
1464
1464
|
try {
|
|
1465
1465
|
const backupDir = path.join(path.dirname(configManager.CONFIG_PATH), 'backups');
|
|
1466
1466
|
|
|
1467
|
-
if (!
|
|
1467
|
+
if (!SecurityUtils.safeExistsSync(backupDir)) {
|
|
1468
1468
|
this.error('No backup directory found.');
|
|
1469
1469
|
await this.pause();
|
|
1470
1470
|
return;
|
|
@@ -2005,7 +2005,7 @@ ${colors.dim}${t('settings.updatePackage.command')}: npm update i18ntk -g${color
|
|
|
2005
2005
|
const fileName = `i18ntk-enhanced-schema-${Date.now()}.json`;
|
|
2006
2006
|
const filePath = path.join(process.cwd(), fileName);
|
|
2007
2007
|
|
|
2008
|
-
|
|
2008
|
+
SecurityUtils.safeWriteFileSync(filePath, JSON.stringify(enhancedSchema, null, 2), path.dirname(filePath));
|
|
2009
2009
|
this.success(`Enhanced schema exported to: ${filePath}`);
|
|
2010
2010
|
|
|
2011
2011
|
await this.pause();
|