@burdenoff/microfe-i18n 2026.1108.1 → 2026.1119.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.
|
@@ -4,10 +4,10 @@ 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
|
-
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";
|
|
7
|
+
import { CTAOverflowMenu as c, EmphasisPanel as l, GlassCard as u, GradientText as d, IllustratedEmptyState as f, NextSteps as p, PagePurpose as m, ThemedSelect as h } from "@burdenoff/fe-libs/ui";
|
|
8
8
|
// src/i18n/pages/ReviewQueuePage.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
9
|
+
var g = () => {
|
|
10
|
+
let g = r(), [_, v] = a([]), y = i(!1), b = [
|
|
11
11
|
{
|
|
12
12
|
id: "1",
|
|
13
13
|
key: "auth.signIn.emailLabel",
|
|
@@ -35,11 +35,11 @@ var h = () => {
|
|
|
35
35
|
submittedBy: "hans@example.com",
|
|
36
36
|
submittedAt: "1 day ago"
|
|
37
37
|
}
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
`${e}`,
|
|
42
|
-
},
|
|
38
|
+
], x = (e) => {
|
|
39
|
+
v((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
40
|
+
}, S = (e) => {
|
|
41
|
+
`${e}`, v([]);
|
|
42
|
+
}, C = "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", w = _.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", {
|
|
@@ -57,27 +57,27 @@ var h = () => {
|
|
|
57
57
|
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("h1", {
|
|
58
58
|
className: "text-2xl font-bold tracking-tight text-text-primary",
|
|
59
59
|
children: [
|
|
60
|
-
|
|
60
|
+
g("i18n.review.title", "Review"),
|
|
61
61
|
" ",
|
|
62
|
-
/* @__PURE__ */ o(d, { children:
|
|
62
|
+
/* @__PURE__ */ o(d, { children: g("i18n.editor.title.noun", "Queue") })
|
|
63
63
|
]
|
|
64
64
|
}), /* @__PURE__ */ o("p", {
|
|
65
65
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
66
|
-
children:
|
|
66
|
+
children: g("i18n.review.subtitle", "Approve or reject submitted translations")
|
|
67
67
|
})] })]
|
|
68
|
-
}),
|
|
68
|
+
}), w && /* @__PURE__ */ o(c, {
|
|
69
69
|
primary: {
|
|
70
|
-
label:
|
|
71
|
-
onSelect: () =>
|
|
70
|
+
label: g("i18n.review.actions.approveSelected", "Approve Selected ({{count}})", { count: _.length }),
|
|
71
|
+
onSelect: () => S("approve"),
|
|
72
72
|
icon: /* @__PURE__ */ o(e, {
|
|
73
73
|
className: "size-4",
|
|
74
74
|
"aria-hidden": "true"
|
|
75
75
|
})
|
|
76
76
|
},
|
|
77
77
|
actions: [{
|
|
78
|
-
label:
|
|
78
|
+
label: g("i18n.review.actions.rejectSelected", "Reject Selected ({{count}})", { count: _.length }),
|
|
79
79
|
onSelect: () => {
|
|
80
|
-
window.confirm(
|
|
80
|
+
window.confirm(g("i18n.review.confirm.rejectSelected", "Reject {{count}} selected translation(s)?", { count: _.length })) && S("reject");
|
|
81
81
|
},
|
|
82
82
|
intent: "destructive",
|
|
83
83
|
icon: /* @__PURE__ */ o(t, {
|
|
@@ -90,29 +90,29 @@ var h = () => {
|
|
|
90
90
|
}), /* @__PURE__ */ s("div", {
|
|
91
91
|
className: "mx-auto max-w-screen-xl space-y-6 px-6 py-8 sm:px-8 lg:px-10",
|
|
92
92
|
children: [
|
|
93
|
-
/* @__PURE__ */ o(m, { children:
|
|
93
|
+
/* @__PURE__ */ o(m, { children: g("i18n.review.purpose", "This is the quality gate before a translation goes live. Submitted translations land here so a reviewer can compare each one against its source string, then approve it (which publishes it to that locale) or reject it back to the translator with notes. Select several at once to approve or reject them in bulk and keep the backlog moving.") }),
|
|
94
94
|
/* @__PURE__ */ o(p, {
|
|
95
95
|
storageKey: "i18n-review",
|
|
96
96
|
steps: [
|
|
97
97
|
{
|
|
98
98
|
id: "select-all",
|
|
99
|
-
label:
|
|
100
|
-
description:
|
|
101
|
-
done:
|
|
102
|
-
onClick: () =>
|
|
99
|
+
label: g("i18n.review.next.selectAll", "Select everything in view"),
|
|
100
|
+
description: g("i18n.review.next.selectAllDesc", "Tick every pending translation so you can act on the whole batch at once."),
|
|
101
|
+
done: b.length > 0 && _.length === b.length,
|
|
102
|
+
onClick: () => v(b.map((e) => e.id))
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
id: "approve-batch",
|
|
106
|
-
label:
|
|
107
|
-
description:
|
|
106
|
+
label: g("i18n.review.next.approveBatch", "Approve the selected translations"),
|
|
107
|
+
description: g("i18n.review.next.approveBatchDesc", "Publish the ones you've checked to their locales in a single action."),
|
|
108
108
|
onClick: () => {
|
|
109
|
-
|
|
109
|
+
_.length > 0 && S("approve");
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
id: "review-item",
|
|
114
|
-
label:
|
|
115
|
-
description:
|
|
114
|
+
label: g("i18n.review.next.reviewItem", "Compare each translation against its source"),
|
|
115
|
+
description: g("i18n.review.next.reviewItemDesc", "Scan source vs. target below and add notes before approving or rejecting an individual entry."),
|
|
116
116
|
onClick: () => document.getElementById("i18n-review-queue")?.scrollIntoView({
|
|
117
117
|
behavior: "smooth",
|
|
118
118
|
block: "start"
|
|
@@ -132,72 +132,72 @@ var h = () => {
|
|
|
132
132
|
})
|
|
133
133
|
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("p", {
|
|
134
134
|
className: "text-sm font-medium text-text-secondary",
|
|
135
|
-
children:
|
|
135
|
+
children: g("i18n.review.summary.label", "Pending review")
|
|
136
136
|
}), /* @__PURE__ */ o("p", {
|
|
137
137
|
className: "text-4xl font-bold tracking-tight text-text-primary tabular-nums",
|
|
138
138
|
children: 47
|
|
139
139
|
})] })]
|
|
140
140
|
}), /* @__PURE__ */ s("div", {
|
|
141
141
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
142
|
-
children: [/* @__PURE__ */ s(
|
|
143
|
-
"aria-label":
|
|
144
|
-
className:
|
|
142
|
+
children: [/* @__PURE__ */ s(h, {
|
|
143
|
+
"aria-label": g("i18n.review.filters.status.label", "Filter by review status"),
|
|
144
|
+
className: C,
|
|
145
145
|
children: [
|
|
146
146
|
/* @__PURE__ */ o("option", {
|
|
147
147
|
value: "pending",
|
|
148
|
-
children:
|
|
148
|
+
children: g("i18n.review.filters.status.pending", "Pending Review")
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ o("option", {
|
|
151
151
|
value: "my-assignments",
|
|
152
|
-
children:
|
|
152
|
+
children: g("i18n.review.filters.status.myAssignments", "My Assignments")
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ o("option", {
|
|
155
155
|
value: "all",
|
|
156
|
-
children:
|
|
156
|
+
children: g("i18n.review.filters.status.all", "All")
|
|
157
157
|
})
|
|
158
158
|
]
|
|
159
|
-
}), /* @__PURE__ */ s(
|
|
160
|
-
"aria-label":
|
|
161
|
-
className:
|
|
159
|
+
}), /* @__PURE__ */ s(h, {
|
|
160
|
+
"aria-label": g("i18n.review.filters.language.label", "Filter by language"),
|
|
161
|
+
className: C,
|
|
162
162
|
children: [
|
|
163
163
|
/* @__PURE__ */ o("option", {
|
|
164
164
|
value: "all",
|
|
165
|
-
children:
|
|
165
|
+
children: g("i18n.review.filters.language.all", "All Languages")
|
|
166
166
|
}),
|
|
167
167
|
/* @__PURE__ */ o("option", {
|
|
168
168
|
value: "es-ES",
|
|
169
|
-
children:
|
|
169
|
+
children: g("i18n.review.filters.language.spanish", "Spanish")
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ o("option", {
|
|
172
172
|
value: "fr-FR",
|
|
173
|
-
children:
|
|
173
|
+
children: g("i18n.review.filters.language.french", "French")
|
|
174
174
|
}),
|
|
175
175
|
/* @__PURE__ */ o("option", {
|
|
176
176
|
value: "de-DE",
|
|
177
|
-
children:
|
|
177
|
+
children: g("i18n.review.filters.language.german", "German")
|
|
178
178
|
})
|
|
179
179
|
]
|
|
180
180
|
})]
|
|
181
181
|
})]
|
|
182
182
|
}),
|
|
183
|
-
|
|
183
|
+
b.length === 0 && /* @__PURE__ */ o(f, {
|
|
184
184
|
illustration: "empty-notifications",
|
|
185
|
-
title:
|
|
186
|
-
description:
|
|
185
|
+
title: g("i18n.review.empty.title", "Nothing to review"),
|
|
186
|
+
description: g("i18n.review.empty.description", "All caught up — there are no translations waiting for review.")
|
|
187
187
|
}),
|
|
188
|
-
|
|
188
|
+
b.length > 0 && /* @__PURE__ */ s("div", {
|
|
189
189
|
id: "i18n-review-queue",
|
|
190
190
|
className: "scroll-mt-6 space-y-4",
|
|
191
|
-
children: [
|
|
191
|
+
children: [b.map((r) => /* @__PURE__ */ o(u, {
|
|
192
192
|
treatment: "insight",
|
|
193
193
|
className: "border-border-seam p-6",
|
|
194
194
|
children: /* @__PURE__ */ s("div", {
|
|
195
195
|
className: "flex items-start gap-4",
|
|
196
196
|
children: [/* @__PURE__ */ o("input", {
|
|
197
197
|
type: "checkbox",
|
|
198
|
-
"aria-label":
|
|
199
|
-
checked:
|
|
200
|
-
onChange: () =>
|
|
198
|
+
"aria-label": g("i18n.review.card.selectAria", "Select translation {{key}}", { key: r.key }),
|
|
199
|
+
checked: _.includes(r.id),
|
|
200
|
+
onChange: () => x(r.id),
|
|
201
201
|
className: "mt-1 size-4 rounded border-border-seam text-primary focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
|
|
202
202
|
}), /* @__PURE__ */ s("div", {
|
|
203
203
|
className: "flex-1",
|
|
@@ -219,13 +219,13 @@ var h = () => {
|
|
|
219
219
|
className: "space-y-3",
|
|
220
220
|
children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("p", {
|
|
221
221
|
className: "mb-1 text-xs font-medium text-text-tertiary",
|
|
222
|
-
children:
|
|
222
|
+
children: g("i18n.review.card.source", "Source")
|
|
223
223
|
}), /* @__PURE__ */ o("p", {
|
|
224
224
|
className: "text-sm text-text-secondary",
|
|
225
225
|
children: r.sourceValue
|
|
226
226
|
})] }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("p", {
|
|
227
227
|
className: "mb-1 text-xs font-medium text-text-tertiary",
|
|
228
|
-
children:
|
|
228
|
+
children: g("i18n.review.card.target", "Target")
|
|
229
229
|
}), /* @__PURE__ */ o("p", {
|
|
230
230
|
className: "text-sm text-text-primary",
|
|
231
231
|
children: r.targetValue
|
|
@@ -235,13 +235,13 @@ var h = () => {
|
|
|
235
235
|
className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
236
236
|
children: [/* @__PURE__ */ o("p", {
|
|
237
237
|
className: "text-xs text-text-tertiary",
|
|
238
|
-
children:
|
|
238
|
+
children: g("i18n.review.card.submittedBy", "Submitted by {{name}} • {{time}}", {
|
|
239
239
|
name: r.submittedBy,
|
|
240
240
|
time: r.submittedAt
|
|
241
241
|
})
|
|
242
242
|
}), /* @__PURE__ */ o(c, {
|
|
243
243
|
primary: {
|
|
244
|
-
label:
|
|
244
|
+
label: g("i18n.review.card.actions.approve", "Approve"),
|
|
245
245
|
onSelect: () => void 0,
|
|
246
246
|
icon: /* @__PURE__ */ o(e, {
|
|
247
247
|
className: "size-4",
|
|
@@ -249,18 +249,18 @@ var h = () => {
|
|
|
249
249
|
})
|
|
250
250
|
},
|
|
251
251
|
actions: [{
|
|
252
|
-
label:
|
|
252
|
+
label: g("i18n.review.card.actions.addNotes", "Add Notes"),
|
|
253
253
|
onSelect: () => {
|
|
254
|
-
|
|
254
|
+
y.current = !0;
|
|
255
255
|
},
|
|
256
256
|
icon: /* @__PURE__ */ o(n, {
|
|
257
257
|
className: "size-4",
|
|
258
258
|
"aria-hidden": "true"
|
|
259
259
|
})
|
|
260
260
|
}, {
|
|
261
|
-
label:
|
|
261
|
+
label: g("i18n.review.card.actions.reject", "Reject"),
|
|
262
262
|
onSelect: () => {
|
|
263
|
-
window.confirm(
|
|
263
|
+
window.confirm(g("i18n.review.card.confirm.reject", "Reject translation \"{{key}}\"?", { key: r.key }));
|
|
264
264
|
},
|
|
265
265
|
intent: "destructive",
|
|
266
266
|
icon: /* @__PURE__ */ o(t, {
|
|
@@ -275,8 +275,8 @@ var h = () => {
|
|
|
275
275
|
})
|
|
276
276
|
}, r.id)), /* @__PURE__ */ o("p", {
|
|
277
277
|
className: "text-center text-sm text-text-tertiary",
|
|
278
|
-
children:
|
|
279
|
-
visible:
|
|
278
|
+
children: g("i18n.review.list.showing", "Showing {{visible}} of {{total}} pending reviews", {
|
|
279
|
+
visible: b.length,
|
|
280
280
|
total: 47
|
|
281
281
|
})
|
|
282
282
|
})]
|
|
@@ -285,4 +285,4 @@ var h = () => {
|
|
|
285
285
|
})]
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
|
-
export {
|
|
288
|
+
export { g as ReviewQueuePage };
|
|
@@ -7,23 +7,23 @@ 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
|
-
import { CTAOverflowMenu as u, EmphasisPanel as d, GlassCard as f, GradientText as p, NextSteps as m, PagePurpose as h } from "@burdenoff/fe-libs/ui";
|
|
10
|
+
import { CTAOverflowMenu as u, EmphasisPanel as d, GlassCard as f, GradientText as p, NextSteps as m, PagePurpose as h, ThemedSelect as g } from "@burdenoff/fe-libs/ui";
|
|
11
11
|
// src/i18n/pages/TranslationEditorPage.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
12
|
+
var _ = () => {
|
|
13
|
+
let _ = a(), { editorMode: v, showPlurals: y, showSuggestions: b, comparisonLanguage: x, setEditorMode: S, togglePlurals: C, toggleSuggestions: w, setComparisonLanguage: T } = o(), [E, D] = s(""), [O, k] = s(""), A = {
|
|
14
14
|
id: "key-1",
|
|
15
15
|
key: "auth.signIn.title",
|
|
16
16
|
defaultValue: "Sign in to your account",
|
|
17
17
|
description: "Login page title",
|
|
18
18
|
characterLimit: 50,
|
|
19
19
|
placeholders: []
|
|
20
|
-
},
|
|
20
|
+
}, j = [{
|
|
21
21
|
value: "Inicia sesión en tu cuenta",
|
|
22
22
|
similarity: 95
|
|
23
23
|
}, {
|
|
24
24
|
value: "Accede a tu cuenta",
|
|
25
25
|
similarity: 87
|
|
26
|
-
}],
|
|
26
|
+
}], M = (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"}`, N = "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)]", P = "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: [
|
|
@@ -44,40 +44,40 @@ var g = () => {
|
|
|
44
44
|
children: [
|
|
45
45
|
"Translation",
|
|
46
46
|
" ",
|
|
47
|
-
/* @__PURE__ */ c(p, { children:
|
|
47
|
+
/* @__PURE__ */ c(p, { children: _("i18n.editor.title.noun", "Editor") })
|
|
48
48
|
]
|
|
49
49
|
}), /* @__PURE__ */ c("p", {
|
|
50
50
|
className: "mt-1 text-sm text-text-secondary",
|
|
51
|
-
children:
|
|
51
|
+
children: A.key
|
|
52
52
|
})] })]
|
|
53
53
|
}), /* @__PURE__ */ l("div", {
|
|
54
54
|
className: "flex flex-wrap items-center gap-2",
|
|
55
55
|
children: [
|
|
56
56
|
/* @__PURE__ */ c("button", {
|
|
57
57
|
type: "button",
|
|
58
|
-
onClick:
|
|
59
|
-
"aria-pressed":
|
|
60
|
-
className:
|
|
61
|
-
children:
|
|
58
|
+
onClick: C,
|
|
59
|
+
"aria-pressed": y,
|
|
60
|
+
className: M(y),
|
|
61
|
+
children: _("i18n.editor.actions.pluralForms", "Plural Forms")
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ c("button", {
|
|
64
64
|
type: "button",
|
|
65
|
-
onClick:
|
|
66
|
-
"aria-pressed":
|
|
67
|
-
className:
|
|
68
|
-
children:
|
|
65
|
+
onClick: w,
|
|
66
|
+
"aria-pressed": b,
|
|
67
|
+
className: M(b),
|
|
68
|
+
children: _("i18n.editor.actions.suggestions", "Suggestions")
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */ l(
|
|
71
|
-
value:
|
|
72
|
-
"aria-label":
|
|
73
|
-
onChange: (e) =>
|
|
70
|
+
/* @__PURE__ */ l(g, {
|
|
71
|
+
value: v,
|
|
72
|
+
"aria-label": _("i18n.editor.mode.label", "Editor mode"),
|
|
73
|
+
onChange: (e) => S(e.target.value),
|
|
74
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
|
-
children:
|
|
77
|
+
children: _("i18n.editor.mode.simple", "Simple")
|
|
78
78
|
}), /* @__PURE__ */ c("option", {
|
|
79
79
|
value: "advanced",
|
|
80
|
-
children:
|
|
80
|
+
children: _("i18n.editor.mode.advanced", "Advanced")
|
|
81
81
|
})]
|
|
82
82
|
})
|
|
83
83
|
]
|
|
@@ -89,24 +89,24 @@ var g = () => {
|
|
|
89
89
|
children: /* @__PURE__ */ l("div", {
|
|
90
90
|
className: "mx-auto flex max-w-screen-2xl items-center gap-2 text-sm text-text-secondary",
|
|
91
91
|
children: [
|
|
92
|
-
/* @__PURE__ */ c("span", { children:
|
|
92
|
+
/* @__PURE__ */ c("span", { children: _("i18n.editor.breadcrumb.product", "Workspaces") }),
|
|
93
93
|
/* @__PURE__ */ c(i, {
|
|
94
94
|
className: "size-4 -rotate-90",
|
|
95
95
|
"aria-hidden": "true"
|
|
96
96
|
}),
|
|
97
|
-
/* @__PURE__ */ c("span", { children:
|
|
97
|
+
/* @__PURE__ */ c("span", { children: _("i18n.editor.breadcrumb.module", "Auth") }),
|
|
98
98
|
/* @__PURE__ */ c(i, {
|
|
99
99
|
className: "size-4 -rotate-90",
|
|
100
100
|
"aria-hidden": "true"
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */ c("span", { children:
|
|
102
|
+
/* @__PURE__ */ c("span", { children: _("i18n.editor.breadcrumb.namespace", "signIn") }),
|
|
103
103
|
/* @__PURE__ */ c(i, {
|
|
104
104
|
className: "size-4 -rotate-90",
|
|
105
105
|
"aria-hidden": "true"
|
|
106
106
|
}),
|
|
107
107
|
/* @__PURE__ */ c("span", {
|
|
108
108
|
className: "text-text-primary",
|
|
109
|
-
children:
|
|
109
|
+
children: A.key
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
112
|
})
|
|
@@ -118,33 +118,33 @@ var g = () => {
|
|
|
118
118
|
children: /* @__PURE__ */ l("div", {
|
|
119
119
|
className: "mx-auto w-full max-w-3xl space-y-6 p-6 sm:p-8",
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */ c(h, { children:
|
|
121
|
+
/* @__PURE__ */ c(h, { children: _("i18n.editor.purpose", "This is where the actual translating happens for one key at a time. You see the original (source) string, type its translation for the chosen target language, and can compare it side-by-side with another locale, reuse machine suggestions, and add plural forms. Save a draft while you work, then submit it for review when it's ready to be approved and published.") }),
|
|
122
122
|
/* @__PURE__ */ c(m, {
|
|
123
123
|
storageKey: "i18n-editor",
|
|
124
124
|
steps: [
|
|
125
125
|
{
|
|
126
126
|
id: "compare-source",
|
|
127
|
-
label:
|
|
128
|
-
description:
|
|
129
|
-
done: !!
|
|
130
|
-
onClick: () =>
|
|
127
|
+
label: _("i18n.editor.next.compare", "Compare against the source language"),
|
|
128
|
+
description: _("i18n.editor.next.compare.desc", "Show the English original next to your translation to keep meaning and length aligned."),
|
|
129
|
+
done: !!x,
|
|
130
|
+
onClick: () => T("en")
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
id: "use-suggestions",
|
|
134
|
-
label:
|
|
135
|
-
description:
|
|
136
|
-
done:
|
|
134
|
+
label: _("i18n.editor.next.suggestions", "Open translation suggestions"),
|
|
135
|
+
description: _("i18n.editor.next.suggestions.desc", "Reuse close matches from memory instead of translating from scratch."),
|
|
136
|
+
done: b,
|
|
137
137
|
onClick: () => {
|
|
138
|
-
|
|
138
|
+
b || w();
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
id: "add-plurals",
|
|
143
|
-
label:
|
|
144
|
-
description:
|
|
145
|
-
done:
|
|
143
|
+
label: _("i18n.editor.next.plurals", "Add plural forms if the string counts things"),
|
|
144
|
+
description: _("i18n.editor.next.plurals.desc", "Provide one/other (and locale-specific) variants so counts read naturally."),
|
|
145
|
+
done: y,
|
|
146
146
|
onClick: () => {
|
|
147
|
-
|
|
147
|
+
y || C();
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
]
|
|
@@ -156,7 +156,7 @@ var g = () => {
|
|
|
156
156
|
children: [/* @__PURE__ */ c("label", {
|
|
157
157
|
htmlFor: "editor-target-language",
|
|
158
158
|
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
159
|
-
children:
|
|
159
|
+
children: _("i18n.editor.fields.targetLanguage", "Target Language")
|
|
160
160
|
}), /* @__PURE__ */ l("div", {
|
|
161
161
|
className: "relative",
|
|
162
162
|
children: [
|
|
@@ -164,21 +164,21 @@ var g = () => {
|
|
|
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
|
}),
|
|
167
|
-
/* @__PURE__ */ l(
|
|
167
|
+
/* @__PURE__ */ l(g, {
|
|
168
168
|
id: "editor-target-language",
|
|
169
|
-
className:
|
|
169
|
+
className: P,
|
|
170
170
|
children: [
|
|
171
171
|
/* @__PURE__ */ c("option", {
|
|
172
172
|
value: "es-ES",
|
|
173
|
-
children:
|
|
173
|
+
children: _("i18n.shared.language.esEs", "Spanish (es-ES)")
|
|
174
174
|
}),
|
|
175
175
|
/* @__PURE__ */ c("option", {
|
|
176
176
|
value: "fr-FR",
|
|
177
|
-
children:
|
|
177
|
+
children: _("i18n.shared.language.frFr", "French (fr-FR)")
|
|
178
178
|
}),
|
|
179
179
|
/* @__PURE__ */ c("option", {
|
|
180
180
|
value: "de-DE",
|
|
181
|
-
children:
|
|
181
|
+
children: _("i18n.shared.language.deDe", "German (de-DE)")
|
|
182
182
|
})
|
|
183
183
|
]
|
|
184
184
|
}),
|
|
@@ -193,7 +193,7 @@ var g = () => {
|
|
|
193
193
|
children: [/* @__PURE__ */ c("label", {
|
|
194
194
|
htmlFor: "editor-compare-language",
|
|
195
195
|
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
196
|
-
children:
|
|
196
|
+
children: _("i18n.editor.fields.compareWith", "Compare With")
|
|
197
197
|
}), /* @__PURE__ */ l("div", {
|
|
198
198
|
className: "relative",
|
|
199
199
|
children: [
|
|
@@ -201,17 +201,17 @@ var g = () => {
|
|
|
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
|
}),
|
|
204
|
-
/* @__PURE__ */ l(
|
|
204
|
+
/* @__PURE__ */ l(g, {
|
|
205
205
|
id: "editor-compare-language",
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
208
|
-
className:
|
|
206
|
+
value: x || "",
|
|
207
|
+
onChange: (e) => T(e.target.value || null),
|
|
208
|
+
className: P,
|
|
209
209
|
children: [/* @__PURE__ */ c("option", {
|
|
210
210
|
value: "",
|
|
211
|
-
children:
|
|
211
|
+
children: _("i18n.shared.empty.none", "None")
|
|
212
212
|
}), /* @__PURE__ */ c("option", {
|
|
213
213
|
value: "en",
|
|
214
|
-
children:
|
|
214
|
+
children: _("i18n.shared.language.en", "English (en)")
|
|
215
215
|
})]
|
|
216
216
|
}),
|
|
217
217
|
/* @__PURE__ */ c(i, {
|
|
@@ -222,21 +222,21 @@ var g = () => {
|
|
|
222
222
|
})]
|
|
223
223
|
})]
|
|
224
224
|
}),
|
|
225
|
-
|
|
225
|
+
x && /* @__PURE__ */ l(f, {
|
|
226
226
|
treatment: "plain",
|
|
227
227
|
className: "border-border-seam p-4",
|
|
228
228
|
children: [
|
|
229
229
|
/* @__PURE__ */ c("p", {
|
|
230
230
|
className: "mb-2 text-sm font-medium text-text-primary",
|
|
231
|
-
children:
|
|
231
|
+
children: _("i18n.editor.comparison.sourceLanguage", "English (Source)")
|
|
232
232
|
}),
|
|
233
233
|
/* @__PURE__ */ c("p", {
|
|
234
234
|
className: "text-sm text-text-secondary",
|
|
235
|
-
children:
|
|
235
|
+
children: A.defaultValue
|
|
236
236
|
}),
|
|
237
237
|
/* @__PURE__ */ l("div", {
|
|
238
238
|
className: "mt-3 flex flex-wrap items-center gap-4 text-xs text-text-tertiary",
|
|
239
|
-
children: [/* @__PURE__ */ c("span", { children:
|
|
239
|
+
children: [/* @__PURE__ */ c("span", { children: _("i18n.editor.comparison.characterLimit", "Character limit: {{limit}}", { limit: A.characterLimit }) }), /* @__PURE__ */ c("span", { children: _("i18n.editor.comparison.placeholders", "Placeholders: none") })]
|
|
240
240
|
})
|
|
241
241
|
]
|
|
242
242
|
}),
|
|
@@ -247,42 +247,42 @@ var g = () => {
|
|
|
247
247
|
children: [/* @__PURE__ */ c("label", {
|
|
248
248
|
htmlFor: "editor-translation-value",
|
|
249
249
|
className: "text-sm font-medium text-text-primary",
|
|
250
|
-
children:
|
|
250
|
+
children: _("i18n.editor.fields.translationValue", "Translation Value")
|
|
251
251
|
}), /* @__PURE__ */ c("span", {
|
|
252
252
|
className: "text-xs text-text-tertiary tabular-nums",
|
|
253
|
-
children:
|
|
254
|
-
current:
|
|
255
|
-
limit:
|
|
253
|
+
children: _("i18n.editor.fields.characterCount", "{{current}}/{{limit}}", {
|
|
254
|
+
current: E.length,
|
|
255
|
+
limit: A.characterLimit
|
|
256
256
|
})
|
|
257
257
|
})]
|
|
258
258
|
}), /* @__PURE__ */ c("textarea", {
|
|
259
259
|
id: "editor-translation-value",
|
|
260
|
-
"aria-label":
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
263
|
-
placeholder:
|
|
264
|
-
maxLength:
|
|
265
|
-
className:
|
|
260
|
+
"aria-label": _("i18n.editor.fields.translationValue", "Translation Value"),
|
|
261
|
+
value: E,
|
|
262
|
+
onChange: (e) => D(e.target.value),
|
|
263
|
+
placeholder: _("i18n.editor.fields.translationPlaceholder", "Enter translation..."),
|
|
264
|
+
maxLength: A.characterLimit,
|
|
265
|
+
className: N,
|
|
266
266
|
rows: 4
|
|
267
267
|
})]
|
|
268
268
|
}),
|
|
269
269
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
270
270
|
htmlFor: "editor-notes",
|
|
271
271
|
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
272
|
-
children:
|
|
272
|
+
children: _("i18n.editor.fields.notes", "Translation Notes")
|
|
273
273
|
}), /* @__PURE__ */ c("textarea", {
|
|
274
274
|
id: "editor-notes",
|
|
275
|
-
"aria-label":
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
278
|
-
placeholder:
|
|
279
|
-
className:
|
|
275
|
+
"aria-label": _("i18n.editor.fields.notes", "Translation Notes"),
|
|
276
|
+
value: O,
|
|
277
|
+
onChange: (e) => k(e.target.value),
|
|
278
|
+
placeholder: _("i18n.editor.fields.notesPlaceholder", "Add notes for reviewers..."),
|
|
279
|
+
className: N,
|
|
280
280
|
rows: 3
|
|
281
281
|
})] }),
|
|
282
282
|
/* @__PURE__ */ c(u, {
|
|
283
283
|
align: "start",
|
|
284
284
|
primary: {
|
|
285
|
-
label:
|
|
285
|
+
label: _("i18n.editor.actions.saveDraft", "Save Draft"),
|
|
286
286
|
onSelect: () => void 0,
|
|
287
287
|
icon: /* @__PURE__ */ c(t, {
|
|
288
288
|
className: "size-4",
|
|
@@ -290,7 +290,7 @@ var g = () => {
|
|
|
290
290
|
})
|
|
291
291
|
},
|
|
292
292
|
actions: [{
|
|
293
|
-
label:
|
|
293
|
+
label: _("i18n.editor.actions.submitForReview", "Submit for Review"),
|
|
294
294
|
onSelect: () => void 0,
|
|
295
295
|
icon: /* @__PURE__ */ c(n, {
|
|
296
296
|
className: "size-4",
|
|
@@ -300,26 +300,26 @@ var g = () => {
|
|
|
300
300
|
})
|
|
301
301
|
]
|
|
302
302
|
})
|
|
303
|
-
}),
|
|
303
|
+
}), b && /* @__PURE__ */ l("aside", {
|
|
304
304
|
className: "hidden w-80 shrink-0 overflow-auto border-l border-border-seam bg-bg-elevated p-6 lg:block",
|
|
305
305
|
children: [/* @__PURE__ */ c("h2", {
|
|
306
306
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
307
|
-
children:
|
|
307
|
+
children: _("i18n.editor.suggestions.title", "Suggestions")
|
|
308
308
|
}), /* @__PURE__ */ c("div", {
|
|
309
309
|
className: "space-y-3",
|
|
310
|
-
children:
|
|
310
|
+
children: j.map((e) => /* @__PURE__ */ c(f, {
|
|
311
311
|
treatment: "plain",
|
|
312
312
|
className: "border-border-seam",
|
|
313
313
|
children: /* @__PURE__ */ l("button", {
|
|
314
314
|
type: "button",
|
|
315
315
|
className: "block w-full cursor-pointer rounded-[inherit] p-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
|
|
316
|
-
onClick: () =>
|
|
316
|
+
onClick: () => D(e.value),
|
|
317
317
|
children: [/* @__PURE__ */ c("p", {
|
|
318
318
|
className: "text-sm text-text-primary",
|
|
319
319
|
children: e.value
|
|
320
320
|
}), /* @__PURE__ */ c("p", {
|
|
321
321
|
className: "mt-1 text-xs text-text-tertiary tabular-nums",
|
|
322
|
-
children:
|
|
322
|
+
children: _("i18n.editor.suggestions.match", "{{similarity}}% match", { similarity: e.similarity })
|
|
323
323
|
})]
|
|
324
324
|
})
|
|
325
325
|
}, e.value))
|
|
@@ -329,4 +329,4 @@ var g = () => {
|
|
|
329
329
|
]
|
|
330
330
|
});
|
|
331
331
|
};
|
|
332
|
-
export {
|
|
332
|
+
export { _ as TranslationEditorPage };
|