i18n(skills): localise SkillsSection strings
SkillsSection had nine hardcoded English strings (header, filter placeholder/aria-label, empty-state copy, button labels). Move them to skills.* keys in en.ts/zh.ts and swap the component to useT().
This commit is contained in:
1 parent
2bd47a601a
commit
d513497341
5 files changed
+51
-524
No files matched your search
@@ -9,6 +9,7 @@ import { ActionButton, EmptyState } from "../ui";
|
||||
import { SkillList } from "./SkillList";
|
||||
import { SkillImportModal } from "./SkillImportModal";
|
||||
import { SkillDetail } from "./SkillDetail";
|
||||
import { useT } from "../../i18n";
|
||||
|
||||
export function SkillsSection({
|
||||
companyId,
|
||||
@@ -19,6 +20,7 @@ export function SkillsSection({
|
||||
agents: AgentRecord[];
|
||||
onRefresh: () => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
const skills = useAppStore((s) => s.skills);
|
||||
const setSkills = useAppStore((s) => s.setSkills);
|
||||
const selectedSkillId = useAppStore((s) => s.selectedSkillId);
|
||||
@@ -64,7 +66,7 @@ export function SkillsSection({
|
||||
{/* Header */}
|
||||
<div className="flex shrink-0 items-center gap-3 px-4 py-3">
|
||||
<h2 className="text-[20px] font-bold tracking-[-0.025em] text-foreground">
|
||||
Skills
|
||||
{t("skills.title")}
|
||||
</h2>
|
||||
{skills.length > 0 && (
|
||||
<span className="inline-flex h-[20px] min-w-[20px] items-center justify-center rounded-full bg-muted px-1.5 text-[11px] font-semibold text-muted-foreground">
|
||||
@@ -75,7 +77,7 @@ export function SkillsSection({
|
||||
type="button"
|
||||
className="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ml-auto flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-muted hover:text-foreground"
|
||||
onClick={() => setSkillImportModalOpen(true)}
|
||||
aria-label="Import skill"
|
||||
aria-label={t("skills.importAria")}
|
||||
>
|
||||
<Plus size={16} weight="bold" />
|
||||
</button>
|
||||
@@ -93,8 +95,8 @@ export function SkillsSection({
|
||||
className="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 w-full rounded-lg border border-border bg-card py-2 pl-8 pr-3 text-[13px] text-foreground placeholder:text-muted-foreground"
|
||||
value={skillFilter}
|
||||
onChange={(e) => setSkillFilter(e.target.value)}
|
||||
placeholder="Filter skills..."
|
||||
aria-label="Filter skills"
|
||||
placeholder={t("skills.filterPlaceholder")}
|
||||
aria-label={t("skills.filterAria")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,11 +105,11 @@ export function SkillsSection({
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
{skills.length === 0 ? (
|
||||
<EmptyState
|
||||
title="No skills imported"
|
||||
detail="Import skills from GitHub, a local path, or skills.sh to get started."
|
||||
title={t("skills.emptyTitle")}
|
||||
detail={t("skills.emptyDetail")}
|
||||
action={
|
||||
<ActionButton
|
||||
label="Import Skill"
|
||||
label={t("skills.importButton")}
|
||||
icon={Plus}
|
||||
tone="accent"
|
||||
onClick={() => setSkillImportModalOpen(true)}
|
||||
@@ -138,8 +140,8 @@ export function SkillsSection({
|
||||
) : (
|
||||
<div className="flex flex-1 items-center justify-center">
|
||||
<EmptyState
|
||||
title="Select a skill to view details"
|
||||
detail="Choose a skill from the list to see its content, file tree, and configuration."
|
||||
title={t("skills.selectToViewTitle")}
|
||||
detail={t("skills.selectToViewDetail")}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user