@strapi/i18n 0.0.0-next.7f1333f1967e625c57ab16648c057aea08c9dddb → 0.0.0-next.7ff82e00c12aa44d99b20c7b95fe781a4b8d7435

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 (94) hide show
  1. package/dist/_chunks/{SettingsPage-D_53Ao8I.mjs → SettingsPage-B-KzAqT3.mjs} +2 -2
  2. package/dist/_chunks/{SettingsPage-D_53Ao8I.mjs.map → SettingsPage-B-KzAqT3.mjs.map} +1 -1
  3. package/dist/_chunks/{SettingsPage-Z94BBMrV.js → SettingsPage-hyOi94O9.js} +3 -4
  4. package/dist/_chunks/{SettingsPage-Z94BBMrV.js.map → SettingsPage-hyOi94O9.js.map} +1 -1
  5. package/dist/_chunks/{de-DtWiGdHl.js → de-BOhNX_-5.js} +1 -2
  6. package/dist/_chunks/de-BOhNX_-5.js.map +1 -0
  7. package/dist/_chunks/{de-9eCAqqrB.mjs → de-D80IRBP9.mjs} +1 -2
  8. package/dist/_chunks/de-D80IRBP9.mjs.map +1 -0
  9. package/dist/_chunks/{dk-2qBjxt-P.mjs → dk-CJ6Zzz78.mjs} +1 -2
  10. package/dist/_chunks/dk-CJ6Zzz78.mjs.map +1 -0
  11. package/dist/_chunks/{dk-D8C-casx.js → dk-cjXm0p3m.js} +1 -2
  12. package/dist/_chunks/dk-cjXm0p3m.js.map +1 -0
  13. package/dist/_chunks/{en-DlXfy6Gy.mjs → en-BTyF7WVW.mjs} +1 -2
  14. package/dist/_chunks/en-BTyF7WVW.mjs.map +1 -0
  15. package/dist/_chunks/{en-BKBz3tro.js → en-UlC0jh2t.js} +1 -2
  16. package/dist/_chunks/en-UlC0jh2t.js.map +1 -0
  17. package/dist/_chunks/{es-DlmMVaBG.mjs → es-V8WnPN7w.mjs} +1 -2
  18. package/dist/_chunks/es-V8WnPN7w.mjs.map +1 -0
  19. package/dist/_chunks/{es-DS-XFGSw.js → es-hr9b_HLp.js} +1 -2
  20. package/dist/_chunks/es-hr9b_HLp.js.map +1 -0
  21. package/dist/_chunks/{fr-BTjekDpq.js → fr-BFmBbE0H.js} +1 -2
  22. package/dist/_chunks/fr-BFmBbE0H.js.map +1 -0
  23. package/dist/_chunks/{fr-3S6ke71d.mjs → fr-F94noFiV.mjs} +1 -2
  24. package/dist/_chunks/fr-F94noFiV.mjs.map +1 -0
  25. package/dist/_chunks/{index-BGhYo_Rs.mjs → index-BcYj5jo9.mjs} +40 -62
  26. package/dist/_chunks/index-BcYj5jo9.mjs.map +1 -0
  27. package/dist/_chunks/{index-BOvOaxo-.js → index-C8NzsAKp.js} +41 -64
  28. package/dist/_chunks/index-C8NzsAKp.js.map +1 -0
  29. package/dist/_chunks/{ko-DmcGUBQ3.js → ko-C40pNQ9b.js} +1 -2
  30. package/dist/_chunks/ko-C40pNQ9b.js.map +1 -0
  31. package/dist/_chunks/{ko-qTjQ8IMw.mjs → ko-CF-P3Car.mjs} +1 -2
  32. package/dist/_chunks/ko-CF-P3Car.mjs.map +1 -0
  33. package/dist/_chunks/{pl-B67TSHqT.mjs → pl-Dxr9RUmD.mjs} +1 -2
  34. package/dist/_chunks/pl-Dxr9RUmD.mjs.map +1 -0
  35. package/dist/_chunks/{pl-Cn5RYonZ.js → pl-JtWBy-JQ.js} +1 -2
  36. package/dist/_chunks/pl-JtWBy-JQ.js.map +1 -0
  37. package/dist/_chunks/{ru-hagMa57T.mjs → ru-B-4sVwXN.mjs} +1 -2
  38. package/dist/_chunks/ru-B-4sVwXN.mjs.map +1 -0
  39. package/dist/_chunks/{ru-BMBgVL3s.js → ru-COSWt3Nu.js} +1 -2
  40. package/dist/_chunks/ru-COSWt3Nu.js.map +1 -0
  41. package/dist/_chunks/{tr-CarUU76c.js → tr-BVj1O5ch.js} +1 -2
  42. package/dist/_chunks/tr-BVj1O5ch.js.map +1 -0
  43. package/dist/_chunks/{tr-Dw_jmkG-.mjs → tr-Ccu6Yj11.mjs} +1 -2
  44. package/dist/_chunks/tr-Ccu6Yj11.mjs.map +1 -0
  45. package/dist/_chunks/{zh-57YM4amO.mjs → zh-BIz395Ms.mjs} +1 -2
  46. package/dist/_chunks/zh-BIz395Ms.mjs.map +1 -0
  47. package/dist/_chunks/{zh-Hans-Dyc-aR-h.mjs → zh-Hans-Bfo6_TCM.mjs} +1 -2
  48. package/dist/_chunks/zh-Hans-Bfo6_TCM.mjs.map +1 -0
  49. package/dist/_chunks/{zh-Hans-DSHIXAa3.js → zh-Hans-DIEm_EMC.js} +1 -2
  50. package/dist/_chunks/zh-Hans-DIEm_EMC.js.map +1 -0
  51. package/dist/_chunks/{zh-CukOviB0.js → zh-wkBPBkhc.js} +1 -2
  52. package/dist/_chunks/zh-wkBPBkhc.js.map +1 -0
  53. package/dist/admin/index.js +1 -1
  54. package/dist/admin/index.mjs +1 -1
  55. package/dist/admin/src/components/CMHeaderActions.d.ts +1 -1
  56. package/dist/admin/src/components/LocaleListCell.d.ts +4 -4
  57. package/dist/server/index.js +34 -4
  58. package/dist/server/index.js.map +1 -1
  59. package/dist/server/index.mjs +35 -4
  60. package/dist/server/index.mjs.map +1 -1
  61. package/dist/server/src/index.d.ts +6 -0
  62. package/dist/server/src/index.d.ts.map +1 -1
  63. package/dist/server/src/register.d.ts.map +1 -1
  64. package/dist/server/src/services/index.d.ts +6 -0
  65. package/dist/server/src/services/index.d.ts.map +1 -1
  66. package/dist/server/src/services/sanitize/index.d.ts +11 -0
  67. package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
  68. package/dist/server/src/utils/index.d.ts +2 -0
  69. package/dist/server/src/utils/index.d.ts.map +1 -1
  70. package/package.json +13 -14
  71. package/dist/_chunks/de-9eCAqqrB.mjs.map +0 -1
  72. package/dist/_chunks/de-DtWiGdHl.js.map +0 -1
  73. package/dist/_chunks/dk-2qBjxt-P.mjs.map +0 -1
  74. package/dist/_chunks/dk-D8C-casx.js.map +0 -1
  75. package/dist/_chunks/en-BKBz3tro.js.map +0 -1
  76. package/dist/_chunks/en-DlXfy6Gy.mjs.map +0 -1
  77. package/dist/_chunks/es-DS-XFGSw.js.map +0 -1
  78. package/dist/_chunks/es-DlmMVaBG.mjs.map +0 -1
  79. package/dist/_chunks/fr-3S6ke71d.mjs.map +0 -1
  80. package/dist/_chunks/fr-BTjekDpq.js.map +0 -1
  81. package/dist/_chunks/index-BGhYo_Rs.mjs.map +0 -1
  82. package/dist/_chunks/index-BOvOaxo-.js.map +0 -1
  83. package/dist/_chunks/ko-DmcGUBQ3.js.map +0 -1
  84. package/dist/_chunks/ko-qTjQ8IMw.mjs.map +0 -1
  85. package/dist/_chunks/pl-B67TSHqT.mjs.map +0 -1
  86. package/dist/_chunks/pl-Cn5RYonZ.js.map +0 -1
  87. package/dist/_chunks/ru-BMBgVL3s.js.map +0 -1
  88. package/dist/_chunks/ru-hagMa57T.mjs.map +0 -1
  89. package/dist/_chunks/tr-CarUU76c.js.map +0 -1
  90. package/dist/_chunks/tr-Dw_jmkG-.mjs.map +0 -1
  91. package/dist/_chunks/zh-57YM4amO.mjs.map +0 -1
  92. package/dist/_chunks/zh-CukOviB0.js.map +0 -1
  93. package/dist/_chunks/zh-Hans-DSHIXAa3.js.map +0 -1
  94. package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs.map +0 -1
