@burdenoff/microfe-i18n 2026.1125.1 → 2026.1126.1

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.
@@ -9,101 +9,102 @@ import s from "../node_modules/lucide-react/dist/esm/icons/settings.js";
9
9
  import { I18nProvider as c } from "./providers/I18nProvider.js";
10
10
  import { useTr as l } from "./hooks/useTr.js";
11
11
  import { I18nRoutes as u } from "./I18nRoutes.js";
12
- import { useEffect as d } from "react";
13
- import { jsx as f } from "react/jsx-runtime";
14
- import { FeatureFlagProvider as p } from "@burdenoff/fe-libs/shared/feature-flags";
12
+ import { joinPath as d } from "./utils/paths.js";
13
+ import { useEffect as f } from "react";
14
+ import { jsx as p } from "react/jsx-runtime";
15
+ import { FeatureFlagProvider as m } from "@burdenoff/fe-libs/shared/feature-flags";
15
16
  // src/i18n/I18nRoot.tsx
16
- var m = ({ basePath: c, registerNavItems: p, registerFooterItems: m }) => {
17
- let h = l(), g = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
18
- return d(() => {
19
- if (p) return p([
17
+ var h = ({ basePath: c, registerNavItems: m, registerFooterItems: h }) => {
18
+ let g = l();
19
+ return f(() => {
20
+ if (m) return m([
20
21
  {
21
22
  id: "i18n-languages",
22
- label: h("i18n.nav.languages", "Languages"),
23
- path: g(c, "languages"),
24
- icon: /* @__PURE__ */ f(e, { size: 20 }),
23
+ label: g("i18n.nav.languages", "Languages"),
24
+ path: d(c, "languages"),
25
+ icon: /* @__PURE__ */ p(e, { size: 20 }),
25
26
  order: 10,
26
27
  group: "i18n"
27
28
  },
28
29
  {
29
30
  id: "i18n-products",
30
- label: h("i18n.nav.products", "Products"),
31
- path: g(c, "products"),
32
- icon: /* @__PURE__ */ f(t, { size: 20 }),
31
+ label: g("i18n.nav.products", "Products"),
32
+ path: d(c, "products"),
33
+ icon: /* @__PURE__ */ p(t, { size: 20 }),
33
34
  order: 20,
34
35
  group: "i18n"
35
36
  },
36
37
  {
37
38
  id: "i18n-editor",
38
- label: h("i18n.nav.translationEditor", "Translation Editor"),
39
- path: g(c, "editor"),
40
- icon: /* @__PURE__ */ f(n, { size: 20 }),
39
+ label: g("i18n.nav.translationEditor", "Translation Editor"),
40
+ path: d(c, "editor"),
41
+ icon: /* @__PURE__ */ p(n, { size: 20 }),
41
42
  order: 30,
42
43
  group: "i18n"
43
44
  },
44
45
  {
45
46
  id: "i18n-progress",
46
- label: h("i18n.nav.progress", "Progress"),
47
- path: g(c, "progress"),
48
- icon: /* @__PURE__ */ f(r, { size: 20 }),
47
+ label: g("i18n.nav.progress", "Progress"),
48
+ path: d(c, "progress"),
49
+ icon: /* @__PURE__ */ p(r, { size: 20 }),
49
50
  order: 40,
50
51
  group: "i18n"
51
52
  },
52
53
  {
53
54
  id: "i18n-review",
54
- label: h("i18n.nav.reviewQueue", "Review Queue"),
55
- path: g(c, "review"),
56
- icon: /* @__PURE__ */ f(i, { size: 20 }),
55
+ label: g("i18n.nav.reviewQueue", "Review Queue"),
56
+ path: d(c, "review"),
57
+ icon: /* @__PURE__ */ p(i, { size: 20 }),
57
58
  order: 50,
58
59
  group: "i18n"
59
60
  },
60
61
  {
61
62
  id: "i18n-import",
62
- label: h("i18n.nav.import", "Import"),
63
- path: g(c, "import"),
64
- icon: /* @__PURE__ */ f(a, { size: 20 }),
63
+ label: g("i18n.nav.import", "Import"),
64
+ path: d(c, "import"),
65
+ icon: /* @__PURE__ */ p(a, { size: 20 }),
65
66
  order: 60,
66
67
  group: "i18n"
67
68
  },
68
69
  {
69
70
  id: "i18n-export",
70
- label: h("i18n.nav.export", "Export"),
71
- path: g(c, "export"),
72
- icon: /* @__PURE__ */ f(o, { size: 20 }),
71
+ label: g("i18n.nav.export", "Export"),
72
+ path: d(c, "export"),
73
+ icon: /* @__PURE__ */ p(o, { size: 20 }),
73
74
  order: 70,
74
75
  group: "i18n"
75
76
  },
76
77
  {
77
78
  id: "i18n-locales",
78
- label: h("i18n.nav.localeSettings", "Locale Settings"),
79
- path: g(c, "locales"),
80
- icon: /* @__PURE__ */ f(s, { size: 20 }),
79
+ label: g("i18n.nav.localeSettings", "Locale Settings"),
80
+ path: d(c, "locales"),
81
+ icon: /* @__PURE__ */ p(s, { size: 20 }),
81
82
  order: 80,
82
83
  group: "i18n"
83
84
  }
84
85
  ]);
85
86
  }, [
86
- p,
87
+ m,
87
88
  c,
88
- h
89
- ]), d(() => {
90
- if (m) return m([{
89
+ g
90
+ ]), f(() => {
91
+ if (h) return h([{
91
92
  id: "i18n-status",
92
- label: h("i18n.footer.status", "I18n Ready"),
93
+ label: g("i18n.footer.status", "I18n Ready"),
93
94
  type: "status",
94
95
  order: 10,
95
96
  section: "left"
96
97
  }]);
97
- }, [m, h]), /* @__PURE__ */ f(u, {});
98
- }, h = (e) => {
98
+ }, [h, g]), /* @__PURE__ */ p(u, { basePath: c });
99
+ }, g = (e) => {
99
100
  let { registerNavItems: t, registerFooterItems: n, basePath: r = "/" } = e;
100
- return /* @__PURE__ */ f(p, {
101
+ return /* @__PURE__ */ p(m, {
101
102
  workspaceId: null,
102
103
  gateway: "global",
103
104
  defaultEnabled: !0,
104
- children: /* @__PURE__ */ f(c, {
105
+ children: /* @__PURE__ */ p(c, {
105
106
  ...e,
106
- children: /* @__PURE__ */ f(m, {
107
+ children: /* @__PURE__ */ p(h, {
107
108
  basePath: r,
108
109
  registerNavItems: t,
109
110
  registerFooterItems: n
@@ -111,4 +112,4 @@ var m = ({ basePath: c, registerNavItems: p, registerFooterItems: m }) => {
111
112
  })
112
113
  });
113
114
  };
114
- export { h as I18nRoot };
115
+ export { g as I18nRoot };
@@ -19,5 +19,13 @@
19
19
  * - /export → Export translations
20
20
  * - /locales → Locale configuration list
21
21
  * - /locales/:code → Locale configuration for specific language
22
+ *
23
+ * Redirects use ABSOLUTE paths built from `basePath` (BOFF-16781). A relative
24
+ * `to` inside the catch-all resolves against the whole unmatched address
25
+ * (React Router's splat rule), so `/i18n/products/<id>` went to
26
+ * `/i18n/products/<id>/languages`, which hit the catch-all again and grew
27
+ * "/languages" for ever.
22
28
  */
23
- export declare function I18nRoutes(): import('react').JSX.Element;
29
+ export declare function I18nRoutes({ basePath }: {
30
+ basePath?: string;
31
+ }): import('react').JSX.Element;
@@ -5,77 +5,86 @@ import { ProgressDashboardPage as r } from "./pages/ProgressDashboardPage.js";
5
5
  import { ReviewQueuePage as i } from "./pages/ReviewQueuePage.js";
6
6
  import { ImportExportPage as a } from "./pages/ImportExportPage.js";
7
7
  import { LocaleConfigPage as o } from "./pages/LocaleConfigPage.js";
8
- import { Navigate as s, Route as c, Routes as l } from "react-router";
9
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import { joinPath as s } from "./utils/paths.js";
9
+ import { Navigate as c, Route as l, Routes as u } from "react-router";
10
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
11
  // src/i18n/I18nRoutes.tsx
11
- function f() {
12
- return /* @__PURE__ */ d(l, { children: [
13
- /* @__PURE__ */ u(c, {
12
+ function p({ basePath: p = "/" }) {
13
+ let m = s(p, "languages"), h = s(p, "products");
14
+ return /* @__PURE__ */ f(u, { children: [
15
+ /* @__PURE__ */ d(l, {
14
16
  index: !0,
15
- element: /* @__PURE__ */ u(s, {
16
- to: "languages",
17
+ element: /* @__PURE__ */ d(c, {
18
+ to: m,
17
19
  replace: !0
18
20
  })
19
21
  }),
20
- /* @__PURE__ */ u(c, {
22
+ /* @__PURE__ */ d(l, {
21
23
  path: "languages",
22
- element: /* @__PURE__ */ u(e, {})
24
+ element: /* @__PURE__ */ d(e, {})
23
25
  }),
24
- /* @__PURE__ */ u(c, {
26
+ /* @__PURE__ */ d(l, {
25
27
  path: "languages/new",
26
- element: /* @__PURE__ */ u(o, {})
28
+ element: /* @__PURE__ */ d(o, {})
27
29
  }),
28
- /* @__PURE__ */ u(c, {
30
+ /* @__PURE__ */ d(l, {
29
31
  path: "languages/:code",
30
- element: /* @__PURE__ */ u(o, {})
32
+ element: /* @__PURE__ */ d(o, {})
31
33
  }),
32
- /* @__PURE__ */ u(c, {
34
+ /* @__PURE__ */ d(l, {
33
35
  path: "products",
34
- element: /* @__PURE__ */ u(t, {})
36
+ element: /* @__PURE__ */ d(t, {})
35
37
  }),
36
- /* @__PURE__ */ u(c, {
38
+ /* @__PURE__ */ d(l, {
39
+ path: "products/*",
40
+ element: /* @__PURE__ */ d(c, {
41
+ to: h,
42
+ replace: !0
43
+ })
44
+ }),
45
+ /* @__PURE__ */ d(l, {
37
46
  path: "editor",
38
- element: /* @__PURE__ */ u(n, {})
47
+ element: /* @__PURE__ */ d(n, {})
39
48
  }),
40
- /* @__PURE__ */ u(c, {
49
+ /* @__PURE__ */ d(l, {
41
50
  path: "editor/:keyId",
42
- element: /* @__PURE__ */ u(n, {})
51
+ element: /* @__PURE__ */ d(n, {})
43
52
  }),
44
- /* @__PURE__ */ u(c, {
53
+ /* @__PURE__ */ d(l, {
45
54
  path: "editor/:keyId/:languageCode",
46
- element: /* @__PURE__ */ u(n, {})
55
+ element: /* @__PURE__ */ d(n, {})
47
56
  }),
48
- /* @__PURE__ */ u(c, {
57
+ /* @__PURE__ */ d(l, {
49
58
  path: "progress",
50
- element: /* @__PURE__ */ u(r, {})
59
+ element: /* @__PURE__ */ d(r, {})
51
60
  }),
52
- /* @__PURE__ */ u(c, {
61
+ /* @__PURE__ */ d(l, {
53
62
  path: "review",
54
- element: /* @__PURE__ */ u(i, {})
63
+ element: /* @__PURE__ */ d(i, {})
55
64
  }),
56
- /* @__PURE__ */ u(c, {
65
+ /* @__PURE__ */ d(l, {
57
66
  path: "import",
58
- element: /* @__PURE__ */ u(a, { mode: "import" })
67
+ element: /* @__PURE__ */ d(a, { mode: "import" })
59
68
  }),
60
- /* @__PURE__ */ u(c, {
69
+ /* @__PURE__ */ d(l, {
61
70
  path: "export",
62
- element: /* @__PURE__ */ u(a, { mode: "export" })
71
+ element: /* @__PURE__ */ d(a, { mode: "export" })
63
72
  }),
64
- /* @__PURE__ */ u(c, {
73
+ /* @__PURE__ */ d(l, {
65
74
  path: "locales",
66
- element: /* @__PURE__ */ u(e, {})
75
+ element: /* @__PURE__ */ d(e, {})
67
76
  }),
68
- /* @__PURE__ */ u(c, {
77
+ /* @__PURE__ */ d(l, {
69
78
  path: "locales/:code",
70
- element: /* @__PURE__ */ u(o, {})
79
+ element: /* @__PURE__ */ d(o, {})
71
80
  }),
72
- /* @__PURE__ */ u(c, {
81
+ /* @__PURE__ */ d(l, {
73
82
  path: "*",
74
- element: /* @__PURE__ */ u(s, {
75
- to: "languages",
83
+ element: /* @__PURE__ */ d(c, {
84
+ to: m,
76
85
  replace: !0
77
86
  })
78
87
  })
79
88
  ] });
80
89
  }
81
- export { f as I18nRoutes };
90
+ export { p as I18nRoutes };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `base` and `path` joined with exactly one slash between them:
3
+ * `joinPath("/i18n", "languages")` and `joinPath("/i18n/", "/languages")` are
4
+ * both `/i18n/languages`, and `joinPath("/", "languages")` is `/languages`.
5
+ */
6
+ export declare function joinPath(base: string, path: string): string;
@@ -0,0 +1,5 @@
1
+ // src/i18n/utils/paths.ts
2
+ function e(e, t) {
3
+ return (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
4
+ }
5
+ export { e as joinPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-i18n",
3
- "version": "2026.1125.1",
3
+ "version": "2026.1126.1",
4
4
  "description": "Internationalization (i18n) micro-frontend module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,6 +54,7 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@burdenoff/toolchain": "2026.1107.14",
57
+ "@happy-dom/global-registrator": "21.0.4",
57
58
  "@types/bun": "^1.4.4",
58
59
  "@types/node": "^24.19.2",
59
60
  "@types/react": "^19.3.0",