@burdenoff/microfe-i18n 2026.801.1 → 2026.830.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.
@@ -3,27 +3,27 @@ import { Languages as t } from "../../node_modules/lucide-react/dist/esm/icons/l
3
3
  import { PenLine as n } from "../../node_modules/lucide-react/dist/esm/icons/pen-line.js";
4
4
  import { Save as r } from "../../node_modules/lucide-react/dist/esm/icons/save.js";
5
5
  import { Send as i } from "../../node_modules/lucide-react/dist/esm/icons/send.js";
6
- import { useI18n as a } from "../providers/I18nProvider.js";
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
  //#region src/i18n/pages/TranslationEditorPage.tsx
12
12
  var g = () => {
13
- let { t: g } = a(), _ = (e, t, n) => g(e, t, n), { editorMode: v, showPlurals: y, showSuggestions: b, comparisonLanguage: x, setEditorMode: S, togglePlurals: C, toggleSuggestions: w, setComparisonLanguage: T } = o(), [E, D] = s(""), [O, k] = s(""), A = {
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",
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
- }, j = [{
20
+ }, A = [{
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
- }], 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)]";
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)]";
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: _("i18n.editor.title.noun", "Editor") })
47
+ /* @__PURE__ */ c(p, { children: g("i18n.editor.title.noun", "Editor") })
48
48
  ]
49
49
  }), /* @__PURE__ */ c("p", {
50
50
  className: "mt-1 text-sm text-text-secondary",
51
- children: A.key
51
+ children: k.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: C,
59
- "aria-pressed": y,
60
- className: M(y),
61
- children: _("i18n.editor.actions.pluralForms", "Plural Forms")
58
+ onClick: S,
59
+ "aria-pressed": v,
60
+ className: j(v),
61
+ children: g("i18n.editor.actions.pluralForms", "Plural Forms")
62
62
  }),
63
63
  /* @__PURE__ */ c("button", {
64
64
  type: "button",
65
- onClick: w,
66
- "aria-pressed": b,
67
- className: M(b),
68
- children: _("i18n.editor.actions.suggestions", "Suggestions")
65
+ onClick: C,
66
+ "aria-pressed": y,
67
+ className: j(y),
68
+ children: g("i18n.editor.actions.suggestions", "Suggestions")
69
69
  }),
