@strapi/i18n 0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be → 0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76

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.
@@ -15,8 +15,7 @@ const qs = require("qs");
15
15
  const omit = require("lodash/omit");
16
16
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
17
17
  function _interopNamespace(e) {
18
- if (e && e.__esModule)
19
- return e;
18
+ if (e && e.__esModule) return e;
20
19
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
21
20
  if (e) {
22
21
  for (const k in e) {
@@ -37,13 +36,20 @@ const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
37
36
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
38
37
  const qs__namespace = /* @__PURE__ */ _interopNamespace(qs);
39
38
  const omit__default = /* @__PURE__ */ _interopDefault(omit);
40
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
39
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
41
40
  const v = glob[path];
42
41
  if (v) {
43
42
  return typeof v === "function" ? v() : Promise.resolve(v);
44
43
  }
45
44
  return new Promise((_, reject) => {
46
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
45
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
46
+ reject.bind(
47
+ null,
48
+ new Error(
49
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
50
+ )
51
+ )
52
+ );
47
53
  });
48
54
  };
49
55
  const pluginId = "i18n";
@@ -1419,9 +1425,6 @@ const localeMiddleware = (ctx) => (next) => (permissions) => {
1419
1425
  return next(revisedPermissions);
1420
1426
  };
1421
1427
  const prefixPluginTranslations = (trad, pluginId2) => {
1422
- if (!pluginId2) {
1423
- throw new TypeError("pluginId can't be empty");
1424
- }
1425
1428
  return Object.keys(trad).reduce((acc, current) => {
1426
1429
  acc[`${pluginId2}.${current}`] = trad[current];
1427
1430
  return acc;
@@ -1491,7 +1494,7 @@ const index = {
1491
1494
  },
1492
1495
  id: "internationalization",
1493
1496
  to: "internationalization",
1494
- Component: () => Promise.resolve().then(() => require("./SettingsPage-uGJv15wR.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
1497
+ Component: () => Promise.resolve().then(() => require("./SettingsPage-DqW7hbxl.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
1495
1498
  permissions: PERMISSIONS.accessMain
1496
1499
  });
1497
1500
  const contentManager = app.getPlugin("content-manager");
@@ -1609,7 +1612,7 @@ const index = {
1609
1612
  async registerTrads({ locales }) {
1610
1613
  const importedTrads = await Promise.all(
1611
1614
  locales.map((locale) => {
1612
- 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-Dk9At9_Z.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 }) => {
1615
+ 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`, 3).then(({ default: data }) => {
1613
1616
  return {
1614
1617
  data: prefixPluginTranslations(data, pluginId),
1615
1618
  locale
@@ -1633,4 +1636,4 @@ exports.useDeleteLocaleMutation = useDeleteLocaleMutation;
1633
1636
  exports.useGetDefaultLocalesQuery = useGetDefaultLocalesQuery;
1634
1637
  exports.useGetLocalesQuery = useGetLocalesQuery;
1635
1638
  exports.useUpdateLocaleMutation = useUpdateLocaleMutation;
1636
- //# sourceMappingURL=index-BGtXLYX-.js.map
1639
+ //# sourceMappingURL=index-93hDLj9o.js.map