@burdenoff/microfe-i18n 2026.925.1 → 2026.1108.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.d.ts +32 -0
- package/dist/i18n/I18nRoot.js +17 -18
- package/dist/i18n/I18nRoutes.d.ts +23 -0
- package/dist/i18n/I18nRoutes.js +1 -2
- package/dist/i18n/hooks/useTr.d.ts +16 -0
- package/dist/i18n/hooks/useTr.js +1 -2
- package/dist/i18n/index.d.ts +40 -0
- package/dist/i18n/pages/ImportExportPage.d.ts +8 -0
- package/dist/i18n/pages/ImportExportPage.js +14 -17
- package/dist/i18n/pages/LanguagesListPage.d.ts +6 -0
- package/dist/i18n/pages/LanguagesListPage.js +5 -6
- package/dist/i18n/pages/LocaleConfigPage.d.ts +6 -0
- package/dist/i18n/pages/LocaleConfigPage.js +7 -10
- package/dist/i18n/pages/ProductsListPage.d.ts +6 -0
- package/dist/i18n/pages/ProductsListPage.js +14 -15
- package/dist/i18n/pages/ProgressDashboardPage.d.ts +6 -0
- package/dist/i18n/pages/ProgressDashboardPage.js +10 -11
- package/dist/i18n/pages/ReviewQueuePage.d.ts +6 -0
- package/dist/i18n/pages/ReviewQueuePage.js +6 -7
- package/dist/i18n/pages/TranslationEditorPage.d.ts +6 -0
- package/dist/i18n/pages/TranslationEditorPage.js +18 -19
- package/dist/i18n/providers/I18nProvider.d.ts +19 -0
- package/dist/i18n/providers/I18nProvider.js +5 -3
- package/dist/i18n/store/i18nStore.d.ts +44 -0
- package/dist/i18n/store/i18nStore.js +1 -2
- package/dist/i18n/translations/en.d.ts +8 -0
- package/dist/i18n/translations/en.js +1 -2
- package/dist/i18n/types/index.d.ts +321 -0
- package/dist/i18n/utils/i18n.d.ts +2 -0
- package/dist/i18n/utils/i18n.js +1 -2
- package/dist/i18n.js +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +6 -7
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +2 -3
- package/dist/node_modules/lucide-react/dist/esm/icons/boxes.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check-big.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/download.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/file-text.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/globe.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/languages.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/package.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/pen-line.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/save.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/search.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/trash-2.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.js +3 -4
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +1 -2
- package/package.json +57 -40
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import e from "../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js";
|
|
2
|
+
import t from "../../node_modules/lucide-react/dist/esm/icons/circle-x.js";
|
|
3
|
+
import n from "../../node_modules/lucide-react/dist/esm/icons/message-square.js";
|
|
4
4
|
import { useTr as r } from "../hooks/useTr.js";
|
|
5
5
|
import { useRef as i, useState as a } from "react";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
import { CTAOverflowMenu as c, EmphasisPanel as l, GlassCard as u, GradientText as d, IllustratedEmptyState as f, NextSteps as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
|
|
8
|
-
|
|
8
|
+
// src/i18n/pages/ReviewQueuePage.tsx
|
|
9
9
|
var h = () => {
|
|
10
10
|
let h = r(), [g, _] = a([]), v = i(!1), y = [
|
|
11
11
|
{
|
|
@@ -38,8 +38,8 @@ var h = () => {
|
|
|
38
38
|
], b = (e) => {
|
|
39
39
|
_((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
40
40
|
}, x = (e) => {
|
|
41
|
-
|
|
42
|
-
}, S = "rounded-lg border border-border-seam bg-bg-elevated px-3 py-2.5 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]", C = g.length > 0;
|
|
41
|
+
`${e}`, _([]);
|
|
42
|
+
}, S = "rounded-lg border border-border-seam bg-bg-elevated px-3 py-2.5 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary", C = g.length > 0;
|
|
43
43
|
return /* @__PURE__ */ s("div", {
|
|
44
44
|
className: "min-h-full w-full bg-bg-surface",
|
|
45
45
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -285,5 +285,4 @@ var h = () => {
|
|
|
285
285
|
})]
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
|
-
//#endregion
|
|
289
288
|
export { h as ReviewQueuePage };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import e from "../../node_modules/lucide-react/dist/esm/icons/pen-line.js";
|
|
2
|
+
import t from "../../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
3
|
+
import n from "../../node_modules/lucide-react/dist/esm/icons/send.js";
|
|
4
|
+
import r from "../../node_modules/lucide-react/dist/esm/icons/languages.js";
|
|
5
|
+
import i from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
6
6
|
import { useTr as a } from "../hooks/useTr.js";
|
|
7
7
|
import { useI18nStore as o } from "../store/i18nStore.js";
|
|
8
8
|
import { useState as s } from "react";
|
|
9
9
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
10
|
import { CTAOverflowMenu as u, EmphasisPanel as d, GlassCard as f, GradientText as p, NextSteps as m, PagePurpose as h } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
|
|
11
|
+
// src/i18n/pages/TranslationEditorPage.tsx
|
|
12
12
|
var g = () => {
|
|
13
13
|
let g = a(), { editorMode: _, showPlurals: v, showSuggestions: y, comparisonLanguage: b, setEditorMode: x, togglePlurals: S, toggleSuggestions: C, setComparisonLanguage: w } = o(), [T, E] = s(""), [D, O] = s(""), k = {
|
|
14
14
|
id: "key-1",
|
|
@@ -23,7 +23,7 @@ var g = () => {
|
|
|
23
23
|
}, {
|
|
24
24
|
value: "Accede a tu cuenta",
|
|
25
25
|
similarity: 87
|
|
26
|
-
}], j = (e) => `rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${e ? "border-action-primary-bg bg-action-primary-bg/10 text-primary" : "border-border-seam bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`, M = "w-full rounded-lg border border-border-seam bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-tertiary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]", N = "w-full appearance-none rounded-lg border border-border-seam bg-bg-elevated py-2 pl-10 pr-10 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]";
|
|
26
|
+
}], j = (e) => `rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${e ? "border-action-primary-bg bg-action-primary-bg/10 text-primary" : "border-border-seam bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`, M = "w-full rounded-lg border border-border-seam bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-tertiary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]", N = "w-full appearance-none rounded-lg border border-border-seam bg-bg-elevated py-2 pl-10 pr-10 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary";
|
|
27
27
|
return /* @__PURE__ */ l("div", {
|
|
28
28
|
className: "flex h-full flex-col bg-bg-surface",
|
|
29
29
|
children: [
|
|
@@ -35,7 +35,7 @@ var g = () => {
|
|
|
35
35
|
className: "flex items-center gap-4",
|
|
36
36
|
children: [/* @__PURE__ */ c("div", {
|
|
37
37
|
className: "flex size-11 shrink-0 items-center justify-center rounded-xl bg-action-primary-bg/10 text-primary shadow-elevation-1",
|
|
38
|
-
children: /* @__PURE__ */ c(
|
|
38
|
+
children: /* @__PURE__ */ c(e, {
|
|
39
39
|
className: "size-5",
|
|
40
40
|
"aria-hidden": "true"
|
|
41
41
|
})
|
|
@@ -71,7 +71,7 @@ var g = () => {
|
|
|
71
71
|
value: _,
|
|
72
72
|
"aria-label": g("i18n.editor.mode.label", "Editor mode"),
|
|
73
73
|
onChange: (e) => x(e.target.value),
|
|
74
|
-
className: "rounded-lg border border-border-seam bg-bg-elevated px-3 py-2 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
|
|
74
|
+
className: "rounded-lg border border-border-seam bg-bg-elevated px-3 py-2 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
75
75
|
children: [/* @__PURE__ */ c("option", {
|
|
76
76
|
value: "simple",
|
|
77
77
|
children: g("i18n.editor.mode.simple", "Simple")
|
|
@@ -90,17 +90,17 @@ var g = () => {
|
|
|
90
90
|
className: "mx-auto flex max-w-screen-2xl items-center gap-2 text-sm text-text-secondary",
|
|
91
91
|
children: [
|
|
92
92
|
/* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.product", "Workspaces") }),
|
|
93
|
-
/* @__PURE__ */ c(
|
|
93
|
+
/* @__PURE__ */ c(i, {
|
|
94
94
|
className: "size-4 -rotate-90",
|
|
95
95
|
"aria-hidden": "true"
|
|
96
96
|
}),
|
|
97
97
|
/* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.module", "Auth") }),
|
|
98
|
-
/* @__PURE__ */ c(
|
|
98
|
+
/* @__PURE__ */ c(i, {
|
|
99
99
|
className: "size-4 -rotate-90",
|
|
100
100
|
"aria-hidden": "true"
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.namespace", "signIn") }),
|
|
103
|
-
/* @__PURE__ */ c(
|
|
103
|
+
/* @__PURE__ */ c(i, {
|
|
104
104
|
className: "size-4 -rotate-90",
|
|
105
105
|
"aria-hidden": "true"
|
|
106
106
|
}),
|
|
@@ -160,7 +160,7 @@ var g = () => {
|
|
|
160
160
|
}), /* @__PURE__ */ l("div", {
|
|
161
161
|
className: "relative",
|
|
162
162
|
children: [
|
|
163
|
-
/* @__PURE__ */ c(
|
|
163
|
+
/* @__PURE__ */ c(r, {
|
|
164
164
|
className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary",
|
|
165
165
|
"aria-hidden": "true"
|
|
166
166
|
}),
|
|
@@ -182,7 +182,7 @@ var g = () => {
|
|
|
182
182
|
})
|
|
183
183
|
]
|
|
184
184
|
}),
|
|
185
|
-
/* @__PURE__ */ c(
|
|
185
|
+
/* @__PURE__ */ c(i, {
|
|
186
186
|
className: "pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary",
|
|
187
187
|
"aria-hidden": "true"
|
|
188
188
|
})
|
|
@@ -197,7 +197,7 @@ var g = () => {
|
|
|
197
197
|
}), /* @__PURE__ */ l("div", {
|
|
198
198
|
className: "relative",
|
|
199
199
|
children: [
|
|
200
|
-
/* @__PURE__ */ c(
|
|
200
|
+
/* @__PURE__ */ c(r, {
|
|
201
201
|
className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary",
|
|
202
202
|
"aria-hidden": "true"
|
|
203
203
|
}),
|
|
@@ -214,7 +214,7 @@ var g = () => {
|
|
|
214
214
|
children: g("i18n.shared.language.en", "English (en)")
|
|
215
215
|
})]
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */ c(
|
|
217
|
+
/* @__PURE__ */ c(i, {
|
|
218
218
|
className: "pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary",
|
|
219
219
|
"aria-hidden": "true"
|
|
220
220
|
})
|
|
@@ -284,7 +284,7 @@ var g = () => {
|
|
|
284
284
|
primary: {
|
|
285
285
|
label: g("i18n.editor.actions.saveDraft", "Save Draft"),
|
|
286
286
|
onSelect: () => void 0,
|
|
287
|
-
icon: /* @__PURE__ */ c(
|
|
287
|
+
icon: /* @__PURE__ */ c(t, {
|
|
288
288
|
className: "size-4",
|
|
289
289
|
"aria-hidden": "true"
|
|
290
290
|
})
|
|
@@ -292,7 +292,7 @@ var g = () => {
|
|
|
292
292
|
actions: [{
|
|
293
293
|
label: g("i18n.editor.actions.submitForReview", "Submit for Review"),
|
|
294
294
|
onSelect: () => void 0,
|
|
295
|
-
icon: /* @__PURE__ */ c(
|
|
295
|
+
icon: /* @__PURE__ */ c(n, {
|
|
296
296
|
className: "size-4",
|
|
297
297
|
"aria-hidden": "true"
|
|
298
298
|
})
|
|
@@ -329,5 +329,4 @@ var g = () => {
|
|
|
329
329
|
]
|
|
330
330
|
});
|
|
331
331
|
};
|
|
332
|
-
//#endregion
|
|
333
332
|
export { g as TranslationEditorPage };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { I18nRootProps } from '../types';
|
|
3
|
+
import { TranslationParams } from '../utils/i18n';
|
|
4
|
+
/**
|
|
5
|
+
* Context value for I18n microfrontend
|
|
6
|
+
*/
|
|
7
|
+
interface I18nContextValue extends I18nRootProps {
|
|
8
|
+
t: (key: string, fallback?: string, params?: TranslationParams) => string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook to access I18n context
|
|
12
|
+
*/
|
|
13
|
+
export declare const useI18n: () => I18nContextValue;
|
|
14
|
+
/**
|
|
15
|
+
* Provider component for I18n microfrontend
|
|
16
|
+
* Sets up routing and context
|
|
17
|
+
*/
|
|
18
|
+
export declare const I18nProvider: FC<PropsWithChildren<I18nRootProps>>;
|
|
19
|
+
export {};
|
|
@@ -3,13 +3,16 @@ import { interpolateFallback as t } from "../utils/i18n.js";
|
|
|
3
3
|
import { createContext as n, use as r, useCallback as i, useMemo as a } from "react";
|
|
4
4
|
import { MemoryRouter as o } from "react-router";
|
|
5
5
|
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/i18n/providers/I18nProvider.tsx
|
|
7
7
|
var c = n(null), l = () => {
|
|
8
8
|
let e = r(c);
|
|
9
9
|
if (!e) throw Error("useI18n must be used within I18nProvider");
|
|
10
10
|
return e;
|
|
11
11
|
}, u = ({ children: n, basePath: r, navigate: l, currentUser: u, tenantId: d, apiGatewayUrl: f, authToken: p, translations: m, onLanguageChange: h, onTranslationPublish: g, defaultView: _ }) => {
|
|
12
|
-
let v = i((n, r, i) =>
|
|
12
|
+
let v = i((n, r, i) => {
|
|
13
|
+
let a = m?.[n] ?? e[n] ?? r ?? n;
|
|
14
|
+
return t(a, i);
|
|
15
|
+
}, [m]), y = a(() => ({
|
|
13
16
|
basePath: r,
|
|
14
17
|
navigate: l,
|
|
15
18
|
currentUser: u,
|
|
@@ -42,5 +45,4 @@ var c = n(null), l = () => {
|
|
|
42
45
|
children: /* @__PURE__ */ s(o, { children: n })
|
|
43
46
|
});
|
|
44
47
|
};
|
|
45
|
-
//#endregion
|
|
46
48
|
export { u as I18nProvider, l as useI18n };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { I18nView, I18nTab, Language, I18nProduct, I18nModule, I18nNamespace, ViewMode, EditorMode, LanguageFilter, TranslationFilter, ProgressViewConfig, ImportState, ImportError, ImportFormat } from '../types';
|
|
2
|
+
interface I18nState {
|
|
3
|
+
currentView: I18nView;
|
|
4
|
+
currentTab: I18nTab;
|
|
5
|
+
viewMode: ViewMode;
|
|
6
|
+
selectedLanguage: Language | null;
|
|
7
|
+
selectedProduct: I18nProduct | null;
|
|
8
|
+
selectedModule: I18nModule | null;
|
|
9
|
+
selectedNamespace: I18nNamespace | null;
|
|
10
|
+
editorMode: EditorMode;
|
|
11
|
+
showPlurals: boolean;
|
|
12
|
+
showSuggestions: boolean;
|
|
13
|
+
comparisonLanguage: string | null;
|
|
14
|
+
languageFilter: LanguageFilter;
|
|
15
|
+
translationFilter: TranslationFilter;
|
|
16
|
+
progressView: ProgressViewConfig;
|
|
17
|
+
importState: ImportState;
|
|
18
|
+
sidebarOpen: boolean;
|
|
19
|
+
setCurrentView: (view: I18nView) => void;
|
|
20
|
+
setCurrentTab: (tab: I18nTab) => void;
|
|
21
|
+
setViewMode: (mode: ViewMode) => void;
|
|
22
|
+
setSelectedLanguage: (language: Language | null) => void;
|
|
23
|
+
setSelectedProduct: (product: I18nProduct | null) => void;
|
|
24
|
+
setSelectedModule: (module: I18nModule | null) => void;
|
|
25
|
+
setSelectedNamespace: (namespace: I18nNamespace | null) => void;
|
|
26
|
+
setEditorMode: (mode: EditorMode) => void;
|
|
27
|
+
togglePlurals: () => void;
|
|
28
|
+
toggleSuggestions: () => void;
|
|
29
|
+
setComparisonLanguage: (code: string | null) => void;
|
|
30
|
+
updateLanguageFilter: (filter: Partial<LanguageFilter>) => void;
|
|
31
|
+
updateTranslationFilter: (filter: Partial<TranslationFilter>) => void;
|
|
32
|
+
resetLanguageFilter: () => void;
|
|
33
|
+
resetTranslationFilter: () => void;
|
|
34
|
+
updateProgressView: (view: Partial<ProgressViewConfig>) => void;
|
|
35
|
+
startImport: (format: ImportFormat, jobId: string) => void;
|
|
36
|
+
updateImportProgress: (progress: number) => void;
|
|
37
|
+
addImportError: (error: ImportError) => void;
|
|
38
|
+
resetImport: () => void;
|
|
39
|
+
toggleSidebar: () => void;
|
|
40
|
+
setSidebarOpen: (open: boolean) => void;
|
|
41
|
+
reset: () => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const useI18nStore: import('zustand').UseBoundStore<import('zustand').StoreApi<I18nState>>;
|
|
44
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create as e } from "zustand";
|
|
2
|
-
|
|
2
|
+
// src/i18n/store/i18nStore.ts
|
|
3
3
|
var t = {
|
|
4
4
|
search: "",
|
|
5
5
|
status: "all",
|
|
@@ -99,5 +99,4 @@ var t = {
|
|
|
99
99
|
sidebarOpen: !0
|
|
100
100
|
})
|
|
101
101
|
}));
|
|
102
|
-
//#endregion
|
|
103
102
|
export { a as useI18nStore };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled English translations for the i18n microfrontend.
|
|
3
|
+
*
|
|
4
|
+
* These serve as offline fallbacks when the host shell does not inject
|
|
5
|
+
* translations via the `translations` prop. They also backfill any missing
|
|
6
|
+
* keys when a non-English locale is active.
|
|
7
|
+
*/
|
|
8
|
+
export declare const enTranslations: Record<string, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/i18n/translations/en.ts
|
|
2
2
|
var e = { i18n: {
|
|
3
3
|
nav: {
|
|
4
4
|
languages: "Languages",
|
|
@@ -368,5 +368,4 @@ function t(e, n = "") {
|
|
|
368
368
|
return r;
|
|
369
369
|
}
|
|
370
370
|
var n = t(e);
|
|
371
|
-
//#endregion
|
|
372
371
|
export { n as enTranslations };
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { MicrofrontendRootProps } from '@burdenoff/fe-libs/shared/types';
|
|
2
|
+
import { NavItem, FooterItem } from '@burdenoff/fe-libs/shared/hooks/shell';
|
|
3
|
+
export type { NavItem, FooterItem };
|
|
4
|
+
/**
|
|
5
|
+
* Props for the I18nRoot component
|
|
6
|
+
*/
|
|
7
|
+
export interface I18nRootProps extends MicrofrontendRootProps {
|
|
8
|
+
/**
|
|
9
|
+
* Optional keyed translations injected by the host shell.
|
|
10
|
+
*/
|
|
11
|
+
translations?: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Optional callback when a language is created/updated
|
|
14
|
+
*/
|
|
15
|
+
onLanguageChange?: (language: Language) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Optional callback when a translation is published
|
|
18
|
+
*/
|
|
19
|
+
onTranslationPublish?: (translation: Translation) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Optional default view to show
|
|
22
|
+
*/
|
|
23
|
+
defaultView?: I18nView;
|
|
24
|
+
/**
|
|
25
|
+
* Optional function to register navigation items with the shell
|
|
26
|
+
* Injected by the shell app
|
|
27
|
+
*/
|
|
28
|
+
registerNavItems?: (items: NavItem | NavItem[]) => () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional function to register footer items with the shell
|
|
31
|
+
* Injected by the shell app
|
|
32
|
+
*/
|
|
33
|
+
registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Tenant ID (this is a tenant module)
|
|
36
|
+
*/
|
|
37
|
+
tenantId: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* View mode for the i18n UI
|
|
41
|
+
*/
|
|
42
|
+
export type I18nView = "languages" | "products" | "editor" | "progress" | "review" | "import" | "export" | "locales";
|
|
43
|
+
/**
|
|
44
|
+
* Tab in the i18n interface
|
|
45
|
+
*/
|
|
46
|
+
export type I18nTab = "languages" | "products" | "modules" | "namespaces" | "keys" | "translations" | "progress" | "review";
|
|
47
|
+
/**
|
|
48
|
+
* Language entity
|
|
49
|
+
*/
|
|
50
|
+
export interface Language {
|
|
51
|
+
id: string;
|
|
52
|
+
code: string;
|
|
53
|
+
name: string;
|
|
54
|
+
nativeName: string;
|
|
55
|
+
region?: string;
|
|
56
|
+
direction: "ltr" | "rtl";
|
|
57
|
+
status: "active" | "inactive";
|
|
58
|
+
isDefault: boolean;
|
|
59
|
+
fallbackCode?: string;
|
|
60
|
+
pluralRules?: PluralRule[];
|
|
61
|
+
dateFormat?: string;
|
|
62
|
+
timeFormat?: string;
|
|
63
|
+
numberFormat?: string;
|
|
64
|
+
currencyCode?: string;
|
|
65
|
+
metadata?: Record<string, unknown>;
|
|
66
|
+
createdAt?: string;
|
|
67
|
+
updatedAt?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Plural rule for a language
|
|
71
|
+
*/
|
|
72
|
+
export interface PluralRule {
|
|
73
|
+
form: PluralForm;
|
|
74
|
+
rule: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Plural forms based on CLDR
|
|
78
|
+
*/
|
|
79
|
+
export type PluralForm = "zero" | "one" | "two" | "few" | "many" | "other";
|
|
80
|
+
/**
|
|
81
|
+
* I18n Product (e.g., Workspaces, Botlit, Tenant)
|
|
82
|
+
*/
|
|
83
|
+
export interface I18nProduct {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
displayName: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
status: "active" | "archived";
|
|
89
|
+
metadata?: Record<string, unknown>;
|
|
90
|
+
modules?: I18nModule[];
|
|
91
|
+
createdAt?: string;
|
|
92
|
+
updatedAt?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* I18n Module (e.g., auth, billing, calendar)
|
|
96
|
+
*/
|
|
97
|
+
export interface I18nModule {
|
|
98
|
+
id: string;
|
|
99
|
+
productId?: string;
|
|
100
|
+
name: string;
|
|
101
|
+
displayName: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
status?: "active" | "archived";
|
|
104
|
+
metadata?: Record<string, unknown>;
|
|
105
|
+
namespaces?: I18nNamespace[];
|
|
106
|
+
createdAt?: string;
|
|
107
|
+
updatedAt?: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* I18n Namespace (e.g., common, errors, validation)
|
|
111
|
+
*/
|
|
112
|
+
export interface I18nNamespace {
|
|
113
|
+
id: string;
|
|
114
|
+
moduleId: string;
|
|
115
|
+
name: string;
|
|
116
|
+
displayName: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
status: "active" | "archived";
|
|
119
|
+
metadata?: Record<string, unknown>;
|
|
120
|
+
keys?: TranslationKey[];
|
|
121
|
+
createdAt: string;
|
|
122
|
+
updatedAt: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Translation Key
|
|
126
|
+
*/
|
|
127
|
+
export interface TranslationKey {
|
|
128
|
+
id: string;
|
|
129
|
+
namespaceId: string;
|
|
130
|
+
key: string;
|
|
131
|
+
defaultValue: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
placeholders?: Placeholder[];
|
|
134
|
+
characterLimit?: number;
|
|
135
|
+
tags?: string[];
|
|
136
|
+
context?: string;
|
|
137
|
+
status: "active" | "deprecated" | "archived";
|
|
138
|
+
isPlural: boolean;
|
|
139
|
+
translations?: Translation[];
|
|
140
|
+
metadata?: Record<string, unknown>;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
updatedAt: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Placeholder in a translation key
|
|
146
|
+
*/
|
|
147
|
+
export interface Placeholder {
|
|
148
|
+
name: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
example?: string;
|
|
151
|
+
required: boolean;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Translation
|
|
155
|
+
*/
|
|
156
|
+
export interface Translation {
|
|
157
|
+
id: string;
|
|
158
|
+
keyId: string;
|
|
159
|
+
languageCode: string;
|
|
160
|
+
value: string;
|
|
161
|
+
pluralForms?: PluralFormTranslation[];
|
|
162
|
+
status: TranslationStatus;
|
|
163
|
+
notes?: string;
|
|
164
|
+
reviewedBy?: string;
|
|
165
|
+
reviewedAt?: string;
|
|
166
|
+
publishedBy?: string;
|
|
167
|
+
publishedAt?: string;
|
|
168
|
+
metadata?: Record<string, unknown>;
|
|
169
|
+
createdBy: string;
|
|
170
|
+
createdAt: string;
|
|
171
|
+
updatedAt: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Plural form translation
|
|
175
|
+
*/
|
|
176
|
+
export interface PluralFormTranslation {
|
|
177
|
+
form: PluralForm;
|
|
178
|
+
value: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Translation status
|
|
182
|
+
*/
|
|
183
|
+
export type TranslationStatus = "draft" | "pending_review" | "approved" | "published";
|
|
184
|
+
/**
|
|
185
|
+
* Translation version (for history)
|
|
186
|
+
*/
|
|
187
|
+
export interface TranslationVersion {
|
|
188
|
+
id: string;
|
|
189
|
+
translationId: string;
|
|
190
|
+
version: number;
|
|
191
|
+
value: string;
|
|
192
|
+
pluralForms?: PluralFormTranslation[];
|
|
193
|
+
status: TranslationStatus;
|
|
194
|
+
changeReason?: string;
|
|
195
|
+
changedBy: string;
|
|
196
|
+
changedAt: string;
|
|
197
|
+
metadata?: Record<string, unknown>;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Translation coverage stats
|
|
201
|
+
*/
|
|
202
|
+
export interface TranslationCoverage {
|
|
203
|
+
languageCode: string;
|
|
204
|
+
totalKeys: number;
|
|
205
|
+
translatedKeys: number;
|
|
206
|
+
draftKeys: number;
|
|
207
|
+
pendingReviewKeys: number;
|
|
208
|
+
approvedKeys: number;
|
|
209
|
+
publishedKeys: number;
|
|
210
|
+
coveragePercentage: number;
|
|
211
|
+
missingKeys?: TranslationKey[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Import job
|
|
215
|
+
*/
|
|
216
|
+
export interface ImportJob {
|
|
217
|
+
id: string;
|
|
218
|
+
tenantId: string;
|
|
219
|
+
format: ImportFormat;
|
|
220
|
+
status: ImportJobStatus;
|
|
221
|
+
totalOperations: number;
|
|
222
|
+
successfulOperations: number;
|
|
223
|
+
failedOperations: number;
|
|
224
|
+
errors?: ImportError[];
|
|
225
|
+
metadata?: Record<string, unknown>;
|
|
226
|
+
createdBy: string;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
completedAt?: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Import format
|
|
232
|
+
*/
|
|
233
|
+
export type ImportFormat = "json" | "csv" | "xlsx" | "po" | "xliff";
|
|
234
|
+
/**
|
|
235
|
+
* Import job status
|
|
236
|
+
*/
|
|
237
|
+
export type ImportJobStatus = "pending" | "processing" | "completed" | "failed";
|
|
238
|
+
/**
|
|
239
|
+
* Import error
|
|
240
|
+
*/
|
|
241
|
+
export interface ImportError {
|
|
242
|
+
row?: number;
|
|
243
|
+
key?: string;
|
|
244
|
+
field?: string;
|
|
245
|
+
message: string;
|
|
246
|
+
severity: "error" | "warning";
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Export request
|
|
250
|
+
*/
|
|
251
|
+
export interface ExportRequest {
|
|
252
|
+
productId?: string;
|
|
253
|
+
moduleId?: string;
|
|
254
|
+
namespaceId?: string;
|
|
255
|
+
languageCode?: string;
|
|
256
|
+
format: ImportFormat;
|
|
257
|
+
includeMetadata?: boolean;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Export result
|
|
261
|
+
*/
|
|
262
|
+
export interface ExportResult {
|
|
263
|
+
downloadUrl: string;
|
|
264
|
+
format: ImportFormat;
|
|
265
|
+
expiresAt: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Translation suggestion
|
|
269
|
+
*/
|
|
270
|
+
export interface TranslationSuggestion {
|
|
271
|
+
key: string;
|
|
272
|
+
value: string;
|
|
273
|
+
similarity: number;
|
|
274
|
+
context?: string;
|
|
275
|
+
source: "translation_memory" | "similar_key" | "glossary";
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Filter for languages
|
|
279
|
+
*/
|
|
280
|
+
export interface LanguageFilter {
|
|
281
|
+
search?: string;
|
|
282
|
+
status?: "all" | "active" | "inactive";
|
|
283
|
+
direction?: "all" | "ltr" | "rtl";
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Filter for translations
|
|
287
|
+
*/
|
|
288
|
+
export interface TranslationFilter {
|
|
289
|
+
search?: string;
|
|
290
|
+
status?: "all" | TranslationStatus;
|
|
291
|
+
languageCode?: string | null;
|
|
292
|
+
productId?: string | null;
|
|
293
|
+
moduleId?: string | null;
|
|
294
|
+
namespaceId?: string | null;
|
|
295
|
+
hasMissingTranslations?: boolean;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Progress view configuration
|
|
299
|
+
*/
|
|
300
|
+
export interface ProgressViewConfig {
|
|
301
|
+
groupBy: "language" | "product" | "module";
|
|
302
|
+
showPercentages: boolean;
|
|
303
|
+
chartType: "bar" | "pie" | "heatmap";
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Import state
|
|
307
|
+
*/
|
|
308
|
+
export interface ImportState {
|
|
309
|
+
format: ImportFormat;
|
|
310
|
+
jobId: string | null;
|
|
311
|
+
progress: number;
|
|
312
|
+
errors: ImportError[];
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Editor mode
|
|
316
|
+
*/
|
|
317
|
+
export type EditorMode = "simple" | "advanced";
|
|
318
|
+
/**
|
|
319
|
+
* View mode for displaying translations
|
|
320
|
+
*/
|
|
321
|
+
export type ViewMode = "list" | "tree" | "table";
|
package/dist/i18n/utils/i18n.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/i18n/utils/i18n.ts
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
return t ? e.replace(/\{\{\s*(\w+)\s*\}\}/g, (e, n) => {
|
|
4
4
|
let r = t[n];
|
|
5
5
|
return r === void 0 ? `{{${n}}}` : String(r);
|
|
6
6
|
}) : e;
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { e as interpolateFallback };
|
package/dist/i18n.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
import { I18nRoot as e } from "./i18n/I18nRoot.js";
|
|
2
|
+
import { useI18n as t } from "./i18n/providers/I18nProvider.js";
|
|
3
|
+
import { useTr as n } from "./i18n/hooks/useTr.js";
|
|
4
|
+
import { useI18nStore as r } from "./i18n/store/i18nStore.js";
|
|
5
|
+
export { e as I18nRoot, t as useI18n, r as useI18nStore, n as useTr };
|
package/dist/index.d.ts
ADDED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import e from "./defaultAttributes.js";
|
|
2
|
+
import { mergeClasses as t } from "./shared/src/utils.js";
|
|
3
3
|
import { createElement as n, forwardRef as r } from "react";
|
|
4
|
-
|
|
4
|
+
// node_modules/lucide-react/dist/esm/Icon.js
|
|
5
5
|
var i = r(({ color: r = "currentColor", size: i = 24, strokeWidth: a = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => n("svg", {
|
|
6
6
|
ref: d,
|
|
7
|
-
...
|
|
7
|
+
...e,
|
|
8
8
|
width: i,
|
|
9
9
|
height: i,
|
|
10
10
|
stroke: r,
|
|
11
11
|
strokeWidth: o ? Number(a) * 24 / Number(i) : a,
|
|
12
|
-
className:
|
|
12
|
+
className: t("lucide", s),
|
|
13
13
|
...u
|
|
14
14
|
}, [...l.map(([e, t]) => n(e, t)), ...Array.isArray(c) ? c : [c]]));
|
|
15
|
-
|
|
16
|
-
export { i as Icon };
|
|
15
|
+
export { i as default };
|