@burdenoff/microfe-i18n 2026.625.1 → 2026.625.2
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/pages/ImportExportPage.js +95 -96
- package/dist/i18n/pages/LanguagesListPage.js +72 -40
- package/dist/i18n/pages/LocaleConfigPage.js +85 -57
- package/dist/i18n/pages/ProductsListPage.js +26 -25
- package/dist/i18n/pages/ProgressDashboardPage.js +126 -101
- package/dist/i18n/pages/ReviewQueuePage.js +24 -23
- package/dist/i18n/pages/TranslationEditorPage.js +106 -78
- package/package.json +2 -2
|
@@ -5,10 +5,10 @@ import { useI18n as r } from "../providers/I18nProvider.js";
|
|
|
5
5
|
import { useI18nStore as i } from "../store/i18nStore.js";
|
|
6
6
|
import { useState as a } from "react";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
import { CTAOverflowMenu as c,
|
|
8
|
+
import { CTAOverflowMenu as c, EmphasisPanel as l, GlassCard as u, GradientText as d, IllustratedEmptyState as f, PagePurpose as p } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
//#region src/i18n/pages/LanguagesListPage.tsx
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
10
|
+
var m = () => {
|
|
11
|
+
let { t: m } = r(), h = (e, t, n) => m(e, t, n), { languageFilter: g, updateLanguageFilter: _, setSelectedLanguage: v } = i(), [y, b] = a(g.search), x = [{
|
|
12
12
|
id: "1",
|
|
13
13
|
code: "en",
|
|
14
14
|
name: "English",
|
|
@@ -24,9 +24,9 @@ var f = () => {
|
|
|
24
24
|
direction: "ltr",
|
|
25
25
|
status: "active",
|
|
26
26
|
isDefault: !1
|
|
27
|
-
}],
|
|
28
|
-
|
|
29
|
-
},
|
|
27
|
+
}], S = (e) => {
|
|
28
|
+
b(e), _({ search: e });
|
|
29
|
+
}, 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)]", w = (y ?? "").trim().length > 0 || g.status !== "all" || g.direction !== "all", T = x.filter((e) => e.status === "active").length, E = x.find((e) => e.isDefault);
|
|
30
30
|
return /* @__PURE__ */ s("div", {
|
|
31
31
|
className: "min-h-full w-full bg-bg-surface",
|
|
32
32
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -43,14 +43,14 @@ var f = () => {
|
|
|
43
43
|
})
|
|
44
44
|
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h1", {
|
|
45
45
|
className: "text-2xl font-bold tracking-tight text-text-primary",
|
|
46
|
-
children: /* @__PURE__ */ o(
|
|
46
|
+
children: /* @__PURE__ */ o(d, { children: h("i18n.languages.title", "Languages") })
|
|
47
47
|
}), /* @__PURE__ */ o("p", {
|
|
48
48
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
49
|
-
children:
|
|
49
|
+
children: h("i18n.languages.subtitle", "Configure the locales your products ship in")
|
|
50
50
|
})] })]
|
|
51
51
|
}), /* @__PURE__ */ o(c, {
|
|
52
52
|
primary: {
|
|
53
|
-
label:
|
|
53
|
+
label: h("i18n.languages.actions.add", "Add Language"),
|
|
54
54
|
onSelect: () => void 0,
|
|
55
55
|
icon: /* @__PURE__ */ o(t, {
|
|
56
56
|
className: "size-4",
|
|
@@ -63,6 +63,38 @@ var f = () => {
|
|
|
63
63
|
}), /* @__PURE__ */ s("div", {
|
|
64
64
|
className: "mx-auto max-w-screen-xl space-y-6 px-6 py-8 sm:px-8 lg:px-10",
|
|
65
65
|
children: [
|
|
66
|
+
/* @__PURE__ */ o(p, { children: h("i18n.languages.purpose", "This is the master list of every locale your products can ship in — the set of languages translators can work in and users can switch to. Add a language here before any of its translations can be entered, set which one is the default fallback, and configure its formatting and text direction.") }),
|
|
67
|
+
/* @__PURE__ */ s(l, {
|
|
68
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-center",
|
|
69
|
+
children: [/* @__PURE__ */ s("div", {
|
|
70
|
+
className: "flex flex-1 items-center gap-4",
|
|
71
|
+
children: [/* @__PURE__ */ o("div", {
|
|
72
|
+
className: "flex size-14 shrink-0 items-center justify-center rounded-2xl bg-action-primary-bg/10 text-primary shadow-elevation-1",
|
|
73
|
+
children: /* @__PURE__ */ o(e, {
|
|
74
|
+
className: "size-7",
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
})
|
|
77
|
+
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("p", {
|
|
78
|
+
className: "text-sm font-medium text-text-secondary",
|
|
79
|
+
children: h("i18n.languages.summary.label", "Languages configured")
|
|
80
|
+
}), /* @__PURE__ */ o("p", {
|
|
81
|
+
className: "text-4xl font-bold tracking-tight text-text-primary tabular-nums",
|
|
82
|
+
children: x.length
|
|
83
|
+
})] })]
|
|
84
|
+
}), /* @__PURE__ */ s("div", {
|
|
85
|
+
className: "flex flex-wrap gap-3 sm:justify-end",
|
|
86
|
+
children: [/* @__PURE__ */ s("div", {
|
|
87
|
+
className: "flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-sunken/60 px-3 py-1.5 text-xs text-text-secondary",
|
|
88
|
+
children: [/* @__PURE__ */ o("span", {
|
|
89
|
+
className: "size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse",
|
|
90
|
+
"aria-hidden": "true"
|
|
91
|
+
}), h("i18n.languages.summary.active", "{{count}} active", { count: T })]
|
|
92
|
+
}), E && /* @__PURE__ */ o("div", {
|
|
93
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken/60 px-3 py-1.5 text-xs text-text-secondary",
|
|
94
|
+
children: h("i18n.languages.summary.default", "Default: {{name}}", { name: E.name })
|
|
95
|
+
})]
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
66
98
|
/* @__PURE__ */ s("div", {
|
|
67
99
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
68
100
|
children: [
|
|
@@ -73,69 +105,69 @@ var f = () => {
|
|
|
73
105
|
"aria-hidden": "true"
|
|
74
106
|
}), /* @__PURE__ */ o("input", {
|
|
75
107
|
type: "text",
|
|
76
|
-
"aria-label":
|
|
77
|
-
placeholder:
|
|
78
|
-
value:
|
|
79
|
-
onChange: (e) =>
|
|
108
|
+
"aria-label": h("i18n.languages.filters.searchAriaLabel", "Search languages"),
|
|
109
|
+
placeholder: h("i18n.languages.filters.searchPlaceholder", "Search languages..."),
|
|
110
|
+
value: y,
|
|
111
|
+
onChange: (e) => S(e.target.value),
|
|
80
112
|
className: "w-full rounded-lg border border-border-seam bg-bg-elevated py-2.5 pl-10 pr-4 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)]"
|
|
81
113
|
})]
|
|
82
114
|
}),
|
|
83
115
|
/* @__PURE__ */ s("select", {
|
|
84
|
-
"aria-label":
|
|
85
|
-
value:
|
|
86
|
-
onChange: (e) =>
|
|
87
|
-
className:
|
|
116
|
+
"aria-label": h("i18n.languages.filters.status.label", "Filter by status"),
|
|
117
|
+
value: g.status,
|
|
118
|
+
onChange: (e) => _({ status: e.target.value }),
|
|
119
|
+
className: C,
|
|
88
120
|
children: [
|
|
89
121
|
/* @__PURE__ */ o("option", {
|
|
90
122
|
value: "all",
|
|
91
|
-
children:
|
|
123
|
+
children: h("i18n.languages.filters.status.all", "All Status")
|
|
92
124
|
}),
|
|
93
125
|
/* @__PURE__ */ o("option", {
|
|
94
126
|
value: "active",
|
|
95
|
-
children:
|
|
127
|
+
children: h("i18n.shared.status.active", "Active")
|
|
96
128
|
}),
|
|
97
129
|
/* @__PURE__ */ o("option", {
|
|
98
130
|
value: "inactive",
|
|
99
|
-
children:
|
|
131
|
+
children: h("i18n.shared.status.inactive", "Inactive")
|
|
100
132
|
})
|
|
101
133
|
]
|
|
102
134
|
}),
|
|
103
135
|
/* @__PURE__ */ s("select", {
|
|
104
|
-
"aria-label":
|
|
105
|
-
value:
|
|
106
|
-
onChange: (e) =>
|
|
107
|
-
className:
|
|
136
|
+
"aria-label": h("i18n.languages.filters.direction.label", "Filter by direction"),
|
|
137
|
+
value: g.direction,
|
|
138
|
+
onChange: (e) => _({ direction: e.target.value }),
|
|
139
|
+
className: C,
|
|
108
140
|
children: [
|
|
109
141
|
/* @__PURE__ */ o("option", {
|
|
110
142
|
value: "all",
|
|
111
|
-
children:
|
|
143
|
+
children: h("i18n.languages.filters.direction.all", "All Directions")
|
|
112
144
|
}),
|
|
113
145
|
/* @__PURE__ */ o("option", {
|
|
114
146
|
value: "ltr",
|
|
115
|
-
children:
|
|
147
|
+
children: h("i18n.shared.direction.ltr", "LTR")
|
|
116
148
|
}),
|
|
117
149
|
/* @__PURE__ */ o("option", {
|
|
118
150
|
value: "rtl",
|
|
119
|
-
children:
|
|
151
|
+
children: h("i18n.shared.direction.rtl", "RTL")
|
|
120
152
|
})
|
|
121
153
|
]
|
|
122
154
|
})
|
|
123
155
|
]
|
|
124
156
|
}),
|
|
125
|
-
|
|
126
|
-
illustration:
|
|
127
|
-
title:
|
|
128
|
-
description:
|
|
157
|
+
x.length === 0 && /* @__PURE__ */ o(f, {
|
|
158
|
+
illustration: w ? "empty-search" : "empty-data",
|
|
159
|
+
title: w ? h("i18n.languages.empty.search.title", "No languages match") : h("i18n.languages.empty.title", "No languages yet"),
|
|
160
|
+
description: w ? h("i18n.languages.empty.search.description", "Adjust your filters to see more languages.") : h("i18n.languages.empty.description", "Add a language to begin localizing your products.")
|
|
129
161
|
}),
|
|
130
|
-
|
|
162
|
+
x.length > 0 && /* @__PURE__ */ o("div", {
|
|
131
163
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
132
|
-
children:
|
|
164
|
+
children: x.map((e, t) => /* @__PURE__ */ o(u, {
|
|
133
165
|
treatment: "metric",
|
|
134
166
|
glow: t === 0,
|
|
135
167
|
className: "border-border-seam",
|
|
136
168
|
children: /* @__PURE__ */ o("button", {
|
|
137
169
|
type: "button",
|
|
138
|
-
onClick: () =>
|
|
170
|
+
onClick: () => v(e),
|
|
139
171
|
className: "block w-full cursor-pointer rounded-[inherit] p-5 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
|
|
140
172
|
children: /* @__PURE__ */ s("div", {
|
|
141
173
|
className: "flex items-start justify-between gap-3",
|
|
@@ -149,7 +181,7 @@ var f = () => {
|
|
|
149
181
|
children: e.name
|
|
150
182
|
}), e.isDefault && /* @__PURE__ */ o("span", {
|
|
151
183
|
className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
152
|
-
children:
|
|
184
|
+
children: h("i18n.languages.badges.default", "Default")
|
|
153
185
|
})]
|
|
154
186
|
}),
|
|
155
187
|
/* @__PURE__ */ o("p", {
|
|
@@ -159,19 +191,19 @@ var f = () => {
|
|
|
159
191
|
/* @__PURE__ */ s("div", {
|
|
160
192
|
className: "mt-2 flex items-center gap-3 text-xs text-text-tertiary tabular-nums",
|
|
161
193
|
children: [
|
|
162
|
-
/* @__PURE__ */ o("span", { children:
|
|
194
|
+
/* @__PURE__ */ o("span", { children: h("i18n.languages.card.code", "Code: {{code}}", { code: e.code }) }),
|
|
163
195
|
/* @__PURE__ */ o("span", {
|
|
164
196
|
"aria-hidden": "true",
|
|
165
197
|
children: "•"
|
|
166
198
|
}),
|
|
167
|
-
/* @__PURE__ */ o("span", { children: e.direction === "ltr" ?
|
|
199
|
+
/* @__PURE__ */ o("span", { children: e.direction === "ltr" ? h("i18n.shared.direction.ltr", "LTR") : h("i18n.shared.direction.rtl", "RTL") })
|
|
168
200
|
]
|
|
169
201
|
})
|
|
170
202
|
]
|
|
171
203
|
}), /* @__PURE__ */ o("span", {
|
|
172
204
|
className: `mt-1 size-2 rounded-full ${e.status === "active" ? "bg-status-success-text motion-safe:animate-vc-glow-pulse" : "bg-text-tertiary"}`,
|
|
173
|
-
title: e.status === "active" ?
|
|
174
|
-
"aria-label": e.status === "active" ?
|
|
205
|
+
title: e.status === "active" ? h("i18n.shared.status.active", "Active") : h("i18n.shared.status.inactive", "Inactive"),
|
|
206
|
+
"aria-label": e.status === "active" ? h("i18n.shared.status.active", "Active") : h("i18n.shared.status.inactive", "Inactive")
|
|
175
207
|
})]
|
|
176
208
|
})
|
|
177
209
|
})
|
|
@@ -182,4 +214,4 @@ var f = () => {
|
|
|
182
214
|
});
|
|
183
215
|
};
|
|
184
216
|
//#endregion
|
|
185
|
-
export {
|
|
217
|
+
export { m as LanguagesListPage };
|
|
@@ -3,10 +3,10 @@ import { Settings as t } from "../../node_modules/lucide-react/dist/esm/icons/se
|
|
|
3
3
|
import { Trash2 as n } from "../../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
4
4
|
import { useState as r } from "react";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import { CTAOverflowMenu as o,
|
|
6
|
+
import { CTAOverflowMenu as o, EmphasisPanel as s, GlassCard as c, GradientText as l, NextSteps as u, OptionalFields as d, PagePurpose as f } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/i18n/pages/LocaleConfigPage.tsx
|
|
8
|
-
var
|
|
9
|
-
let [
|
|
8
|
+
var p = () => {
|
|
9
|
+
let [p, m] = r({
|
|
10
10
|
code: "es-ES",
|
|
11
11
|
name: "Spanish",
|
|
12
12
|
nativeName: "Español",
|
|
@@ -26,22 +26,22 @@ var u = () => {
|
|
|
26
26
|
few: !1,
|
|
27
27
|
many: !1
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
30
|
-
|
|
29
|
+
}), h = (e, t) => {
|
|
30
|
+
m((n) => ({
|
|
31
31
|
...n,
|
|
32
32
|
[e]: t
|
|
33
33
|
}));
|
|
34
|
-
},
|
|
35
|
-
|
|
34
|
+
}, g = (e, t) => {
|
|
35
|
+
m((n) => ({
|
|
36
36
|
...n,
|
|
37
37
|
pluralRules: {
|
|
38
38
|
...n.pluralRules,
|
|
39
39
|
[e]: t
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
|
-
},
|
|
43
|
-
console.log("Saving locale config:",
|
|
44
|
-
},
|
|
42
|
+
}, _ = () => {
|
|
43
|
+
console.log("Saving locale config:", p);
|
|
44
|
+
}, v = "w-full 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)]", y = "size-4 rounded border-border-seam text-primary focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]";
|
|
45
45
|
return /* @__PURE__ */ a("div", {
|
|
46
46
|
className: "flex h-full flex-col bg-bg-surface",
|
|
47
47
|
children: [/* @__PURE__ */ i("div", {
|
|
@@ -58,20 +58,20 @@ var u = () => {
|
|
|
58
58
|
})
|
|
59
59
|
}), /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ a("h1", {
|
|
60
60
|
className: "text-2xl font-bold tracking-tight text-text-primary",
|
|
61
|
-
children: ["Locale ", /* @__PURE__ */ i(
|
|
61
|
+
children: ["Locale ", /* @__PURE__ */ i(l, { children: "Configuration" })]
|
|
62
62
|
}), /* @__PURE__ */ a("p", {
|
|
63
63
|
className: "mt-1 text-sm text-text-secondary",
|
|
64
64
|
children: [
|
|
65
|
-
|
|
65
|
+
p.name,
|
|
66
66
|
" (",
|
|
67
|
-
|
|
67
|
+
p.nativeName,
|
|
68
68
|
")"
|
|
69
69
|
]
|
|
70
70
|
})] })]
|
|
71
71
|
}), /* @__PURE__ */ i(o, {
|
|
72
72
|
primary: {
|
|
73
73
|
label: "Save Changes",
|
|
74
|
-
onSelect:
|
|
74
|
+
onSelect: _,
|
|
75
75
|
icon: /* @__PURE__ */ i(e, {
|
|
76
76
|
className: "size-4",
|
|
77
77
|
"aria-hidden": "true"
|
|
@@ -80,7 +80,7 @@ var u = () => {
|
|
|
80
80
|
actions: [{
|
|
81
81
|
label: "Delete Language",
|
|
82
82
|
onSelect: () => {
|
|
83
|
-
window.confirm(`Delete language "${
|
|
83
|
+
window.confirm(`Delete language "${p.name}"? This cannot be undone.`);
|
|
84
84
|
},
|
|
85
85
|
intent: "destructive",
|
|
86
86
|
icon: /* @__PURE__ */ i(n, {
|
|
@@ -95,9 +95,36 @@ var u = () => {
|
|
|
95
95
|
children: /* @__PURE__ */ a("div", {
|
|
96
96
|
className: "mx-auto max-w-3xl space-y-6",
|
|
97
97
|
children: [
|
|
98
|
+
/* @__PURE__ */ i(f, { children: "This is where you define how a single locale behaves — not its translations, but the rules around them: which code and region it represents, whether text flows left-to-right or right-to-left, how dates, numbers and currency are formatted, which CLDR plural forms apply, and which locales to fall back to when a string is missing. Get these right once and every translation in this language renders correctly for its users." }),
|
|
99
|
+
/* @__PURE__ */ i(u, {
|
|
100
|
+
storageKey: "i18n-locale-config",
|
|
101
|
+
steps: [
|
|
102
|
+
{
|
|
103
|
+
id: "set-default",
|
|
104
|
+
label: "Make this the default locale",
|
|
105
|
+
description: "Used as the fallback whenever a string has no translation in the requested language.",
|
|
106
|
+
done: p.isDefault,
|
|
107
|
+
onClick: () => h("isDefault", !0)
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "check-formatting",
|
|
111
|
+
label: "Review date, number & currency formats",
|
|
112
|
+
description: "Confirm the previews match how users in this region expect to read values.",
|
|
113
|
+
onClick: () => document.getElementById("locale-formatting")?.scrollIntoView({
|
|
114
|
+
behavior: "smooth",
|
|
115
|
+
block: "start"
|
|
116
|
+
})
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "save-config",
|
|
120
|
+
label: "Save your changes",
|
|
121
|
+
description: "Persist this locale's configuration so translations start rendering with these rules.",
|
|
122
|
+
onClick: _
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}),
|
|
98
126
|
/* @__PURE__ */ a(s, {
|
|
99
|
-
|
|
100
|
-
className: "border-border-seam p-6",
|
|
127
|
+
className: "p-6",
|
|
101
128
|
children: [
|
|
102
129
|
/* @__PURE__ */ i("h2", {
|
|
103
130
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
@@ -114,9 +141,9 @@ var u = () => {
|
|
|
114
141
|
id: "locale-language-code",
|
|
115
142
|
type: "text",
|
|
116
143
|
"aria-label": "Language Code",
|
|
117
|
-
value:
|
|
118
|
-
onChange: (e) =>
|
|
119
|
-
className:
|
|
144
|
+
value: p.code,
|
|
145
|
+
onChange: (e) => h("code", e.target.value),
|
|
146
|
+
className: v
|
|
120
147
|
})] }),
|
|
121
148
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
122
149
|
htmlFor: "locale-name",
|
|
@@ -126,9 +153,9 @@ var u = () => {
|
|
|
126
153
|
id: "locale-name",
|
|
127
154
|
type: "text",
|
|
128
155
|
"aria-label": "Name",
|
|
129
|
-
value:
|
|
130
|
-
onChange: (e) =>
|
|
131
|
-
className:
|
|
156
|
+
value: p.name,
|
|
157
|
+
onChange: (e) => h("name", e.target.value),
|
|
158
|
+
className: v
|
|
132
159
|
})] }),
|
|
133
160
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
134
161
|
htmlFor: "locale-native-name",
|
|
@@ -138,9 +165,9 @@ var u = () => {
|
|
|
138
165
|
id: "locale-native-name",
|
|
139
166
|
type: "text",
|
|
140
167
|
"aria-label": "Native Name",
|
|
141
|
-
value:
|
|
142
|
-
onChange: (e) =>
|
|
143
|
-
className:
|
|
168
|
+
value: p.nativeName,
|
|
169
|
+
onChange: (e) => h("nativeName", e.target.value),
|
|
170
|
+
className: v
|
|
144
171
|
})] }),
|
|
145
172
|
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
146
173
|
htmlFor: "locale-region",
|
|
@@ -150,9 +177,9 @@ var u = () => {
|
|
|
150
177
|
id: "locale-region",
|
|
151
178
|
type: "text",
|
|
152
179
|
"aria-label": "Region",
|
|
153
|
-
value:
|
|
154
|
-
onChange: (e) =>
|
|
155
|
-
className:
|
|
180
|
+
value: p.region,
|
|
181
|
+
onChange: (e) => h("region", e.target.value),
|
|
182
|
+
className: v
|
|
156
183
|
})] })
|
|
157
184
|
]
|
|
158
185
|
}),
|
|
@@ -162,9 +189,9 @@ var u = () => {
|
|
|
162
189
|
type: "checkbox",
|
|
163
190
|
id: "is-default",
|
|
164
191
|
"aria-label": "Set as default language",
|
|
165
|
-
checked:
|
|
166
|
-
onChange: (e) =>
|
|
167
|
-
className:
|
|
192
|
+
checked: p.isDefault,
|
|
193
|
+
onChange: (e) => h("isDefault", e.target.checked),
|
|
194
|
+
className: y
|
|
168
195
|
}), /* @__PURE__ */ i("label", {
|
|
169
196
|
htmlFor: "is-default",
|
|
170
197
|
className: "text-sm text-text-primary",
|
|
@@ -173,7 +200,7 @@ var u = () => {
|
|
|
173
200
|
})
|
|
174
201
|
]
|
|
175
202
|
}),
|
|
176
|
-
/* @__PURE__ */ a(
|
|
203
|
+
/* @__PURE__ */ a(c, {
|
|
177
204
|
treatment: "plain",
|
|
178
205
|
className: "border-border-seam p-6",
|
|
179
206
|
children: [/* @__PURE__ */ i("h2", {
|
|
@@ -188,8 +215,8 @@ var u = () => {
|
|
|
188
215
|
id: "ltr",
|
|
189
216
|
name: "direction",
|
|
190
217
|
"aria-label": "LTR (Left to Right)",
|
|
191
|
-
checked:
|
|
192
|
-
onChange: () =>
|
|
218
|
+
checked: p.direction === "ltr",
|
|
219
|
+
onChange: () => h("direction", "ltr"),
|
|
193
220
|
className: "size-4 border-border-seam text-primary focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
|
|
194
221
|
}), /* @__PURE__ */ i("label", {
|
|
195
222
|
htmlFor: "ltr",
|
|
@@ -203,8 +230,8 @@ var u = () => {
|
|
|
203
230
|
id: "rtl",
|
|
204
231
|
name: "direction",
|
|
205
232
|
"aria-label": "RTL (Right to Left)",
|
|
206
|
-
checked:
|
|
207
|
-
onChange: () =>
|
|
233
|
+
checked: p.direction === "rtl",
|
|
234
|
+
onChange: () => h("direction", "rtl"),
|
|
208
235
|
className: "size-4 border-border-seam text-primary focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
|
|
209
236
|
}), /* @__PURE__ */ i("label", {
|
|
210
237
|
htmlFor: "rtl",
|
|
@@ -214,7 +241,7 @@ var u = () => {
|
|
|
214
241
|
})]
|
|
215
242
|
})]
|
|
216
243
|
}),
|
|
217
|
-
/* @__PURE__ */ a(
|
|
244
|
+
/* @__PURE__ */ a(d, {
|
|
218
245
|
title: "Advanced settings",
|
|
219
246
|
description: "ICU plural-form overrides and fallback locale rules.",
|
|
220
247
|
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h2", {
|
|
@@ -236,7 +263,7 @@ var u = () => {
|
|
|
236
263
|
})]
|
|
237
264
|
})
|
|
238
265
|
}),
|
|
239
|
-
|
|
266
|
+
p.fallbackLanguages.map((e, t) => /* @__PURE__ */ i("div", {
|
|
240
267
|
className: "rounded-lg border border-border-seam bg-bg-surface p-3",
|
|
241
268
|
children: /* @__PURE__ */ a("div", {
|
|
242
269
|
className: "flex items-center justify-between",
|
|
@@ -268,15 +295,15 @@ var u = () => {
|
|
|
268
295
|
children: "Plural Rules (CLDR-based)"
|
|
269
296
|
}), /* @__PURE__ */ i("div", {
|
|
270
297
|
className: "grid grid-cols-2 gap-3 sm:grid-cols-3",
|
|
271
|
-
children: Object.entries(
|
|
298
|
+
children: Object.entries(p.pluralRules).map(([e, t]) => /* @__PURE__ */ a("div", {
|
|
272
299
|
className: "flex items-center gap-2 rounded-lg border border-border-seam bg-bg-elevated p-3",
|
|
273
300
|
children: [/* @__PURE__ */ i("input", {
|
|
274
301
|
type: "checkbox",
|
|
275
302
|
id: `plural-${e}`,
|
|
276
303
|
"aria-label": `Plural form: ${e}`,
|
|
277
304
|
checked: t,
|
|
278
|
-
onChange: (t) =>
|
|
279
|
-
className:
|
|
305
|
+
onChange: (t) => g(e, t.target.checked),
|
|
306
|
+
className: y
|
|
280
307
|
}), /* @__PURE__ */ i("label", {
|
|
281
308
|
htmlFor: `plural-${e}`,
|
|
282
309
|
className: "text-sm text-text-primary",
|
|
@@ -286,9 +313,10 @@ var u = () => {
|
|
|
286
313
|
})]
|
|
287
314
|
})]
|
|
288
315
|
}),
|
|
289
|
-
/* @__PURE__ */ a(
|
|
316
|
+
/* @__PURE__ */ a(c, {
|
|
317
|
+
id: "locale-formatting",
|
|
290
318
|
treatment: "plain",
|
|
291
|
-
className: "border-border-seam p-6",
|
|
319
|
+
className: "scroll-mt-6 border-border-seam p-6",
|
|
292
320
|
children: [/* @__PURE__ */ i("h2", {
|
|
293
321
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
294
322
|
children: "Formatting"
|
|
@@ -305,9 +333,9 @@ var u = () => {
|
|
|
305
333
|
id: "locale-date-format",
|
|
306
334
|
type: "text",
|
|
307
335
|
"aria-label": "Date Format",
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
className:
|
|
336
|
+
value: p.dateFormat,
|
|
337
|
+
onChange: (e) => h("dateFormat", e.target.value),
|
|
338
|
+
className: v
|
|
311
339
|
}),
|
|
312
340
|
/* @__PURE__ */ i("p", {
|
|
313
341
|
className: "mt-1 text-xs text-text-tertiary tabular-nums",
|
|
@@ -324,9 +352,9 @@ var u = () => {
|
|
|
324
352
|
id: "locale-time-format",
|
|
325
353
|
type: "text",
|
|
326
354
|
"aria-label": "Time Format",
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
329
|
-
className:
|
|
355
|
+
value: p.timeFormat,
|
|
356
|
+
onChange: (e) => h("timeFormat", e.target.value),
|
|
357
|
+
className: v
|
|
330
358
|
}),
|
|
331
359
|
/* @__PURE__ */ i("p", {
|
|
332
360
|
className: "mt-1 text-xs text-text-tertiary tabular-nums",
|
|
@@ -343,9 +371,9 @@ var u = () => {
|
|
|
343
371
|
id: "locale-number-format",
|
|
344
372
|
type: "text",
|
|
345
373
|
"aria-label": "Number Format",
|
|
346
|
-
value:
|
|
347
|
-
onChange: (e) =>
|
|
348
|
-
className:
|
|
374
|
+
value: p.numberFormat,
|
|
375
|
+
onChange: (e) => h("numberFormat", e.target.value),
|
|
376
|
+
className: v
|
|
349
377
|
}),
|
|
350
378
|
/* @__PURE__ */ i("p", {
|
|
351
379
|
className: "mt-1 text-xs text-text-tertiary tabular-nums",
|
|
@@ -362,9 +390,9 @@ var u = () => {
|
|
|
362
390
|
id: "locale-currency-code",
|
|
363
391
|
type: "text",
|
|
364
392
|
"aria-label": "Currency Code",
|
|
365
|
-
value:
|
|
366
|
-
onChange: (e) =>
|
|
367
|
-
className:
|
|
393
|
+
value: p.currencyCode,
|
|
394
|
+
onChange: (e) => h("currencyCode", e.target.value),
|
|
395
|
+
className: v
|
|
368
396
|
}),
|
|
369
397
|
/* @__PURE__ */ i("p", {
|
|
370
398
|
className: "mt-1 text-xs text-text-tertiary",
|
|
@@ -380,4 +408,4 @@ var u = () => {
|
|
|
380
408
|
});
|
|
381
409
|
};
|
|
382
410
|
//#endregion
|
|
383
|
-
export {
|
|
411
|
+
export { p as LocaleConfigPage };
|