@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.
- package/dist/i18n/I18nRoot.js +43 -42
- package/dist/i18n/I18nRoutes.d.ts +9 -1
- package/dist/i18n/I18nRoutes.js +46 -37
- package/dist/i18n/utils/paths.d.ts +6 -0
- package/dist/i18n/utils/paths.js +5 -0
- package/package.json +2 -1
package/dist/i18n/I18nRoot.js
CHANGED
|
@@ -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 {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
17
|
-
let
|
|
18
|
-
return
|
|
19
|
-
if (
|
|
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:
|
|
23
|
-
path:
|
|
24
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
31
|
-
path:
|
|
32
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
39
|
-
path:
|
|
40
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
47
|
-
path:
|
|
48
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
55
|
-
path:
|
|
56
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
63
|
-
path:
|
|
64
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
71
|
-
path:
|
|
72
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
79
|
-
path:
|
|
80
|
-
icon: /* @__PURE__ */
|
|
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
|
-
|
|
87
|
+
m,
|
|
87
88
|
c,
|
|
88
|
-
|
|
89
|
-
]),
|
|
90
|
-
if (
|
|
89
|
+
g
|
|
90
|
+
]), f(() => {
|
|
91
|
+
if (h) return h([{
|
|
91
92
|
id: "i18n-status",
|
|
92
|
-
label:
|
|
93
|
+
label: g("i18n.footer.status", "I18n Ready"),
|
|
93
94
|
type: "status",
|
|
94
95
|
order: 10,
|
|
95
96
|
section: "left"
|
|
96
97
|
}]);
|
|
97
|
-
}, [
|
|
98
|
-
},
|
|
98
|
+
}, [h, g]), /* @__PURE__ */ p(u, { basePath: c });
|
|
99
|
+
}, g = (e) => {
|
|
99
100
|
let { registerNavItems: t, registerFooterItems: n, basePath: r = "/" } = e;
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ p(m, {
|
|
101
102
|
workspaceId: null,
|
|
102
103
|
gateway: "global",
|
|
103
104
|
defaultEnabled: !0,
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ p(c, {
|
|
105
106
|
...e,
|
|
106
|
-
children: /* @__PURE__ */
|
|
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 {
|
|
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(
|
|
29
|
+
export declare function I18nRoutes({ basePath }: {
|
|
30
|
+
basePath?: string;
|
|
31
|
+
}): import('react').JSX.Element;
|
package/dist/i18n/I18nRoutes.js
CHANGED
|
@@ -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 {
|
|
9
|
-
import {
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
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__ */
|
|
16
|
-
to:
|
|
17
|
+
element: /* @__PURE__ */ d(c, {
|
|
18
|
+
to: m,
|
|
17
19
|
replace: !0
|
|
18
20
|
})
|
|
19
21
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ d(l, {
|
|
21
23
|
path: "languages",
|
|
22
|
-
element: /* @__PURE__ */
|
|
24
|
+
element: /* @__PURE__ */ d(e, {})
|
|
23
25
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ d(l, {
|
|
25
27
|
path: "languages/new",
|
|
26
|
-
element: /* @__PURE__ */
|
|
28
|
+
element: /* @__PURE__ */ d(o, {})
|
|
27
29
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ d(l, {
|
|
29
31
|
path: "languages/:code",
|
|
30
|
-
element: /* @__PURE__ */
|
|
32
|
+
element: /* @__PURE__ */ d(o, {})
|
|
31
33
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ d(l, {
|
|
33
35
|
path: "products",
|
|
34
|
-
element: /* @__PURE__ */
|
|
36
|
+
element: /* @__PURE__ */ d(t, {})
|
|
35
37
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
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__ */
|
|
47
|
+
element: /* @__PURE__ */ d(n, {})
|
|
39
48
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ d(l, {
|
|
41
50
|
path: "editor/:keyId",
|
|
42
|
-
element: /* @__PURE__ */
|
|
51
|
+
element: /* @__PURE__ */ d(n, {})
|
|
43
52
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ d(l, {
|
|
45
54
|
path: "editor/:keyId/:languageCode",
|
|
46
|
-
element: /* @__PURE__ */
|
|
55
|
+
element: /* @__PURE__ */ d(n, {})
|
|
47
56
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ d(l, {
|
|
49
58
|
path: "progress",
|
|
50
|
-
element: /* @__PURE__ */
|
|
59
|
+
element: /* @__PURE__ */ d(r, {})
|
|
51
60
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ d(l, {
|
|
53
62
|
path: "review",
|
|
54
|
-
element: /* @__PURE__ */
|
|
63
|
+
element: /* @__PURE__ */ d(i, {})
|
|
55
64
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ d(l, {
|
|
57
66
|
path: "import",
|
|
58
|
-
element: /* @__PURE__ */
|
|
67
|
+
element: /* @__PURE__ */ d(a, { mode: "import" })
|
|
59
68
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ d(l, {
|
|
61
70
|
path: "export",
|
|
62
|
-
element: /* @__PURE__ */
|
|
71
|
+
element: /* @__PURE__ */ d(a, { mode: "export" })
|
|
63
72
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ d(l, {
|
|
65
74
|
path: "locales",
|
|
66
|
-
element: /* @__PURE__ */
|
|
75
|
+
element: /* @__PURE__ */ d(e, {})
|
|
67
76
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ d(l, {
|
|
69
78
|
path: "locales/:code",
|
|
70
|
-
element: /* @__PURE__ */
|
|
79
|
+
element: /* @__PURE__ */ d(o, {})
|
|
71
80
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ d(l, {
|
|
73
82
|
path: "*",
|
|
74
|
-
element: /* @__PURE__ */
|
|
75
|
-
to:
|
|
83
|
+
element: /* @__PURE__ */ d(c, {
|
|
84
|
+
to: m,
|
|
76
85
|
replace: !0
|
|
77
86
|
})
|
|
78
87
|
})
|
|
79
88
|
] });
|
|
80
89
|
}
|
|
81
|
-
export {
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-i18n",
|
|
3
|
-
"version": "2026.
|
|
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",
|