@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.
@@ -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";
@@ -1395,9 +1402,6 @@ const localeMiddleware = (ctx) => (next) => (permissions) => {
1395
1402
  return next(revisedPermissions);
1396
1403
  };
1397
1404
  const prefixPluginTranslations = (trad, pluginId2) => {
1398
- if (!pluginId2) {
1399
- throw new TypeError("pluginId can't be empty");
1400
- }
1401
1405
  return Object.keys(trad).reduce((acc, current) => {
1402
1406
  acc[`${pluginId2}.${current}`] = trad[current];
1403
1407
  return acc;
@@ -1467,7 +1471,7 @@ const index = {
1467
1471
  },
1468
1472
  id: "internationalization",
1469
1473
  to: "internationalization",
1470
- Component: () => import("./SettingsPage-DbRFoF_H.mjs").then((mod) => ({ default: mod.ProtectedSettingsPage })),
1474
+ Component: () => import("./SettingsPage-BWEhlJzY.mjs").then((mod) => ({ default: mod.ProtectedSettingsPage })),
1471
1475
  permissions: PERMISSIONS.accessMain
1472
1476
  });
1473
1477
  const contentManager = app.getPlugin("content-manager");
@@ -1585,7 +1589,7 @@ const index = {
1585
1589
  async registerTrads({ locales }) {
1586
1590
  const importedTrads = await Promise.all(
1587
1591
  locales.map((locale) => {
1588
- 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-BYRZFDBV.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 }) => {
1592
+ 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`, 3).then(({ default: data }) => {
1589
1593
  return {
1590
1594
  data: prefixPluginTranslations(data, pluginId),
1591
1595
  locale
@@ -1611,4 +1615,4 @@ export {
1611
1615
  index as i,
1612
1616
  useCreateLocaleMutation as u
1613
1617
  };
1614
- //# sourceMappingURL=index-7_EUScSl.mjs.map
1618
+ //# sourceMappingURL=index-C6Fyjx-i.mjs.map