@@ -71,11 +71,10 @@ const en = {
71
71
  "plugin.description.long": "This plugin enables to create, to read and to update content in different languages, both from the Admin Panel and from the API.",
72
72
  "plugin.description.short": "This plugin enables to create, to read and to update content in different languages, both from the Admin Panel and from the API.",
73
73
  "plugin.name": "Internationalization",
74
- "plugin.schema.i18n.ensure-unique-localization": "Unique fields must be localized",
75
74
  "plugin.schema.i18n.localized.description-content-type": "Allows translating an entry into different languages",
76
75
  "plugin.schema.i18n.localized.description-field": "The field can have different values in each language",
77
76
  "plugin.schema.i18n.localized.label-content-type": "Internationalization",
78
77
  "plugin.schema.i18n.localized.label-field": "Enable localization for this field"
79
78
  };
80
79
  exports.default = en;
81
- //# sourceMappingURL=en-BKBz3tro.js.map
80
+ //# sourceMappingURL=en-UlC0jh2t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-UlC0jh2t.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -54,7 +54,6 @@ const es = {
54
54
  "plugin.description.long": "Este plugin permite crear, leer y actualizar contenido en diferentes idiomas, tanto desde el Panel de Administración como desde la API.",
55
55
  "plugin.description.short": "Este plugin permite crear, leer y actualizar contenido en diferentes idiomas, tanto desde el Panel de Administración como desde la API.",
