@burdenoff/microfe-i18n 2026.510.107
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 +34 -0
- package/dist/i18n/I18nRoot.d.ts.map +1 -0
- package/dist/i18n/I18nRoot.js +103 -0
- package/dist/i18n/I18nRoutes.d.ts +24 -0
- package/dist/i18n/I18nRoutes.d.ts.map +1 -0
- package/dist/i18n/I18nRoutes.js +82 -0
- package/dist/i18n/index.d.ts +40 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/pages/ImportExportPage.d.ts +10 -0
- package/dist/i18n/pages/ImportExportPage.d.ts.map +1 -0
- package/dist/i18n/pages/ImportExportPage.js +368 -0
- package/dist/i18n/pages/LanguagesListPage.d.ts +8 -0
- package/dist/i18n/pages/LanguagesListPage.d.ts.map +1 -0
- package/dist/i18n/pages/LanguagesListPage.js +148 -0
- package/dist/i18n/pages/LocaleConfigPage.d.ts +8 -0
- package/dist/i18n/pages/LocaleConfigPage.d.ts.map +1 -0
- package/dist/i18n/pages/LocaleConfigPage.js +318 -0
- package/dist/i18n/pages/ProductsListPage.d.ts +8 -0
- package/dist/i18n/pages/ProductsListPage.d.ts.map +1 -0
- package/dist/i18n/pages/ProductsListPage.js +131 -0
- package/dist/i18n/pages/ProgressDashboardPage.d.ts +8 -0
- package/dist/i18n/pages/ProgressDashboardPage.d.ts.map +1 -0
- package/dist/i18n/pages/ProgressDashboardPage.js +294 -0
- package/dist/i18n/pages/ReviewQueuePage.d.ts +8 -0
- package/dist/i18n/pages/ReviewQueuePage.d.ts.map +1 -0
- package/dist/i18n/pages/ReviewQueuePage.js +209 -0
- package/dist/i18n/pages/TranslationEditorPage.d.ts +8 -0
- package/dist/i18n/pages/TranslationEditorPage.d.ts.map +1 -0
- package/dist/i18n/pages/TranslationEditorPage.js +243 -0
- package/dist/i18n/providers/I18nProvider.d.ts +21 -0
- package/dist/i18n/providers/I18nProvider.d.ts.map +1 -0
- package/dist/i18n/providers/I18nProvider.js +45 -0
- package/dist/i18n/store/i18nStore.d.ts +46 -0
- package/dist/i18n/store/i18nStore.d.ts.map +1 -0
- package/dist/i18n/store/i18nStore.js +103 -0
- package/dist/i18n/types/index.d.ts +323 -0
- package/dist/i18n/types/index.d.ts.map +1 -0
- package/dist/i18n/utils/i18n.d.ts +3 -0
- package/dist/i18n/utils/i18n.d.ts.map +1 -0
- package/dist/i18n/utils/i18n.js +9 -0
- package/dist/i18n.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +26 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check-big.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/download.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-text.js +26 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/globe.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/languages.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/package.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pen-line.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/save.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/search.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trash-2.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +4 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { ChevronDown as e } from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
2
|
+
import { Languages as t } from "../../node_modules/lucide-react/dist/esm/icons/languages.js";
|
|
3
|
+
import { PenLine as n } from "../../node_modules/lucide-react/dist/esm/icons/pen-line.js";
|
|
4
|
+
import { Save as r } from "../../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
5
|
+
import { Send as i } from "../../node_modules/lucide-react/dist/esm/icons/send.js";
|
|
6
|
+
import { useI18n as a } from "../providers/I18nProvider.js";
|
|
7
|
+
import { useI18nStore as o } from "../store/i18nStore.js";
|
|
8
|
+
import { useState as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/i18n/pages/TranslationEditorPage.tsx
|
|
11
|
+
var u = () => {
|
|
12
|
+
let { t: u } = a(), d = (e, t, n) => u(e, t, n), { editorMode: f, showPlurals: p, showSuggestions: m, comparisonLanguage: h, setEditorMode: g, togglePlurals: _, toggleSuggestions: v, setComparisonLanguage: y } = o(), [b, x] = s(""), [S, C] = s(""), w = {
|
|
13
|
+
id: "key-1",
|
|
14
|
+
key: "auth.signIn.title",
|
|
15
|
+
defaultValue: "Sign in to your account",
|
|
16
|
+
description: "Login page title",
|
|
17
|
+
characterLimit: 50,
|
|
18
|
+
placeholders: []
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ l("div", {
|
|
21
|
+
className: "flex h-full flex-col",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ c("div", {
|
|
24
|
+
className: "border-b border-border bg-surface-elevated p-6",
|
|
25
|
+
children: /* @__PURE__ */ l("div", {
|
|
26
|
+
className: "flex items-center justify-between",
|
|
27
|
+
children: [/* @__PURE__ */ l("div", {
|
|
28
|
+
className: "flex items-center gap-3",
|
|
29
|
+
children: [/* @__PURE__ */ c(n, { className: "size-6 text-accent-primary" }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h1", {
|
|
30
|
+
className: "text-2xl font-semibold text-content-primary",
|
|
31
|
+
children: d("i18n.editor.title", "Translation Editor")
|
|
32
|
+
}), /* @__PURE__ */ c("p", {
|
|
33
|
+
className: "mt-1 text-sm text-content-secondary",
|
|
34
|
+
children: w.key
|
|
35
|
+
})] })]
|
|
36
|
+
}), /* @__PURE__ */ l("div", {
|
|
37
|
+
className: "flex items-center gap-2",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ c("button", {
|
|
40
|
+
onClick: _,
|
|
41
|
+
className: `rounded-md border px-3 py-2 text-sm font-medium transition-colors ${p ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border bg-surface text-content-secondary hover:bg-surface-elevated"}`,
|
|
42
|
+
children: d("i18n.editor.actions.pluralForms", "Plural Forms")
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ c("button", {
|
|
45
|
+
onClick: v,
|
|
46
|
+
className: `rounded-md border px-3 py-2 text-sm font-medium transition-colors ${m ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border bg-surface text-content-secondary hover:bg-surface-elevated"}`,
|
|
47
|
+
children: d("i18n.editor.actions.suggestions", "Suggestions")
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ l("select", {
|
|
50
|
+
value: f,
|
|
51
|
+
onChange: (e) => g(e.target.value),
|
|
52
|
+
className: "rounded-md border border-border bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
|
|
53
|
+
children: [/* @__PURE__ */ c("option", {
|
|
54
|
+
value: "simple",
|
|
55
|
+
children: d("i18n.editor.mode.simple", "Simple")
|
|
56
|
+
}), /* @__PURE__ */ c("option", {
|
|
57
|
+
value: "advanced",
|
|
58
|
+
children: d("i18n.editor.mode.advanced", "Advanced")
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ c("div", {
|
|
66
|
+
className: "border-b border-border bg-surface px-6 py-3",
|
|
67
|
+
children: /* @__PURE__ */ l("div", {
|
|
68
|
+
className: "flex items-center gap-2 text-sm text-content-secondary",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ c("span", { children: d("i18n.editor.breadcrumb.product", "Workspaces") }),
|
|
71
|
+
/* @__PURE__ */ c(e, { className: "-rotate-90 size-4" }),
|
|
72
|
+
/* @__PURE__ */ c("span", { children: d("i18n.editor.breadcrumb.module", "Auth") }),
|
|
73
|
+
/* @__PURE__ */ c(e, { className: "-rotate-90 size-4" }),
|
|
74
|
+
/* @__PURE__ */ c("span", { children: d("i18n.editor.breadcrumb.namespace", "signIn") }),
|
|
75
|
+
/* @__PURE__ */ c(e, { className: "-rotate-90 size-4" }),
|
|
76
|
+
/* @__PURE__ */ c("span", {
|
|
77
|
+
className: "text-content-primary",
|
|
78
|
+
children: w.key
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ l("div", {
|
|
84
|
+
className: "flex flex-1 overflow-hidden",
|
|
85
|
+
children: [/* @__PURE__ */ c("div", {
|
|
86
|
+
className: "flex flex-1 flex-col overflow-auto border-r border-border",
|
|
87
|
+
children: /* @__PURE__ */ l("div", {
|
|
88
|
+
className: "p-6",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ l("div", {
|
|
91
|
+
className: "mb-6 flex items-center gap-4",
|
|
92
|
+
children: [/* @__PURE__ */ l("div", {
|
|
93
|
+
className: "flex-1",
|
|
94
|
+
children: [/* @__PURE__ */ c("label", {
|
|
95
|
+
className: "mb-2 block text-sm font-medium text-content-primary",
|
|
96
|
+
children: d("i18n.editor.fields.targetLanguage", "Target Language")
|
|
97
|
+
}), /* @__PURE__ */ l("div", {
|
|
98
|
+
className: "relative",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ c(t, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-content-secondary" }),
|
|
101
|
+
/* @__PURE__ */ l("select", {
|
|
102
|
+
className: "w-full appearance-none rounded-md border border-border bg-surface-elevated py-2 pl-10 pr-10 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ c("option", {
|
|
105
|
+
value: "es-ES",
|
|
106
|
+
children: d("i18n.shared.language.esEs", "Spanish (es-ES)")
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ c("option", {
|
|
109
|
+
value: "fr-FR",
|
|
110
|
+
children: d("i18n.shared.language.frFr", "French (fr-FR)")
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ c("option", {
|
|
113
|
+
value: "de-DE",
|
|
114
|
+
children: d("i18n.shared.language.deDe", "German (de-DE)")
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ c(e, { className: "pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-content-secondary" })
|
|
119
|
+
]
|
|
120
|
+
})]
|
|
121
|
+
}), /* @__PURE__ */ l("div", {
|
|
122
|
+
className: "flex-1",
|
|
123
|
+
children: [/* @__PURE__ */ c("label", {
|
|
124
|
+
className: "mb-2 block text-sm font-medium text-content-primary",
|
|
125
|
+
children: d("i18n.editor.fields.compareWith", "Compare With")
|
|
126
|
+
}), /* @__PURE__ */ l("div", {
|
|
127
|
+
className: "relative",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ c(t, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-content-secondary" }),
|
|
130
|
+
/* @__PURE__ */ l("select", {
|
|
131
|
+
value: h || "",
|
|
132
|
+
onChange: (e) => y(e.target.value || null),
|
|
133
|
+
className: "w-full appearance-none rounded-md border border-border bg-surface-elevated py-2 pl-10 pr-10 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
|
|
134
|
+
children: [/* @__PURE__ */ c("option", {
|
|
135
|
+
value: "",
|
|
136
|
+
children: d("i18n.shared.empty.none", "None")
|
|
137
|
+
}), /* @__PURE__ */ c("option", {
|
|
138
|
+
value: "en",
|
|
139
|
+
children: d("i18n.shared.language.en", "English (en)")
|
|
140
|
+
})]
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ c(e, { className: "pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-content-secondary" })
|
|
143
|
+
]
|
|
144
|
+
})]
|
|
145
|
+
})]
|
|
146
|
+
}),
|
|
147
|
+
h && /* @__PURE__ */ l("div", {
|
|
148
|
+
className: "mb-6 rounded-lg border border-border bg-surface-elevated p-4",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ c("p", {
|
|
151
|
+
className: "mb-2 text-sm font-medium text-content-primary",
|
|
152
|
+
children: d("i18n.editor.comparison.sourceLanguage", "English (Source)")
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ c("p", {
|
|
155
|
+
className: "text-sm text-content-secondary",
|
|
156
|
+
children: w.defaultValue
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ l("div", {
|
|
159
|
+
className: "mt-3 flex items-center gap-4 text-xs text-content-tertiary",
|
|
160
|
+
children: [/* @__PURE__ */ c("span", { children: d("i18n.editor.comparison.characterLimit", "Character limit: {{limit}}", { limit: w.characterLimit }) }), /* @__PURE__ */ c("span", { children: d("i18n.editor.comparison.placeholders", "Placeholders: none") })]
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ l("div", {
|
|
165
|
+
className: "mb-6",
|
|
166
|
+
children: [/* @__PURE__ */ l("div", {
|
|
167
|
+
className: "mb-2 flex items-center justify-between",
|
|
168
|
+
children: [/* @__PURE__ */ c("label", {
|
|
169
|
+
className: "text-sm font-medium text-content-primary",
|
|
170
|
+
children: d("i18n.editor.fields.translationValue", "Translation Value")
|
|
171
|
+
}), /* @__PURE__ */ c("span", {
|
|
172
|
+
className: "text-xs text-content-tertiary",
|
|
173
|
+
children: d("i18n.editor.fields.characterCount", "{{current}}/{{limit}}", {
|
|
174
|
+
current: b.length,
|
|
175
|
+
limit: w.characterLimit
|
|
176
|
+
})
|
|
177
|
+
})]
|
|
178
|
+
}), /* @__PURE__ */ c("textarea", {
|
|
179
|
+
value: b,
|
|
180
|
+
onChange: (e) => x(e.target.value),
|
|
181
|
+
placeholder: d("i18n.editor.fields.translationPlaceholder", "Enter translation..."),
|
|
182
|
+
maxLength: w.characterLimit,
|
|
183
|
+
className: "w-full rounded-md border border-border bg-surface p-3 text-sm text-content-primary placeholder:text-content-tertiary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
|
|
184
|
+
rows: 4
|
|
185
|
+
})]
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ l("div", {
|
|
188
|
+
className: "mb-6",
|
|
189
|
+
children: [/* @__PURE__ */ c("label", {
|
|
190
|
+
className: "mb-2 block text-sm font-medium text-content-primary",
|
|
191
|
+
children: d("i18n.editor.fields.notes", "Translation Notes")
|
|
192
|
+
}), /* @__PURE__ */ c("textarea", {
|
|
193
|
+
value: S,
|
|
194
|
+
onChange: (e) => C(e.target.value),
|
|
195
|
+
placeholder: d("i18n.editor.fields.notesPlaceholder", "Add notes for reviewers..."),
|
|
196
|
+
className: "w-full rounded-md border border-border bg-surface p-3 text-sm text-content-primary placeholder:text-content-tertiary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
|
|
197
|
+
rows: 3
|
|
198
|
+
})]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ l("div", {
|
|
201
|
+
className: "flex items-center gap-3",
|
|
202
|
+
children: [/* @__PURE__ */ l("button", {
|
|
203
|
+
className: "flex items-center gap-2 rounded-md bg-accent-primary px-4 py-2 text-sm font-medium text-white hover:bg-accent-primary-hover",
|
|
204
|
+
children: [/* @__PURE__ */ c(r, { className: "size-4" }), d("i18n.editor.actions.saveDraft", "Save Draft")]
|
|
205
|
+
}), /* @__PURE__ */ l("button", {
|
|
206
|
+
className: "flex items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-content-primary hover:bg-surface-elevated",
|
|
207
|
+
children: [/* @__PURE__ */ c(i, { className: "size-4" }), d("i18n.editor.actions.submitForReview", "Submit for Review")]
|
|
208
|
+
})]
|
|
209
|
+
})
|
|
210
|
+
]
|
|
211
|
+
})
|
|
212
|
+
}), m && /* @__PURE__ */ l("div", {
|
|
213
|
+
className: "w-80 overflow-auto border-l border-border bg-surface-elevated p-6",
|
|
214
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
215
|
+
className: "mb-4 text-sm font-medium text-content-primary",
|
|
216
|
+
children: d("i18n.editor.suggestions.title", "Suggestions")
|
|
217
|
+
}), /* @__PURE__ */ c("div", {
|
|
218
|
+
className: "space-y-3",
|
|
219
|
+
children: [{
|
|
220
|
+
value: "Inicia sesión en tu cuenta",
|
|
221
|
+
similarity: 95
|
|
222
|
+
}, {
|
|
223
|
+
value: "Accede a tu cuenta",
|
|
224
|
+
similarity: 87
|
|
225
|
+
}].map((e, t) => /* @__PURE__ */ l("div", {
|
|
226
|
+
className: "cursor-pointer rounded-md border border-border bg-surface p-3 transition-all hover:border-accent-primary",
|
|
227
|
+
onClick: () => x(e.value),
|
|
228
|
+
children: [/* @__PURE__ */ c("p", {
|
|
229
|
+
className: "text-sm text-content-primary",
|
|
230
|
+
children: e.value
|
|
231
|
+
}), /* @__PURE__ */ c("p", {
|
|
232
|
+
className: "mt-1 text-xs text-content-tertiary",
|
|
233
|
+
children: d("i18n.editor.suggestions.match", "{{similarity}}% match", { similarity: e.similarity })
|
|
234
|
+
})]
|
|
235
|
+
}, t))
|
|
236
|
+
})]
|
|
237
|
+
})]
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
//#endregion
|
|
243
|
+
export { u as TranslationEditorPage };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { I18nRootProps } from '../types';
|
|
3
|
+
import { TranslationParams } from '../utils/i18n';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Context value for I18n microfrontend
|
|
7
|
+
*/
|
|
8
|
+
interface I18nContextValue extends I18nRootProps {
|
|
9
|
+
t: (key: string, fallback?: string, params?: TranslationParams) => string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook to access I18n context
|
|
13
|
+
*/
|
|
14
|
+
export declare const useI18n: () => I18nContextValue;
|
|
15
|
+
/**
|
|
16
|
+
* Provider component for I18n microfrontend
|
|
17
|
+
* Sets up routing and context
|
|
18
|
+
*/
|
|
19
|
+
export declare const I18nProvider: FC<PropsWithChildren<I18nRootProps>>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=I18nProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"I18nProvider.d.ts","sourceRoot":"","sources":["../../../src/i18n/providers/I18nProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5E;;GAEG;AACH,UAAU,gBAAiB,SAAQ,aAAa;IAC9C,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,KAAK,MAAM,CAAC;CAC3E;AAID;;GAEG;AACH,eAAO,MAAM,OAAO,wBAMnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAoE7D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { interpolateFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useMemo as i } from "react";
|
|
3
|
+
import { MemoryRouter as a } from "react-router-dom";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/i18n/providers/I18nProvider.tsx
|
|
6
|
+
var s = t(null), c = () => {
|
|
7
|
+
let e = r(s);
|
|
8
|
+
if (!e) throw Error("useI18n must be used within I18nProvider");
|
|
9
|
+
return e;
|
|
10
|
+
}, l = ({ children: t, basePath: r, navigate: c, currentUser: l, tenantId: u, apiGatewayUrl: d, authToken: f, translations: p, onLanguageChange: m, onTranslationPublish: h, defaultView: g }) => {
|
|
11
|
+
let _ = n((t, n, r) => e(p?.[t] ?? n ?? t, r), [p]), v = i(() => ({
|
|
12
|
+
basePath: r,
|
|
13
|
+
navigate: c,
|
|
14
|
+
currentUser: l,
|
|
15
|
+
tenantId: u,
|
|
16
|
+
apiGatewayUrl: d,
|
|
17
|
+
authToken: f,
|
|
18
|
+
translations: p,
|
|
19
|
+
onLanguageChange: m,
|
|
20
|
+
onTranslationPublish: h,
|
|
21
|
+
defaultView: g,
|
|
22
|
+
t: _
|
|
23
|
+
}), [
|
|
24
|
+
d,
|
|
25
|
+
f,
|
|
26
|
+
r,
|
|
27
|
+
l,
|
|
28
|
+
g,
|
|
29
|
+
c,
|
|
30
|
+
m,
|
|
31
|
+
h,
|
|
32
|
+
_,
|
|
33
|
+
u,
|
|
34
|
+
p
|
|
35
|
+
]);
|
|
36
|
+
return r ? /* @__PURE__ */ o(s.Provider, {
|
|
37
|
+
value: v,
|
|
38
|
+
children: t
|
|
39
|
+
}) : /* @__PURE__ */ o(s.Provider, {
|
|
40
|
+
value: v,
|
|
41
|
+
children: /* @__PURE__ */ o(a, { children: t })
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { l as I18nProvider, c as useI18n };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { I18nView, I18nTab, Language, I18nProduct, I18nModule, I18nNamespace, ViewMode, EditorMode, LanguageFilter, TranslationFilter, ProgressViewConfig, ImportState, ImportError, ImportFormat } from '../types';
|
|
2
|
+
|
|
3
|
+
interface I18nState {
|
|
4
|
+
currentView: I18nView;
|
|
5
|
+
currentTab: I18nTab;
|
|
6
|
+
viewMode: ViewMode;
|
|
7
|
+
selectedLanguage: Language | null;
|
|
8
|
+
selectedProduct: I18nProduct | null;
|
|
9
|
+
selectedModule: I18nModule | null;
|
|
10
|
+
selectedNamespace: I18nNamespace | null;
|
|
11
|
+
editorMode: EditorMode;
|
|
12
|
+
showPlurals: boolean;
|
|
13
|
+
showSuggestions: boolean;
|
|
14
|
+
comparisonLanguage: string | null;
|
|
15
|
+
languageFilter: LanguageFilter;
|
|
16
|
+
translationFilter: TranslationFilter;
|
|
17
|
+
progressView: ProgressViewConfig;
|
|
18
|
+
importState: ImportState;
|
|
19
|
+
sidebarOpen: boolean;
|
|
20
|
+
setCurrentView: (view: I18nView) => void;
|
|
21
|
+
setCurrentTab: (tab: I18nTab) => void;
|
|
22
|
+
setViewMode: (mode: ViewMode) => void;
|
|
23
|
+
setSelectedLanguage: (language: Language | null) => void;
|
|
24
|
+
setSelectedProduct: (product: I18nProduct | null) => void;
|
|
25
|
+
setSelectedModule: (module: I18nModule | null) => void;
|
|
26
|
+
setSelectedNamespace: (namespace: I18nNamespace | null) => void;
|
|
27
|
+
setEditorMode: (mode: EditorMode) => void;
|
|
28
|
+
togglePlurals: () => void;
|
|
29
|
+
toggleSuggestions: () => void;
|
|
30
|
+
setComparisonLanguage: (code: string | null) => void;
|
|
31
|
+
updateLanguageFilter: (filter: Partial<LanguageFilter>) => void;
|
|
32
|
+
updateTranslationFilter: (filter: Partial<TranslationFilter>) => void;
|
|
33
|
+
resetLanguageFilter: () => void;
|
|
34
|
+
resetTranslationFilter: () => void;
|
|
35
|
+
updateProgressView: (view: Partial<ProgressViewConfig>) => void;
|
|
36
|
+
startImport: (format: ImportFormat, jobId: string) => void;
|
|
37
|
+
updateImportProgress: (progress: number) => void;
|
|
38
|
+
addImportError: (error: ImportError) => void;
|
|
39
|
+
resetImport: () => void;
|
|
40
|
+
toggleSidebar: () => void;
|
|
41
|
+
setSidebarOpen: (open: boolean) => void;
|
|
42
|
+
reset: () => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const useI18nStore: import('zustand').UseBoundStore<import('zustand').StoreApi<I18nState>>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=i18nStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nStore.d.ts","sourceRoot":"","sources":["../../../src/i18n/store/i18nStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,EACb,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,UAAU,SAAS;IAEjB,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IAGnB,gBAAgB,EAAE,QAAQ,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,iBAAiB,EAAE,aAAa,GAAG,IAAI,CAAC;IAGxC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGlC,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IAGrC,YAAY,EAAE,kBAAkB,CAAC;IAGjC,WAAW,EAAE,WAAW,CAAC;IAGzB,WAAW,EAAE,OAAO,CAAC;IAGrB,cAAc,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAGtC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,kBAAkB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,oBAAoB,EAAE,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;IAGhE,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAGrD,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAChE,uBAAuB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACtE,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,sBAAsB,EAAE,MAAM,IAAI,CAAC;IAGnC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAGhE,WAAW,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,MAAM,IAAI,CAAC;IAGxB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAGxC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AA+BD,eAAO,MAAM,YAAY,wEAkGtB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { create as e } from "zustand";
|
|
2
|
+
//#region src/i18n/store/i18nStore.ts
|
|
3
|
+
var t = {
|
|
4
|
+
search: "",
|
|
5
|
+
status: "all",
|
|
6
|
+
direction: "all"
|
|
7
|
+
}, n = {
|
|
8
|
+
search: "",
|
|
9
|
+
status: "all",
|
|
10
|
+
languageCode: null,
|
|
11
|
+
productId: null,
|
|
12
|
+
moduleId: null,
|
|
13
|
+
namespaceId: null,
|
|
14
|
+
hasMissingTranslations: !1
|
|
15
|
+
}, r = {
|
|
16
|
+
groupBy: "language",
|
|
17
|
+
showPercentages: !0,
|
|
18
|
+
chartType: "bar"
|
|
19
|
+
}, i = {
|
|
20
|
+
format: "json",
|
|
21
|
+
jobId: null,
|
|
22
|
+
progress: 0,
|
|
23
|
+
errors: []
|
|
24
|
+
}, a = e((e) => ({
|
|
25
|
+
currentView: "languages",
|
|
26
|
+
currentTab: "languages",
|
|
27
|
+
viewMode: "list",
|
|
28
|
+
selectedLanguage: null,
|
|
29
|
+
selectedProduct: null,
|
|
30
|
+
selectedModule: null,
|
|
31
|
+
selectedNamespace: null,
|
|
32
|
+
editorMode: "simple",
|
|
33
|
+
showPlurals: !1,
|
|
34
|
+
showSuggestions: !0,
|
|
35
|
+
comparisonLanguage: null,
|
|
36
|
+
languageFilter: t,
|
|
37
|
+
translationFilter: n,
|
|
38
|
+
progressView: r,
|
|
39
|
+
importState: i,
|
|
40
|
+
sidebarOpen: !0,
|
|
41
|
+
setCurrentView: (t) => e({ currentView: t }),
|
|
42
|
+
setCurrentTab: (t) => e({ currentTab: t }),
|
|
43
|
+
setViewMode: (t) => e({ viewMode: t }),
|
|
44
|
+
setSelectedLanguage: (t) => e({ selectedLanguage: t }),
|
|
45
|
+
setSelectedProduct: (t) => e({ selectedProduct: t }),
|
|
46
|
+
setSelectedModule: (t) => e({ selectedModule: t }),
|
|
47
|
+
setSelectedNamespace: (t) => e({ selectedNamespace: t }),
|
|
48
|
+
setEditorMode: (t) => e({ editorMode: t }),
|
|
49
|
+
togglePlurals: () => e((e) => ({ showPlurals: !e.showPlurals })),
|
|
50
|
+
toggleSuggestions: () => e((e) => ({ showSuggestions: !e.showSuggestions })),
|
|
51
|
+
setComparisonLanguage: (t) => e({ comparisonLanguage: t }),
|
|
52
|
+
updateLanguageFilter: (t) => e((e) => ({ languageFilter: {
|
|
53
|
+
...e.languageFilter,
|
|
54
|
+
...t
|
|
55
|
+
} })),
|
|
56
|
+
updateTranslationFilter: (t) => e((e) => ({ translationFilter: {
|
|
57
|
+
...e.translationFilter,
|
|
58
|
+
...t
|
|
59
|
+
} })),
|
|
60
|
+
resetLanguageFilter: () => e({ languageFilter: t }),
|
|
61
|
+
resetTranslationFilter: () => e({ translationFilter: n }),
|
|
62
|
+
updateProgressView: (t) => e((e) => ({ progressView: {
|
|
63
|
+
...e.progressView,
|
|
64
|
+
...t
|
|
65
|
+
} })),
|
|
66
|
+
startImport: (t, n) => e({ importState: {
|
|
67
|
+
format: t,
|
|
68
|
+
jobId: n,
|
|
69
|
+
progress: 0,
|
|
70
|
+
errors: []
|
|
71
|
+
} }),
|
|
72
|
+
updateImportProgress: (t) => e((e) => ({ importState: {
|
|
73
|
+
...e.importState,
|
|
74
|
+
progress: t
|
|
75
|
+
} })),
|
|
76
|
+
addImportError: (t) => e((e) => ({ importState: {
|
|
77
|
+
...e.importState,
|
|
78
|
+
errors: [...e.importState.errors, t]
|
|
79
|
+
} })),
|
|
80
|
+
resetImport: () => e({ importState: i }),
|
|
81
|
+
toggleSidebar: () => e((e) => ({ sidebarOpen: !e.sidebarOpen })),
|
|
82
|
+
setSidebarOpen: (t) => e({ sidebarOpen: t }),
|
|
83
|
+
reset: () => e({
|
|
84
|
+
currentView: "languages",
|
|
85
|
+
currentTab: "languages",
|
|
86
|
+
viewMode: "list",
|
|
87
|
+
selectedLanguage: null,
|
|
88
|
+
selectedProduct: null,
|
|
89
|
+
selectedModule: null,
|
|
90
|
+
selectedNamespace: null,
|
|
91
|
+
editorMode: "simple",
|
|
92
|
+
showPlurals: !1,
|
|
93
|
+
showSuggestions: !0,
|
|
94
|
+
comparisonLanguage: null,
|
|
95
|
+
languageFilter: t,
|
|
96
|
+
translationFilter: n,
|
|
97
|
+
progressView: r,
|
|
98
|
+
importState: i,
|
|
99
|
+
sidebarOpen: !0
|
|
100
|
+
})
|
|
101
|
+
}));
|
|
102
|
+
//#endregion
|
|
103
|
+
export { a as useI18nStore };
|