fix(webui): localize skills view tabs

This commit is contained in:
Xubin Ren 2026-07-28 15:37:49 +08:00
parent 73d3a49a27
commit 42ee34e34d
13 changed files with 40 additions and 16 deletions

View File

@ -108,7 +108,7 @@ export function SkillsCatalogSettings({ skills }: { skills: SkillSummary[] }) {
aria-selected={view === item}
onClick={() => setView(item)}
className={cn(
"inline-flex items-center gap-1.5 rounded-[9px] px-3.5 py-1.5 text-[13px] font-medium transition-colors",
"inline-flex items-center rounded-[9px] px-3.5 py-1.5 text-[13px] font-medium transition-colors",
view === item
? "bg-background text-foreground shadow-sm"
: "text-muted-foreground hover:text-foreground",
@ -116,12 +116,7 @@ export function SkillsCatalogSettings({ skills }: { skills: SkillSummary[] }) {
>
{item === "installed"
? t("settings.skills.installedTab", { defaultValue: "Installed" })
: (
<>
<VercelMark />
{t("settings.skills.discoverTab", { defaultValue: "Discover" })}
</>
)}
: t("settings.skills.discoverTab", { defaultValue: "Discover" })}
</button>
))}
</div>
@ -228,14 +223,6 @@ export function SkillsCatalogSettings({ skills }: { skills: SkillSummary[] }) {
);
}
function VercelMark() {
return (
<svg viewBox="0 0 16 16" className="h-3 w-3" aria-hidden>
<path d="M8 1 16 15H0L8 1Z" fill="currentColor" />
</svg>
);
}
function SkillCatalogRow({
skill,
onSelect,

View File

@ -788,6 +788,9 @@
"skills": {
"description": "Review the instruction skills this agent can load during a conversation.",
"caption": "{{available}} available · {{total}} total",
"views": "Skills views",
"installedTab": "Installed",
"discoverTab": "Discover",
"featured": "Agent skills",
"empty": "No skills are available.",
"sourceWorkspace": "Custom",

View File

@ -775,6 +775,9 @@
"skills": {
"description": "Revisa las habilidades de instrucciones que este agente puede cargar durante una conversación.",
"caption": "{{available}} disponibles · {{total}} en total",
"views": "Vistas de habilidades",
"installedTab": "Instaladas",
"discoverTab": "Descubrir",
"featured": "Habilidades del agente",
"empty": "No hay habilidades disponibles.",
"sourceWorkspace": "Personalizada",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "Consultez les compétences dinstruction que cet agent peut charger pendant une conversation.",
"caption": "{{available}} disponibles · {{total}} au total",
"views": "Vues des compétences",
"installedTab": "Installées",
"discoverTab": "Découvrir",
"featured": "Compétences agent",
"empty": "Aucune compétence disponible.",
"sourceWorkspace": "Personnalisée",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "Tinjau skill instruksi yang dapat dimuat agent ini selama percakapan.",
"caption": "{{available}} tersedia · {{total}} total",
"views": "Tampilan skill",
"installedTab": "Terpasang",
"discoverTab": "Temukan",
"featured": "Skill agent",
"empty": "Tidak ada skill yang tersedia.",
"sourceWorkspace": "Kustom",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "このエージェントが会話中に読み込める指示スキルを確認します。",
"caption": "{{available}} 利用可能 · 合計 {{total}}",
"views": "スキル表示",
"installedTab": "インストール済み",
"discoverTab": "見つける",
"featured": "エージェントスキル",
"empty": "利用可能なスキルはありません。",
"sourceWorkspace": "カスタム",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "이 에이전트가 대화 중에 불러올 수 있는 지시 스킬을 확인합니다.",
"caption": "{{available}}개 사용 가능 · 총 {{total}}개",
"views": "스킬 보기",
"installedTab": "설치됨",
"discoverTab": "탐색",
"featured": "에이전트 스킬",
"empty": "사용 가능한 스킬이 없습니다.",
"sourceWorkspace": "사용자 지정",

View File

@ -788,6 +788,9 @@
"skills": {
"description": "Revise as skills de instrução que este agente pode carregar durante uma conversa.",
"caption": "{{available}} disponíveis · {{total}} no total",
"views": "Visualizações de skills",
"installedTab": "Instaladas",
"discoverTab": "Descobrir",
"featured": "Skills do agente",
"empty": "Nenhuma skill disponível.",
"sourceWorkspace": "Personalizada",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "Xem các kỹ năng chỉ dẫn mà agent này có thể tải trong cuộc trò chuyện.",
"caption": "{{available}} khả dụng · tổng {{total}}",
"views": "Chế độ xem kỹ năng",
"installedTab": "Đã cài đặt",
"discoverTab": "Khám phá",
"featured": "Kỹ năng agent",
"empty": "Không có kỹ năng nào khả dụng.",
"sourceWorkspace": "Tùy chỉnh",

View File

@ -788,6 +788,9 @@
"skills": {
"description": "查看此 agent 在对话中可以加载的指令技能。",
"caption": "{{available}} 个可用 · 共 {{total}} 个",
"views": "技能视图",
"installedTab": "已安装",
"discoverTab": "发现",
"featured": "Agent 技能",
"empty": "暂无可用技能。",
"sourceWorkspace": "自定义",

View File

@ -774,6 +774,9 @@
"skills": {
"description": "檢閱此 Agent 可在對話期間載入的指令技能。",
"caption": "{{available}} 個可用 · 共 {{total}} 個",
"views": "技能檢視",
"installedTab": "已安裝",
"discoverTab": "探索",
"featured": "Agent 技能",
"empty": "目前沒有可用的技能。",
"sourceWorkspace": "自訂",

View File

@ -664,7 +664,9 @@ describe("App layout", () => {
await waitFor(() => expect(connectSpy).toHaveBeenCalled());
const sidebar = screen.getByRole("navigation", { name: "Sidebar navigation" });
fireEvent.click(within(sidebar).getByRole("button", { name: "Skills" }));
fireEvent.click(await screen.findByRole("tab", { name: "Discover" }));
const discoverTab = await screen.findByRole("tab", { name: "Discover" });
expect(discoverTab.querySelector("svg")).toBeNull();
fireEvent.click(discoverTab);
expect(await screen.findByRole("heading", { name: "Trending today" })).toBeInTheDocument();
expect(screen.getByText("find-skills")).toBeInTheDocument();
expect(screen.getByText(/14,481 installs \/ 24h/)).toBeInTheDocument();

View File

@ -75,6 +75,9 @@ const LOCALIZED_SETTINGS_COPY_KEYS = [
"settings.apps.description",
"settings.apps.caption",
"settings.apps.restartRequired",
"settings.skills.views",
"settings.skills.installedTab",
"settings.skills.discoverTab",
"settings.nanobotFeatures.disable",
"settings.nanobotFeatures.ready",
"settings.nanobotFeatures.missingDependency",
@ -437,6 +440,8 @@ describe("webui i18n", () => {
expect(settings.byok.tabs.webSearch).toBe("网页搜索");
expect(settings.overview.webSearch).toBe("网页搜索");
expect(settings.overview.workspace).toBe("工作区");
expect(settings.skills.installedTab).toBe("已安装");
expect(settings.skills.discoverTab).toBe("发现");
});
it("keeps Brazilian Portuguese settings overview copy localized", () => {