feat: localize optimizer interface

This commit is contained in:
Codex
2026-06-21 23:43:02 +08:00
parent 1298456683
commit 1596de4527
6 changed files with 72 additions and 56 deletions
+20 -10
View File
@@ -19,6 +19,16 @@ const listFields = [
"uncertain_items",
] as const;
const fieldLabels: Record<(typeof listFields)[number], string> = {
company_short_names: "公司简称",
brand_names: "品牌名称",
product_names: "产品名称",
core_claims: "核心事实/主张",
forbidden_claims: "禁止使用的主张",
image_topics: "图片主题",
uncertain_items: "待确认事项",
};
export function FactCardEditor({
factCard,
isSaving,
@@ -28,7 +38,7 @@ export function FactCardEditor({
if (!factCard) {
return (
<section className="panel empty-panel">
<div className="panel-heading">Fact Card</div>
<div className="panel-heading"></div>
</section>
);
}
@@ -53,13 +63,13 @@ export function FactCardEditor({
return (
<section className="panel stack">
<div className="panel-heading">
<span>Fact Card</span>
<span></span>
<button disabled={!canOptimize || isSaving} onClick={onConfirm}>
{isSaving ? "Saving..." : "Confirm"}
{isSaving ? "保存中..." : "确认事实卡"}
</button>
</div>
<label>
<span>Company full name</span>
<span></span>
<input
value={factCard.company_full_name}
onChange={(event) => update("company_full_name", event.target.value)}
@@ -67,14 +77,14 @@ export function FactCardEditor({
</label>
<div className="two-col">
<label>
<span>Target industry</span>
<span></span>
<input
value={factCard.target_industry}
onChange={(event) => update("target_industry", event.target.value)}
/>
</label>
<label>
<span>Target audience</span>
<span></span>
<input
value={factCard.target_audience}
onChange={(event) => update("target_audience", event.target.value)}
@@ -82,7 +92,7 @@ export function FactCardEditor({
</label>
</div>
<label>
<span>Experience years</span>
<span></span>
<input
min="0"
type="number"
@@ -97,9 +107,9 @@ export function FactCardEditor({
</label>
{listFields.map((field) => (
<label key={field}>
<span>{field.replace(/_/g, " ")}</span>
<span>{fieldLabels[field]}</span>
<textarea
value={factCard[field].join("\n")}
value={factCard[field].join("\n")}
onChange={(event) =>
update(
field,
@@ -114,7 +124,7 @@ export function FactCardEditor({
))}
{!canOptimize && (
<p className="status-text fail">
Resolve uncertain items before optimization.
</p>
)}
</section>