56
56
  "plugin.name": "Internacionalización",
57
- "plugin.schema.i18n.ensure-unique-localization": "Los campos únicos deben estar localizados",
58
57
  "plugin.schema.i18n.localized.description-content-type": "Permitir que tengas contenido en diferentes configuraciones regionales.",
59
58
  "plugin.schema.i18n.localized.description-field": "El campo puede tener distintos valores en cada configuración regional.",
60
59
  "plugin.schema.i18n.localized.label-content-type": "Habilitar la localización para este Content-Type",
@@ -63,4 +62,4 @@ const es = {
63
62
  export {
64
63
  es as default
65
64
  };
66
- //# sourceMappingURL=es-DlmMVaBG.mjs.map
65
+ //# sourceMappingURL=es-V8WnPN7w.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es-V8WnPN7w.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -56,11 +56,10 @@ const es = {
56
56
  "plugin.description.long": "Este plugin permite crear, leer y actualizar contenido en diferentes idiomas, tanto desde el Panel de Administración como desde la API.",
57
57
  "plugin.description.short": "Este plugin permite crear, leer y actualizar contenido en diferentes idiomas, tanto desde el Panel de Administración como desde la API.",
58
58
  "plugin.name": "Internacionalización",
59
- "plugin.schema.i18n.ensure-unique-localization": "Los campos únicos deben estar localizados",
60
59
  "plugin.schema.i18n.localized.description-content-type": "Permitir que tengas contenido en diferentes configuraciones regionales.",
61
60
  "plugin.schema.i18n.localized.description-field": "El campo puede tener distintos valores en cada configuración regional.",
62
61
  "plugin.schema.i18n.localized.label-content-type": "Habilitar la localización para este Content-Type",
63
62
  "plugin.schema.i18n.localized.label-field": "Habilitar la localización para este campo"
64
63
  };
