feat: localize optimizer interface
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user