@adminforth/i18n 1.2.2 → 1.2.4
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/dist/index.js +5 -2
- package/index.ts +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -217,6 +217,9 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
217
217
|
name: 'fully_translated',
|
|
218
218
|
label: 'Fully translated',
|
|
219
219
|
virtual: true,
|
|
220
|
+
filterOptions: {
|
|
221
|
+
multiselect: false,
|
|
222
|
+
},
|
|
220
223
|
showIn: {
|
|
221
224
|
show: true,
|
|
222
225
|
list: true,
|
|
@@ -361,7 +364,7 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
361
364
|
// if optional `confirm` is provided, user will be asked to confirm action
|
|
362
365
|
confirm: 'Are you sure you want to translate selected items?',
|
|
363
366
|
allowed: (_a) => __awaiter(this, [_a], void 0, function* ({ resource, adminUser, selectedIds, allowedActions }) {
|
|
364
|
-
console.log('allowedActions', JSON.stringify(allowedActions));
|
|
367
|
+
process.env.HEAVY_DEBUG && console.log('allowedActions', JSON.stringify(allowedActions));
|
|
365
368
|
return allowedActions.edit;
|
|
366
369
|
}),
|
|
367
370
|
action: (_a) => __awaiter(this, [_a], void 0, function* ({ selectedIds, tr }) {
|
|
@@ -445,7 +448,7 @@ ${JSON.stringify(strings.reduce((acc, s) => {
|
|
|
445
448
|
`;
|
|
446
449
|
// call OpenAI
|
|
447
450
|
const resp = yield this.options.completeAdapter.complete(prompt, [], prompt.length * 2);
|
|
448
|
-
console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
451
|
+
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
449
452
|
if (resp.error) {
|
|
450
453
|
throw new AiTranslateError(resp.error);
|
|
451
454
|
}
|
package/index.ts
CHANGED
|
@@ -245,6 +245,9 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
245
245
|
name: 'fully_translated',
|
|
246
246
|
label: 'Fully translated',
|
|
247
247
|
virtual: true,
|
|
248
|
+
filterOptions: {
|
|
249
|
+
multiselect: false,
|
|
250
|
+
},
|
|
248
251
|
showIn: {
|
|
249
252
|
show: true,
|
|
250
253
|
list: true,
|
|
@@ -410,7 +413,7 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
410
413
|
// if optional `confirm` is provided, user will be asked to confirm action
|
|
411
414
|
confirm: 'Are you sure you want to translate selected items?',
|
|
412
415
|
allowed: async ({ resource, adminUser, selectedIds, allowedActions }) => {
|
|
413
|
-
console.log('allowedActions', JSON.stringify(allowedActions));
|
|
416
|
+
process.env.HEAVY_DEBUG && console.log('allowedActions', JSON.stringify(allowedActions));
|
|
414
417
|
return allowedActions.edit;
|
|
415
418
|
},
|
|
416
419
|
action: async ({ selectedIds, tr }) => {
|
|
@@ -509,8 +512,7 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
|
|
|
509
512
|
prompt.length * 2,
|
|
510
513
|
);
|
|
511
514
|
|
|
512
|
-
console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
513
|
-
|
|
515
|
+
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
514
516
|
|
|
515
517
|
if (resp.error) {
|
|
516
518
|
throw new AiTranslateError(resp.error);
|