70
70
  /* @__PURE__ */ l("select", {
71
- value: v,
72
- "aria-label": _("i18n.editor.mode.label", "Editor mode"),
73
- onChange: (e) => S(e.target.value),
71
+ value: _,
72
+ "aria-label": g("i18n.editor.mode.label", "Editor mode"),
73
+ onChange: (e) => x(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)]",
75
75
  children: [/* @__PURE__ */ c("option", {
76
76
  value: "simple",
77
- children: _("i18n.editor.mode.simple", "Simple")
77
+ children: g("i18n.editor.mode.simple", "Simple")
78
78
  }), /* @__PURE__ */ c("option", {
79
79
  value: "advanced",
80
- children: _("i18n.editor.mode.advanced", "Advanced")
80
+ children: g("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: _("i18n.editor.breadcrumb.product", "Workspaces") }),
92
+ /* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.product", "Workspaces") }),
93
93
  /* @__PURE__ */ c(e, {
94
94
  className: "size-4 -rotate-90",
95
95
  "aria-hidden": "true"
96
96
  }),
97
- /* @__PURE__ */ c("span", { children: _("i18n.editor.breadcrumb.module", "Auth") }),
97
+ /* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.module", "Auth") }),
98
98
  /* @__PURE__ */ c(e, {
99
99
  className: "size-4 -rotate-90",
100
100
  "aria-hidden": "true"
101
101
  }),
102
- /* @__PURE__ */ c("span", { children: _("i18n.editor.breadcrumb.namespace", "signIn") }),
102
+ /* @__PURE__ */ c("span", { children: g("i18n.editor.breadcrumb.namespace", "signIn") }),
103
103
  /* @__PURE__ */ c(e, {
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: A.key
109
+ children: k.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: _("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.") }),
121
+ /* @__PURE__ */ c(h, { children: g("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: _("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")
127
+ label: g("i18n.editor.next.compare", "Compare against the source language"),
128
+ description: g("i18n.editor.next.compare.desc", "Show the English original next to your translation to keep meaning and length aligned."),
129
+ done: !!b,
130
+ onClick: () => w("en")
131
131
  },
132
132
  {
133
133
  id: "use-suggestions",
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,
134
+ label: g("i18n.editor.next.suggestions", "Open translation suggestions"),
135
+ description: g("i18n.editor.next.suggestions.desc", "Reuse close matches from memory instead of translating from scratch."),
136
+ done: y,
137
137
  onClick: () => {
138
- b || w();
138
+ y || C();
139
139
  }
140
140
  },
141
141
  {
142
142
  id: "add-plurals",
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,
143
+ label: g("i18n.editor.next.plurals", "Add plural forms if the string counts things"),
144
+ description: g("i18n.editor.next.plurals.desc", "Provide one/other (and locale-specific) variants so counts read naturally."),
145
+ done: v,
146
146
  onClick: () => {
147
- y || C();
147
+ v || S();
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: _("i18n.editor.fields.targetLanguage", "Target Language")
159
+ children: g("i18n.editor.fields.targetLanguage", "Target Language")
160
160
  }), /* @__PURE__ */ l("div", {
161
161
  className: "relative",
162
162
  children: [
@@ -166,19 +166,19 @@ var g = () => {
166
166
  }),
167
167
  /* @__PURE__ */ l("select", {
168
168
  id: "editor-target-language",
169
- className: P,
169
+ className: N,
170
170
  children: [
171
171
  /* @__PURE__ */ c("option", {
172
172
  value: "es-ES",
173
- children: _("i18n.shared.language.esEs", "Spanish (es-ES)")
173
+ children: g("i18n.shared.language.esEs", "Spanish (es-ES)")
174
174
  }),
175
175
  /* @__PURE__ */ c("option", {
176
176
  value: "fr-FR",
177
- children: _("i18n.shared.language.frFr", "French (fr-FR)")
177
+ children: g("i18n.shared.language.frFr", "French (fr-FR)")
178
178
  }),
179
179
  /* @__PURE__ */ c("option", {
180
180
  value: "de-DE",
181
- children: _("i18n.shared.language.deDe", "German (de-DE)")
181
+ children: g("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: _("i18n.editor.fields.compareWith", "Compare With")
196
+ children: g("i18n.editor.fields.compareWith", "Compare With")
197
197
  }), /* @__PURE__ */ l("div", {
198
198
  className: "relative",
199
199
  children: [
@@ -203,15 +203,15 @@ var g = () => {
203
203
  }),
204
204
  /* @__PURE__ */ l("select", {
205
205
  id: "editor-compare-language",
206
- value: x || "",
207
- onChange: (e) => T(e.target.value || null),
208
- className: P,
206
+ value: b || "",
207
+ onChange: (e) => w(e.target.value || null),
208
+ className: N,
209
209
  children: [/* @__PURE__ */ c("option", {
210
210
  value: "",
211
- children: _("i18n.shared.empty.none", "None")
211
+ children: g("i18n.shared.empty.none", "None")
212
212
  }), /* @__PURE__ */ c("option", {
213
213
  value: "en",
214
- children: _("i18n.shared.language.en", "English (en)")
214
+ children: g("i18n.shared.language.en", "English (en)")
215
215
  })]
216
216
  }),
217
217
  /* @__PURE__ */ c(e, {
@@ -222,21 +222,21 @@ var g = () => {
222
222
  })]
223
223
  })]
224
224
  }),
225
- x && /* @__PURE__ */ l(f, {
225
+ b && /* @__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: _("i18n.editor.comparison.sourceLanguage", "English (Source)")
231
+ children: g("i18n.editor.comparison.sourceLanguage", "English (Source)")
232
232
  }),
233
233
  /* @__PURE__ */ c("p", {
234
234
  className: "text-sm text-text-secondary",
235
- children: A.defaultValue
235
+ children: k.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: _("i18n.editor.comparison.characterLimit", "Character limit: {{limit}}", { limit: A.characterLimit }) }), /* @__PURE__ */ c("span", { children: _("i18n.editor.comparison.placeholders", "Placeholders: none") })]
239
+ children: [/* @__PURE__ */ c("span", { children: g("i18n.editor.comparison.characterLimit", "Character limit: {{limit}}", { limit: k.characterLimit }) }), /* @__PURE__ */ c("span", { children: g("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: _("i18n.editor.fields.translationValue", "Translation Value")
250
+ children: g("i18n.editor.fields.translationValue", "Translation Value")
251
251
  }), /* @__PURE__ */ c("span", {
252
252
  className: "text-xs text-text-tertiary tabular-nums",
253
- children: _("i18n.editor.fields.characterCount", "{{current}}/{{limit}}", {
254
- current: E.length,
255
- limit: A.characterLimit
253
+ children: g("i18n.editor.fields.characterCount", "{{current}}/{{limit}}", {
254
+ current: T.length,
255
+ limit: k.characterLimit
256
256
  })
257
257
  })]
258
258
  }), /* @__PURE__ */ c("textarea", {
259
259
  id: "editor-translation-value",
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,
260
+ "aria-label": g("i18n.editor.fields.translationValue", "Translation Value"),
261
+ value: T,
262
+ onChange: (e) => E(e.target.value),
263
+ placeholder: g("i18n.editor.fields.translationPlaceholder", "Enter translation..."),
264
+ maxLength: k.characterLimit,
265
+ className: M,
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: _("i18n.editor.fields.notes", "Translation Notes")
272
+ children: g("i18n.editor.fields.notes", "Translation Notes")
273
273
  }), /* @__PURE__ */ c("textarea", {
274
274
  id: "editor-notes",
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,
275
+ "aria-label": g("i18n.editor.fields.notes", "Translation Notes"),
276
+ value: D,
277
+ onChange: (e) => O(e.target.value),
278
+ placeholder: g("i18n.editor.fields.notesPlaceholder", "Add notes for reviewers..."),
279
+ className: M,
280
280
  rows: 3
281
281
  })] }),
282
282
  /* @__PURE__ */ c(u, {
283
283
  align: "start",
284
284
  primary: {
285
- label: _("i18n.editor.actions.saveDraft", "Save Draft"),
285
+ label: g("i18n.editor.actions.saveDraft", "Save Draft"),
286
286
  onSelect: () => void 0,
287
287
  icon: /* @__PURE__ */ c(r, {
288
288
  className: "size-4",
@@ -290,7 +290,7 @@ var g = () => {
290
290
  })
291
291
  },
292
292
  actions: [{
293
- label: _("i18n.editor.actions.submitForReview", "Submit for Review"),
293
+ label: g("i18n.editor.actions.submitForReview", "Submit for Review"),
294
294
  onSelect: () => void 0,
295
295
  icon: /* @__PURE__ */ c(i, {
296
296
  className: "size-4",
@@ -300,26 +300,26 @@ var g = () => {
300
300
  })
301
301
  ]
302
302
  })
303
- }), b && /* @__PURE__ */ l("aside", {
303
+ }), y && /* @__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: _("i18n.editor.suggestions.title", "Suggestions")
307
+ children: g("i18n.editor.suggestions.title", "Suggestions")
308
308
  }), /* @__PURE__ */ c("div", {
309
309
  className: "space-y-3",
310
- children: j.map((e) => /* @__PURE__ */ c(f, {
310
+ children: A.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: () => D(e.value),
316
+ onClick: () => E(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: _("i18n.editor.suggestions.match", "{{similarity}}% match", { similarity: e.similarity })
322
+ children: g("i18n.editor.suggestions.match", "{{similarity}}% match", { similarity: e.similarity })
323
323
  })]
324
324
  })
325
325
  }, e.value))
@@ -1,45 +1,46 @@
1
- import { interpolateFallback as e } from "../utils/i18n.js";
2
- import { createContext as t, use as n, useCallback as r, useMemo as i } from "react";
3
- import { MemoryRouter as a } from "react-router";
4
- import { jsx as o } from "react/jsx-runtime";
1
+ import { enTranslations as e } from "../translations/en.js";
2
+ import { interpolateFallback as t } from "../utils/i18n.js";
3
+ import { createContext as n, use as r, useCallback as i, useMemo as a } from "react";
4
+ import { MemoryRouter as o } from "react-router";
5
+ import { jsx as s } from "react/jsx-runtime";
5
6
  //#region src/i18n/providers/I18nProvider.tsx
6
- var s = t(null), c = () => {
7
- let e = n(s);
7
+ var c = n(null), l = () => {
8
+ let e = r(c);
8
9
  if (!e) throw Error("useI18n must be used within I18nProvider");
9
10
  return e;
10
- }, l = ({ children: t, basePath: n, navigate: c, currentUser: l, tenantId: u, apiGatewayUrl: d, authToken: f, translations: p, onLanguageChange: m, onTranslationPublish: h, defaultView: g }) => {
11
- let _ = r((t, n, r) => e(p?.[t] ?? n ?? t, r), [p]), v = i(() => ({
12
- basePath: n,
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: _
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) => t(m?.[n] ?? e[n] ?? r ?? n, i), [m]), y = a(() => ({
13
+ basePath: r,
14
+ navigate: l,
15
+ currentUser: u,
16
+ tenantId: d,
17
+ apiGatewayUrl: f,
18
+ authToken: p,
19
+ translations: m,
20
+ onLanguageChange: h,
21
+ onTranslationPublish: g,
22
+ defaultView: _,
23
+ t: v
23
24
  }), [
24
- d,
25
25
  f,
26
- n,
26
+ p,
27
+ r,
28
+ u,
29
+ _,
27
30
  l,
28
- g,
29
- c,
30
- m,
31
31
  h,
32
- _,
33
- u,
34
- p
32
+ g,
33
+ v,
34
+ d,
35
+ m
35
36
  ]);
36
- return n ? /* @__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 })
37
+ return r ? /* @__PURE__ */ s(c.Provider, {
38
+ value: y,
39
+ children: n
40
+ }) : /* @__PURE__ */ s(c.Provider, {
41
+ value: y,
42
+ children: /* @__PURE__ */ s(o, { children: n })
42
43
  });
43
44
  };
44
45
  //#endregion
45
- export { l as I18nProvider, c as useI18n };
46
+ export { u as I18nProvider, l as useI18n };