65
64
  exports.default = es;
66
- //# sourceMappingURL=es-DS-XFGSw.js.map
65
+ //# sourceMappingURL=es-hr9b_HLp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es-hr9b_HLp.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -56,11 +56,10 @@ const fr = {
56
56
  "plugin.description.long": "Créez, lisez et modifiez votre contenu en différentes langues depuis le panel d'administration et votre API.",
57
57
  "plugin.description.short": "Créez, lisez et modifiez votre contenu en différentes langues depuis le panel d'administration et votre API.",
58
58
  "plugin.name": "Internationalisation",
59
- "plugin.schema.i18n.ensure-unique-localization": "Les champs uniques doivent avoir une locale",
60
59
  "plugin.schema.i18n.localized.description-content-type": "Donne la possibilité d'avoir du contenu dans différentes locales",
61
60
  "plugin.schema.i18n.localized.description-field": "Le champ peut avoir des valeurs différentes dans chaque locale",
62
61
  "plugin.schema.i18n.localized.label-content-type": "Activer la localisation pour ce type de contenu",
63
62
  "plugin.schema.i18n.localized.label-field": "Activer la localisation pour ce champ"
64
63
  };
65
64
  exports.default = fr;
66
- //# sourceMappingURL=fr-BTjekDpq.js.map
65
+ //# sourceMappingURL=fr-BFmBbE0H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr-BFmBbE0H.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -54,7 +54,6 @@ const fr = {
54
54
  "plugin.description.long": "Créez, lisez et modifiez votre contenu en différentes langues depuis le panel d'administration et votre API.",
55
55
  "plugin.description.short": "Créez, lisez et modifiez votre contenu en différentes langues depuis le panel d'administration et votre API.",
56
56
  "plugin.name": "Internationalisation",
57
- "plugin.schema.i18n.ensure-unique-localization": "Les champs uniques doivent avoir une locale",
58
57
  "plugin.schema.i18n.localized.description-content-type": "Donne la possibilité d'avoir du contenu dans différentes locales",
59
58
  "plugin.schema.i18n.localized.description-field": "Le champ peut avoir des valeurs différentes dans chaque locale",
60
59
  "plugin.schema.i18n.localized.label-content-type": "Activer la localisation pour ce type de contenu",
@@ -63,4 +62,4 @@ const fr = {
63
62
  export {
64
63
  fr as default
65
64
  };
66
- //# sourceMappingURL=fr-3S6ke71d.mjs.map
65
+ //# sourceMappingURL=fr-F94noFiV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr-F94noFiV.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -13,13 +13,20 @@ import { useParams, Link, useNavigate, matchPath } from "react-router-dom";
13
13
  import * as qs from "qs";
14
14
  import { stringify } from "qs";
15
15
  import omit from "lodash/omit";
16
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
16
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
17
17
  const v = glob[path];
18
18
  if (v) {
19
19
  return typeof v === "function" ? v() : Promise.resolve(v);
20
20
  }
21
21
  return new Promise((_, reject) => {
22
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
22
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
23
+ reject.bind(
24
+ null,
25
+ new Error(
26
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
27
+ )
28
+ )
29
+ );
23
30
  });
24
31
  };
25
32
  const pluginId = "i18n";
