@strapi/i18n 0.0.0-experimental.93181c8b900e97a04bf10785b368657101ec98d8 → 0.0.0-experimental.953e1857bbad81a3c34f5d6511736c1bc8b91dcb
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/_chunks/{SettingsPage-CPNFX0bZ.mjs → SettingsPage-BHvunuIF.mjs} +4 -4
- package/dist/_chunks/SettingsPage-BHvunuIF.mjs.map +1 -0
- package/dist/_chunks/{SettingsPage-C-1h_H38.js → SettingsPage-Bcj7380u.js} +4 -4
- package/dist/_chunks/SettingsPage-Bcj7380u.js.map +1 -0
- package/dist/_chunks/{en-CwI88-PP.js → en-BKBz3tro.js} +10 -4
- package/dist/_chunks/en-BKBz3tro.js.map +1 -0
- package/dist/_chunks/{en-CtekP_47.mjs → en-DlXfy6Gy.mjs} +10 -4
- package/dist/_chunks/en-DlXfy6Gy.mjs.map +1 -0
- package/dist/_chunks/{index-jpk39Rxo.js → index-BKZbxhpm.js} +261 -37
- package/dist/_chunks/index-BKZbxhpm.js.map +1 -0
- package/dist/_chunks/{index-CgjpU2bY.mjs → index-DUdrr5PR.mjs} +264 -40
- package/dist/_chunks/index-DUdrr5PR.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMHeaderActions.d.ts +28 -3
- package/dist/admin/src/components/CreateLocale.d.ts +6 -6
- package/dist/admin/src/utils/clean.d.ts +4 -0
- package/dist/server/index.js +389 -485
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +391 -487
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +1 -4
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +7 -11
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +6 -8
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/sanitize/index.d.ts +11 -0
- package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
- package/dist/server/src/utils/index.d.ts +2 -2
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/_chunks/SettingsPage-C-1h_H38.js.map +0 -1
- package/dist/_chunks/SettingsPage-CPNFX0bZ.mjs.map +0 -1
- package/dist/_chunks/en-CtekP_47.mjs.map +0 -1
- package/dist/_chunks/en-CwI88-PP.js.map +0 -1
- package/dist/_chunks/index-CgjpU2bY.mjs.map +0 -1
- package/dist/_chunks/index-jpk39Rxo.js.map +0 -1
- package/dist/server/src/migrations/content-type/disable/index.d.ts +0 -3
- package/dist/server/src/migrations/content-type/disable/index.d.ts.map +0 -1
- package/dist/server/src/migrations/content-type/enable/index.d.ts +0 -3
- package/dist/server/src/migrations/content-type/enable/index.d.ts.map +0 -1
- package/dist/server/src/services/entity-service-decorator.d.ts +0 -29
- package/dist/server/src/services/entity-service-decorator.d.ts.map +0 -1
- package/strapi-server.js +0 -3
@@ -241,6 +241,86 @@ const relationsApi = i18nApi.injectEndpoints({
|
|
241
241
|
})
|
242
242
|
});
|
243
243
|
const { useGetManyDraftRelationCountQuery } = relationsApi;
|
244
|
+
const cleanData = (data, schema, components) => {
|
245
|
+
const cleanedData = removeFields(data, [
|
246
|
+
"createdAt",
|
247
|
+
"createdBy",
|
248
|
+
"updatedAt",
|
249
|
+
"updatedBy",
|
250
|
+
"id",
|
251
|
+
"documentId",
|
252
|
+
"publishedAt",
|
253
|
+
"strapi_stage",
|
254
|
+
"strapi_assignee",
|
255
|
+
"locale",
|
256
|
+
"status"
|
257
|
+
]);
|
258
|
+
const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(
|
259
|
+
cleanedData,
|
260
|
+
schema,
|
261
|
+
components,
|
262
|
+
["relation", "password"]
|
263
|
+
);
|
264
|
+
return cleanedDataWithoutPasswordAndRelation;
|
265
|
+
};
|
266
|
+
const removeFields = (data, fields) => {
|
267
|
+
return Object.keys(data).reduce((acc, current) => {
|
268
|
+
if (fields.includes(current)) {
|
269
|
+
return acc;
|
270
|
+
}
|
271
|
+
acc[current] = data[current];
|
272
|
+
return acc;
|
273
|
+
}, {});
|
274
|
+
};
|
275
|
+
const recursiveRemoveFieldTypes = (data, schema, components, fields) => {
|
276
|
+
return Object.keys(data).reduce((acc, current) => {
|
277
|
+
const attribute = schema.attributes[current] ?? { type: void 0 };
|
278
|
+
if (fields.includes(attribute.type)) {
|
279
|
+
return acc;
|
280
|
+
}
|
281
|
+
if (attribute.type === "dynamiczone") {
|
282
|
+
acc[current] = data[current].map((componentValue, index2) => {
|
283
|
+
const { id: _, ...rest } = recursiveRemoveFieldTypes(
|
284
|
+
componentValue,
|
285
|
+
components[componentValue.__component],
|
286
|
+
components,
|
287
|
+
fields
|
288
|
+
);
|
289
|
+
return {
|
290
|
+
...rest,
|
291
|
+
__temp_key__: index2 + 1
|
292
|
+
};
|
293
|
+
});
|
294
|
+
} else if (attribute.type === "component") {
|
295
|
+
const { repeatable, component } = attribute;
|
296
|
+
if (repeatable) {
|
297
|
+
acc[current] = (data[current] ?? []).map((compoData, index2) => {
|
298
|
+
const { id: _, ...rest } = recursiveRemoveFieldTypes(
|
299
|
+
compoData,
|
300
|
+
components[component],
|
301
|
+
components,
|
302
|
+
fields
|
303
|
+
);
|
304
|
+
return {
|
305
|
+
...rest,
|
306
|
+
__temp_key__: index2 + 1
|
307
|
+
};
|
308
|
+
});
|
309
|
+
} else {
|
310
|
+
const { id: _, ...rest } = recursiveRemoveFieldTypes(
|
311
|
+
data[current] ?? {},
|
312
|
+
components[component],
|
313
|
+
components,
|
314
|
+
fields
|
315
|
+
);
|
316
|
+
acc[current] = rest;
|
317
|
+
}
|
318
|
+
} else {
|
319
|
+
acc[current] = data[current];
|
320
|
+
}
|
321
|
+
return acc;
|
322
|
+
}, {});
|
323
|
+
};
|
244
324
|
const isErrorMessageDescriptor = (object) => {
|
245
325
|
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
246
326
|
};
|
@@ -435,6 +515,48 @@ const BulkLocaleActionModal = ({
|
|
435
515
|
] }) })
|
436
516
|
] });
|
437
517
|
};
|
518
|
+
const statusVariants = {
|
519
|
+
draft: "secondary",
|
520
|
+
published: "success",
|
521
|
+
modified: "alternative"
|
522
|
+
};
|
523
|
+
const LocaleOption = ({
|
524
|
+
isDraftAndPublishEnabled,
|
525
|
+
locale,
|
526
|
+
status,
|
527
|
+
entryExists
|
528
|
+
}) => {
|
529
|
+
const { formatMessage } = reactIntl.useIntl();
|
530
|
+
if (!entryExists) {
|
531
|
+
return formatMessage(
|
532
|
+
{
|
533
|
+
id: getTranslation("CMEditViewLocalePicker.locale.create"),
|
534
|
+
defaultMessage: "Create <bold>{locale}</bold> locale"
|
535
|
+
},
|
536
|
+
{
|
537
|
+
bold: (locale2) => /* @__PURE__ */ jsxRuntime.jsx("b", { children: locale2 }),
|
538
|
+
locale: locale.name
|
539
|
+
}
|
540
|
+
);
|
541
|
+
}
|
542
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", gap: 1, justifyContent: "space-between", children: [
|
543
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: locale.name }),
|
544
|
+
isDraftAndPublishEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
|
545
|
+
designSystem.Status,
|
546
|
+
{
|
547
|
+
display: "flex",
|
548
|
+
paddingLeft: "6px",
|
549
|
+
paddingRight: "6px",
|
550
|
+
paddingTop: "2px",
|
551
|
+
paddingBottom: "2px",
|
552
|
+
showBullet: false,
|
553
|
+
size: "S",
|
554
|
+
variant: statusVariants[status],
|
555
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
|
556
|
+
}
|
557
|
+
) : null
|
558
|
+
] });
|
559
|
+
};
|
438
560
|
const LocalePickerAction = ({
|
439
561
|
document,
|
440
562
|
meta,
|
@@ -446,7 +568,13 @@ const LocalePickerAction = ({
|
|
446
568
|
const [{ query: query2 }, setQuery] = strapiAdmin.useQueryParams();
|
447
569
|
const { hasI18n, canCreate, canRead } = useI18n();
|
448
570
|
const { data: locales = [] } = useGetLocalesQuery();
|
449
|
-
const
|
571
|
+
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
572
|
+
const { schema } = strapiAdmin$1.unstable_useDocument({
|
573
|
+
model,
|
574
|
+
collectionType,
|
575
|
+
documentId,
|
576
|
+
params: { locale: currentDesiredLocale }
|
577
|
+
});
|
450
578
|
const handleSelect = React__namespace.useCallback(
|
451
579
|
(value) => {
|
452
580
|
setQuery({
|
@@ -464,53 +592,47 @@ const LocalePickerAction = ({
|
|
464
592
|
if (!Array.isArray(locales) || !hasI18n) {
|
465
593
|
return;
|
466
594
|
}
|
467
|
-
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
468
595
|
const doesLocaleExist = locales.find((loc) => loc.code === currentDesiredLocale);
|
469
596
|
const defaultLocale = locales.find((locale) => locale.isDefault);
|
470
597
|
if (!doesLocaleExist && defaultLocale?.code) {
|
471
598
|
handleSelect(defaultLocale.code);
|
472
599
|
}
|
473
|
-
}, [handleSelect, hasI18n, locales,
|
474
|
-
|
475
|
-
return null;
|
476
|
-
}
|
477
|
-
const currentLocale = query2.plugins?.i18n?.locale || locales.find((loc) => loc.isDefault)?.code;
|
600
|
+
}, [handleSelect, hasI18n, locales, currentDesiredLocale]);
|
601
|
+
const currentLocale = Array.isArray(locales) ? locales.find((locale) => locale.code === currentDesiredLocale) : void 0;
|
478
602
|
const allCurrentLocales = [
|
479
|
-
{ status: getDocumentStatus(document, meta), locale: currentLocale },
|
603
|
+
{ status: getDocumentStatus(document, meta), locale: currentLocale?.code },
|
480
604
|
...meta?.availableLocales ?? []
|
481
605
|
];
|
606
|
+
if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {
|
607
|
+
return null;
|
608
|
+
}
|
482
609
|
return {
|
483
610
|
label: formatMessage({
|
484
611
|
id: getTranslation("Settings.locales.modal.locales.label"),
|
485
612
|
defaultMessage: "Locales"
|
486
613
|
}),
|
487
614
|
options: locales.map((locale) => {
|
615
|
+
const entryWithLocaleExists = allCurrentLocales.some((doc) => doc.locale === locale.code);
|
488
616
|
const currentLocaleDoc = allCurrentLocales.find(
|
489
617
|
(doc) => "locale" in doc ? doc.locale === locale.code : false
|
490
618
|
);
|
491
|
-
const
|
492
|
-
const permissionsToCheck = currentLocaleDoc ? canCreate : canRead;
|
493
|
-
const statusVariant = status === "draft" ? "primary" : status === "published" ? "success" : "alternative";
|
619
|
+
const permissionsToCheck = currentLocaleDoc ? canRead : canCreate;
|
494
620
|
return {
|
495
621
|
disabled: !permissionsToCheck.includes(locale.code),
|
496
622
|
value: locale.code,
|
497
|
-
label:
|
498
|
-
|
499
|
-
designSystem.Status,
|
623
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(
|
624
|
+
LocaleOption,
|
500
625
|
{
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
paddingBottom: "2px",
|
506
|
-
showBullet: false,
|
507
|
-
size: "S",
|
508
|
-
variant: statusVariant,
|
509
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
|
626
|
+
isDraftAndPublishEnabled: !!schema?.options?.draftAndPublish,
|
627
|
+
locale,
|
628
|
+
status: currentLocaleDoc?.status,
|
629
|
+
entryExists: entryWithLocaleExists
|
510
630
|
}
|
511
|
-
)
|
631
|
+
),
|
632
|
+
startIcon: !entryWithLocaleExists ? /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}) : null
|
512
633
|
};
|
513
634
|
}),
|
635
|
+
customizeContent: () => currentLocale?.name,
|
514
636
|
onSelect: handleSelect,
|
515
637
|
value: currentLocale
|
516
638
|
};
|
@@ -526,6 +648,99 @@ const getDocumentStatus = (document, meta) => {
|
|
526
648
|
}
|
527
649
|
return docStatus;
|
528
650
|
};
|
651
|
+
const FillFromAnotherLocaleAction = ({
|
652
|
+
documentId,
|
653
|
+
meta,
|
654
|
+
model,
|
655
|
+
collectionType
|
656
|
+
}) => {
|
657
|
+
const { formatMessage } = reactIntl.useIntl();
|
658
|
+
const [{ query: query2 }] = strapiAdmin.useQueryParams();
|
659
|
+
const { hasI18n } = useI18n();
|
660
|
+
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
661
|
+
const [localeSelected, setLocaleSelected] = React__namespace.useState(null);
|
662
|
+
const setValues = strapiAdmin.useForm("FillFromAnotherLocale", (state) => state.setValues);
|
663
|
+
const { getDocument } = strapiAdmin$1.unstable_useDocumentActions();
|
664
|
+
const { schema, components } = strapiAdmin$1.unstable_useDocument({
|
665
|
+
model,
|
666
|
+
documentId,
|
667
|
+
collectionType,
|
668
|
+
params: { locale: currentDesiredLocale }
|
669
|
+
});
|
670
|
+
const { data: locales = [] } = useGetLocalesQuery();
|
671
|
+
const availableLocales = Array.isArray(locales) ? locales.filter((locale) => meta?.availableLocales.some((l) => l.locale === locale.code)) : [];
|
672
|
+
const fillFromLocale = (onClose) => async () => {
|
673
|
+
const response = await getDocument({
|
674
|
+
collectionType,
|
675
|
+
model,
|
676
|
+
documentId,
|
677
|
+
params: { locale: localeSelected }
|
678
|
+
});
|
679
|
+
if (!response || !schema) {
|
680
|
+
return;
|
681
|
+
}
|
682
|
+
const { data } = response;
|
683
|
+
const cleanedData = cleanData(data, schema, components);
|
684
|
+
setValues(cleanedData);
|
685
|
+
onClose();
|
686
|
+
};
|
687
|
+
if (!hasI18n) {
|
688
|
+
return null;
|
689
|
+
}
|
690
|
+
return {
|
691
|
+
type: "icon",
|
692
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
|
693
|
+
disabled: availableLocales.length === 0,
|
694
|
+
label: formatMessage({
|
695
|
+
id: getTranslation("CMEditViewCopyLocale.copy-text"),
|
696
|
+
defaultMessage: "Fill in from another locale"
|
697
|
+
}),
|
698
|
+
dialog: {
|
699
|
+
type: "dialog",
|
700
|
+
title: formatMessage({
|
701
|
+
id: getTranslation("CMEditViewCopyLocale.dialog.title"),
|
702
|
+
defaultMessage: "Confirmation"
|
703
|
+
}),
|
704
|
+
content: ({ onClose }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
705
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
|
706
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
707
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", children: formatMessage({
|
708
|
+
id: getTranslation("CMEditViewCopyLocale.dialog.body"),
|
709
|
+
defaultMessage: "Your current content will be erased and filled by the content of the selected locale:"
|
710
|
+
}) }),
|
711
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { width: "100%", children: [
|
712
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
713
|
+
id: getTranslation("CMEditViewCopyLocale.dialog.field.label"),
|
714
|
+
defaultMessage: "Locale"
|
715
|
+
}) }),
|
716
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
717
|
+
designSystem.SingleSelect,
|
718
|
+
{
|
719
|
+
value: localeSelected,
|
720
|
+
placeholder: formatMessage({
|
721
|
+
id: getTranslation("CMEditViewCopyLocale.dialog.field.placeholder"),
|
722
|
+
defaultMessage: "Select one locale..."
|
723
|
+
}),
|
724
|
+
onChange: (value) => setLocaleSelected(value),
|
725
|
+
children: availableLocales.map((locale) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: locale.code, children: locale.name }, locale.code))
|
726
|
+
}
|
727
|
+
)
|
728
|
+
] })
|
729
|
+
] }) }),
|
730
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, width: "100%", children: [
|
731
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { flex: "auto", variant: "tertiary", onClick: onClose, children: formatMessage({
|
732
|
+
id: getTranslation("CMEditViewCopyLocale.cancel-text"),
|
733
|
+
defaultMessage: "No, cancel"
|
734
|
+
}) }),
|
735
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { flex: "auto", variant: "success", onClick: fillFromLocale(onClose), children: formatMessage({
|
736
|
+
id: getTranslation("CMEditViewCopyLocale.submit-text"),
|
737
|
+
defaultMessage: "Yes, fill in"
|
738
|
+
}) })
|
739
|
+
] }) })
|
740
|
+
] })
|
741
|
+
}
|
742
|
+
};
|
743
|
+
};
|
529
744
|
const DeleteLocaleAction = ({
|
530
745
|
document,
|
531
746
|
documentId,
|
@@ -537,16 +752,23 @@ const DeleteLocaleAction = ({
|
|
537
752
|
const { toggleNotification } = strapiAdmin.useNotification();
|
538
753
|
const { delete: deleteAction } = strapiAdmin$1.unstable_useDocumentActions();
|
539
754
|
const { hasI18n, canDelete } = useI18n();
|
755
|
+
const [{ query: query2 }] = strapiAdmin.useQueryParams();
|
756
|
+
const { data: locales = [] } = useGetLocalesQuery();
|
757
|
+
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
758
|
+
const locale = !("error" in locales) && locales.find((loc) => loc.code === currentDesiredLocale);
|
540
759
|
if (!hasI18n) {
|
541
760
|
return null;
|
542
761
|
}
|
543
762
|
return {
|
544
763
|
disabled: document?.locale && !canDelete.includes(document.locale) || !document || !document.id,
|
545
764
|
position: ["header", "table-row"],
|
546
|
-
label: formatMessage(
|
547
|
-
|
548
|
-
|
549
|
-
|
765
|
+
label: formatMessage(
|
766
|
+
{
|
767
|
+
id: getTranslation("actions.delete.label"),
|
768
|
+
defaultMessage: "Delete entry ({locale})"
|
769
|
+
},
|
770
|
+
{ locale: locale && locale.name }
|
771
|
+
),
|
550
772
|
icon: /* @__PURE__ */ jsxRuntime.jsx(StyledTrash, {}),
|
551
773
|
variant: "danger",
|
552
774
|
dialog: {
|
@@ -563,7 +785,12 @@ const DeleteLocaleAction = ({
|
|
563
785
|
}) })
|
564
786
|
] }),
|
565
787
|
onConfirm: async () => {
|
566
|
-
|
788
|
+
const unableToDelete = (
|
789
|
+
// We are unable to delete a collection type without a document ID
|
790
|
+
// & unable to delete generally if there is no document locale
|
791
|
+
collectionType !== "single-types" && !documentId || !document?.locale
|
792
|
+
);
|
793
|
+
if (unableToDelete) {
|
567
794
|
console.error(
|
568
795
|
"You're trying to delete a document without an id or locale, this is likely a bug with Strapi. Please open an issue."
|
569
796
|
);
|
@@ -622,7 +849,7 @@ const BulkLocaleAction = ({
|
|
622
849
|
}
|
623
850
|
},
|
624
851
|
{
|
625
|
-
skip: !hasI18n
|
852
|
+
skip: !hasI18n || !baseLocale
|
626
853
|
}
|
627
854
|
);
|
628
855
|
const { data: localesMetadata = [] } = useGetLocalesQuery(hasI18n ? void 0 : query.skipToken);
|
@@ -1196,9 +1423,6 @@ const localeMiddleware = (ctx) => (next) => (permissions) => {
|
|
1196
1423
|
return next(revisedPermissions);
|
1197
1424
|
};
|
1198
1425
|
const prefixPluginTranslations = (trad, pluginId2) => {
|
1199
|
-
if (!pluginId2) {
|
1200
|
-
throw new TypeError("pluginId can't be empty");
|
1201
|
-
}
|
1202
1426
|
return Object.keys(trad).reduce((acc, current) => {
|
1203
1427
|
acc[`${pluginId2}.${current}`] = trad[current];
|
1204
1428
|
return acc;
|
@@ -1268,11 +1492,11 @@ const index = {
|
|
1268
1492
|
},
|
1269
1493
|
id: "internationalization",
|
1270
1494
|
to: "internationalization",
|
1271
|
-
Component: () => Promise.resolve().then(() => require("./SettingsPage-
|
1495
|
+
Component: () => Promise.resolve().then(() => require("./SettingsPage-Bcj7380u.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
|
1272
1496
|
permissions: PERMISSIONS.accessMain
|
1273
1497
|
});
|
1274
1498
|
const contentManager = app.getPlugin("content-manager");
|
1275
|
-
contentManager.apis.addDocumentHeaderAction([LocalePickerAction]);
|
1499
|
+
contentManager.apis.addDocumentHeaderAction([LocalePickerAction, FillFromAnotherLocaleAction]);
|
1276
1500
|
contentManager.apis.addDocumentAction((actions) => {
|
1277
1501
|
const indexOfDeleteAction = actions.findIndex((action) => action.type === "delete");
|
1278
1502
|
actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);
|
@@ -1386,7 +1610,7 @@ const index = {
|
|
1386
1610
|
async registerTrads({ locales }) {
|
1387
1611
|
const importedTrads = await Promise.all(
|
1388
1612
|
locales.map((locale) => {
|
1389
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
1613
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BKBz3tro.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DS-XFGSw.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BTjekDpq.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-DmcGUBQ3.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-Cn5RYonZ.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BMBgVL3s.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-CarUU76c.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-DSHIXAa3.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CukOviB0.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
1390
1614
|
return {
|
1391
1615
|
data: prefixPluginTranslations(data, pluginId),
|
1392
1616
|
locale
|
@@ -1410,4 +1634,4 @@ exports.useDeleteLocaleMutation = useDeleteLocaleMutation;
|
|
1410
1634
|
exports.useGetDefaultLocalesQuery = useGetDefaultLocalesQuery;
|
1411
1635
|
exports.useGetLocalesQuery = useGetLocalesQuery;
|
1412
1636
|
exports.useUpdateLocaleMutation = useUpdateLocaleMutation;
|
1413
|
-
//# sourceMappingURL=index-
|
1637
|
+
//# sourceMappingURL=index-BKZbxhpm.js.map
|