@@ -459,7 +466,6 @@ const BulkLocaleActionModal = ({
459
466
  paddingRight: "6px",
460
467
  paddingTop: "2px",
461
468
  paddingBottom: "2px",
462
- showBullet: false,
463
469
  size: "S",
464
470
  variant: statusVariant,
465
471
  children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
@@ -525,7 +531,6 @@ const LocaleOption = ({
525
531
  paddingRight: "6px",
526
532
  paddingTop: "2px",
527
533
  paddingBottom: "2px",
528
- showBullet: false,
529
534
  size: "S",
530
535
  variant: statusVariants[status],
531
536
  children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
@@ -577,17 +582,20 @@ const LocalePickerAction = ({
577
582
  const currentLocale = Array.isArray(locales) ? locales.find((locale) => locale.code === currentDesiredLocale) : void 0;
578
583
  const allCurrentLocales = [
579
584
  { status: getDocumentStatus(document, meta), locale: currentLocale?.code },
580
- ...meta?.availableLocales ?? []
585
+ ...document?.localizations ?? []
581
586
  ];
582
587
  if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {
583
588
  return null;
584
589
  }
590
+ const displayedLocales = locales.filter((locale) => {
591
+ return canRead.includes(locale.code);
592
+ });
585
593
  return {
586
594
  label: formatMessage({
587
595
  id: getTranslation("Settings.locales.modal.locales.label"),
588
596
  defaultMessage: "Locales"
589
597
  }),
590
- options: locales.map((locale) => {
598
+ options: displayedLocales.map((locale) => {
591
599
  const entryWithLocaleExists = allCurrentLocales.some((doc) => doc.locale === locale.code);
592
600
  const currentLocaleDoc = allCurrentLocales.find(
593
601
  (doc) => "locale" in doc ? doc.locale === locale.code : false
@@ -632,6 +640,7 @@ const FillFromAnotherLocaleAction = ({
632
640
  }) => {
633
641
  const { formatMessage } = useIntl();
634
642
  const [{ query }] = useQueryParams();
643
+ const { hasI18n } = useI18n();
635
644
  const currentDesiredLocale = query.plugins?.i18n?.locale;
636
645
  const [localeSelected, setLocaleSelected] = React.useState(null);
637
646
  const setValues = useForm("FillFromAnotherLocale", (state) => state.setValues);
@@ -659,6 +668,9 @@ const FillFromAnotherLocaleAction = ({
659
668
  setValues(cleanedData);
660
669
  onClose();
661
670
  };
671
+ if (!hasI18n) {
672
+ return null;
673
+ }
662
674
  return {
663
675
  type: "icon",
664
676
  icon: /* @__PURE__ */ jsx(Download, {}),
@@ -789,13 +801,13 @@ const DeleteLocaleAction = ({
789
801
  };
790
802
  };
791
803
  const BulkLocaleAction = ({
792
- document: baseDocument,
804
+ document,
793
805
  documentId,
794
806
  model,
795
807
  collectionType,
796
808
  action
797
809
  }) => {
798
- const baseLocale = baseDocument?.locale ?? null;
810
+ const locale = document?.locale ?? null;
799
811
  const [{ query }] = useQueryParams();
800
812
  const params = React.useMemo(() => buildValidParams(query), [query]);
801
813
  const isOnPublishedTab = query.status === "published";
@@ -806,22 +818,18 @@ const BulkLocaleAction = ({
806
818
  const [selectedRows, setSelectedRows] = React.useState([]);
807
819
  const [isDraftRelationConfirmationOpen, setIsDraftRelationConfirmationOpen] = React.useState(false);
808
820
  const { publishMany: publishManyAction, unpublishMany: unpublishManyAction } = unstable_useDocumentActions();
809
- const {
810
- document,
811
- meta: documentMeta,
812
- schema,
813
- validate
814
- } = unstable_useDocument(
821
+ const { schema, validate } = unstable_useDocument(
815
822
  {
816
823
  model,
817
824
  collectionType,
818
825
  documentId,
819
826
  params: {
820
- locale: baseLocale
827
+ locale
821
828
  }
822
829
  },
823
830
  {
824
- skip: !hasI18n || !baseLocale
831
+ // No need to fetch the document, the data is already available in the `document` prop
832
+ skip: true
825
833
  }
826
834
  );
827
835
  const { data: localesMetadata = [] } = useGetLocalesQuery(hasI18n ? void 0 : skipToken);
@@ -849,18 +857,19 @@ const BulkLocaleAction = ({
849
857
  }
850
858
  ];
851
859
  const [rows, validationErrors] = React.useMemo(() => {
852
- if (!document || !documentMeta?.availableLocales) {
860
+ if (!document) {
853
861
  return [[], {}];
854
862
  }
855
- const rowsFromMeta = documentMeta?.availableLocales.map((doc) => {
856
- const { locale, status } = doc;
857
- return { locale, status };
863
+ const localizations = document.localizations ?? [];
864
+ const locales = localizations.map((doc) => {
865
+ const { locale: locale2, status } = doc;
866
+ return { locale: locale2, status };
858
867
  });
859
- rowsFromMeta.unshift({
868
+ locales.unshift({
860
869
  locale: document.locale,
861
870
  status: document.status
862
871
  });
863
- const allDocuments = [document, ...documentMeta?.availableLocales ?? []];
872
+ const allDocuments = [document, ...localizations];
864
873
  const errors = allDocuments.reduce((errs, document2) => {
865
874
  if (!document2) {
866
875
  return errs;
@@ -871,8 +880,8 @@ const BulkLocaleAction = ({
871
880
  }
872
881
  return errs;
873
882
  }, {});
874
- return [rowsFromMeta, errors];
875
- }, [document, documentMeta?.availableLocales, validate]);
883
+ return [locales, errors];
884
+ }, [document, validate]);
876
885
  const isBulkPublish = action === "bulk-publish";
877
886
  const localesForAction = selectedRows.reduce((acc, selectedRow) => {
878
887
  const isValidLocale = (
@@ -982,7 +991,7 @@ const BulkLocaleAction = ({
982
991
  }
983
992
  };
984
993
  }
985
- const hasPermission = selectedRows.map(({ locale }) => locale).every((locale) => canPublish.includes(locale));
994
+ const hasPermission = selectedRows.map(({ locale: locale2 }) => locale2).every((locale2) => canPublish.includes(locale2));
986
995
  return {
987
996
  label: formatMessage({
988
997
  id: getTranslation(`CMEditViewBulkLocale.${isBulkPublish ? "publish" : "unpublish"}-title`),
@@ -1225,29 +1234,16 @@ const Span = styled(Flex)`
1225
1234
  }
1226
1235
  }
1227
1236
  `;
1228
- const LocaleListCell = ({
1229
- documentId,
1230
- locale: currentLocale,
1231
- collectionType,
1232
- model
1233
- }) => {
1234
- const { meta, isLoading } = unstable_useDocument({
1235
- documentId,
1236
- collectionType,
1237
- model,
1238
- params: {
1239
- locale: currentLocale
1240
- }
1241
- });
1237
+ const LocaleListCell = ({ locale: currentLocale, localizations }) => {
1242
1238
  const { locale: language } = useIntl();
1243
1239
  const { data: locales = [] } = useGetLocalesQuery();
1244
1240
  const formatter = useCollator(language, {
1245
1241
  sensitivity: "base"
1246
1242
  });
1247
- if (!Array.isArray(locales) || isLoading) {
1243
+ if (!Array.isArray(locales) || !localizations) {
1248
1244
  return null;
1249
1245
  }
1250
- const availableLocales = meta?.availableLocales.map((doc) => doc.locale) ?? [];
1246
+ const availableLocales = localizations.map((loc) => loc.locale);
1251
1247
  const localesForDocument = locales.reduce((acc, locale) => {
1252
1248
  const createdLocale = [currentLocale, ...availableLocales].find((loc) => {
1253
1249
  return loc === locale.code;
@@ -1464,7 +1460,7 @@ const index = {
1464
1460
  },
1465
1461
  id: "internationalization",
1466
1462
  to: "internationalization",
1467
- Component: () => import("./SettingsPage-D_53Ao8I.mjs").then((mod) => ({ default: mod.ProtectedSettingsPage })),
1463
+ Component: () => import("./SettingsPage-B-KzAqT3.mjs").then((mod) => ({ default: mod.ProtectedSettingsPage })),
1468
1464
  permissions: PERMISSIONS.accessMain
1469
1465
  });
1470
1466
  const contentManager = app.getPlugin("content-manager");
@@ -1526,24 +1522,6 @@ const index = {
1526
1522
  }
1527
1523
  });
1528
1524
  ctbFormsAPI.extendFields(LOCALIZED_FIELDS, {
1529
- validator: (args) => ({
1530
- i18n: yup.object().shape({
1531
- localized: yup.bool().test({
1532
- name: "ensure-unique-localization",
1533
- message: getTranslation("plugin.schema.i18n.ensure-unique-localization"),
1534
- test(value) {
1535
- if (value === void 0 || value) {
1536
- return true;
1537
- }
1538
- const unique = get(args, ["3", "modifiedData", "unique"], null);
1539
- if (unique && !value) {
1540
- return false;
1541
- }
1542
- return true;
1543
- }
1544
- })
1545
- })
1546
- }),
1547
1525
  form: {
1548
1526
  advanced({ contentTypeSchema, forTarget, type, step }) {
1549
1527
  if (forTarget !== "contentType") {
@@ -1582,7 +1560,7 @@ const index = {
1582
1560
  async registerTrads({ locales }) {
1583
1561
  const importedTrads = await Promise.all(
1584
1562
  locales.map((locale) => {
1585
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-9eCAqqrB.mjs"), "./translations/dk.json": () => import("./dk-2qBjxt-P.mjs"), "./translations/en.json": () => import("./en-DlXfy6Gy.mjs"), "./translations/es.json": () => import("./es-DlmMVaBG.mjs"), "./translations/fr.json": () => import("./fr-3S6ke71d.mjs"), "./translations/ko.json": () => import("./ko-qTjQ8IMw.mjs"), "./translations/pl.json": () => import("./pl-B67TSHqT.mjs"), "./translations/ru.json": () => import("./ru-hagMa57T.mjs"), "./translations/tr.json": () => import("./tr-Dw_jmkG-.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-Dyc-aR-h.mjs"), "./translations/zh.json": () => import("./zh-57YM4amO.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
1563
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-D80IRBP9.mjs"), "./translations/dk.json": () => import("./dk-CJ6Zzz78.mjs"), "./translations/en.json": () => import("./en-BTyF7WVW.mjs"), "./translations/es.json": () => import("./es-V8WnPN7w.mjs"), "./translations/fr.json": () => import("./fr-F94noFiV.mjs"), "./translations/ko.json": () => import("./ko-CF-P3Car.mjs"), "./translations/pl.json": () => import("./pl-Dxr9RUmD.mjs"), "./translations/ru.json": () => import("./ru-B-4sVwXN.mjs"), "./translations/tr.json": () => import("./tr-Ccu6Yj11.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-Bfo6_TCM.mjs"), "./translations/zh.json": () => import("./zh-BIz395Ms.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
1586
1564
  return {
1587
1565
  data: prefixPluginTranslations(data, pluginId),
1588
1566
  locale
@@ -1608,4 +1586,4 @@ export {
1608
1586
  index as i,
1609
1587
  useCreateLocaleMutation as u
1610
1588
  };
1611
- //# sourceMappingURL=index-BGhYo_Rs.mjs.map
1589
+ //# sourceMappingURL=index-BcYj5jo9.mjs.map