popiart-server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

188 lines
6.6 KiB

import type { Locale } from "@/lib/site-content";
type LiveCopy = {
nav: {
skills: string;
};
header: {
zh: string;
en: string;
logout: string;
loggingOut: string;
loginHint: string;
};
login: {
fieldLabel: string;
fieldHint: string;
submit: string;
submitting: string;
helperTitle: string;
helperBody: string;
commandLabel: string;
alreadySignedIn: string;
continueCta: string;
invalidKey: string;
};
console: {
unauthenticatedTitle: string;
unauthenticatedBody: string;
loginCta: string;
docsCta: string;
signedInAs: string;
liveTitle: string;
liveSubtitle: string;
quickstartTitle: string;
quickstartBody: string;
catalogCount: string;
noSkills: string;
noUsage: string;
loadErrorPrefix: string;
};
skills: {
tag: string;
title: string;
subtitle: string;
searchLabel: string;
searchPlaceholder: string;
searchAction: string;
resultsPrefix: string;
unauthenticatedTitle: string;
unauthenticatedBody: string;
loginCta: string;
docsCta: string;
noResults: string;
routeKey: string;
modelType: string;
latency: string;
tags: string;
loadErrorPrefix: string;
};
};
const copy: Record<Locale, LiveCopy> = {
zh: {
nav: {
skills: "技能页",
},
header: {
zh: "中文",
en: "EN",
logout: "登出",
loggingOut: "退出中...",
loginHint: "未登录",
},
login: {
fieldLabel: "PopiNewAPI Key",
fieldHint: "使用和 `popiart auth login --key ...` 相同的上游 key 登录,页面会换取产品层 session。",
submit: "登录控制台",
submitting: "登录中...",
helperTitle: "与 CLI 使用同一条认证链路",
helperBody: "页面登录后,控制台会通过 popiartServer 会话去读取 skills、budget 和 usage,而不是直接在浏览器里保存 provider key。",
commandLabel: "CLI 等价命令",
alreadySignedIn: "当前已登录,可直接进入控制台或继续查看技能目录。",
continueCta: "进入控制台",
invalidKey: "请输入可用的 PopiNewAPI Key。",
},
console: {
unauthenticatedTitle: "登录后查看真实控制台数据",
unauthenticatedBody: "这页现在直接读取 popiartServer 的 auth、skills、budget 和 usage 接口。未登录时不会伪造密钥和余额。",
loginCta: "去登录",
docsCta: "看接入文档",
signedInAs: "当前账号",
liveTitle: "已接入 popiartServer 实时数据",
liveSubtitle: "页面逻辑沿用 `popiart auth login`、`skills list` 和 `budget` 的产品层协议。",
quickstartTitle: "快速安装指令",
quickstartBody: "CLI 和 Web 共用同一个产品层 endpoint,下面这段命令可直接对应到当前控制台。",
catalogCount: "技能目录",
noSkills: "当前账号下没有可见技能。",
noUsage: "当前周期还没有技能用量。",
loadErrorPrefix: "控制台数据加载失败",
},
skills: {
tag: "SKILL CATALOG",
title: "官方技能目录",
subtitle: "当前列表直接读取 `/v1/skills`,与 `popiart skills list` 使用同一份产品层数据。",
searchLabel: "搜索技能",
searchPlaceholder: "搜索技能名、描述或标签",
searchAction: "查询",
resultsPrefix: "共找到",
unauthenticatedTitle: "登录后查看真实技能目录",
unauthenticatedBody: "技能页会直接走产品层会话鉴权,因此未登录时不展示假数据。",
loginCta: "登录查看",
docsCta: "阅读文档",
noResults: "没有匹配的技能。",
routeKey: "路由键",
modelType: "模型类型",
latency: "预计耗时",
tags: "标签",
loadErrorPrefix: "技能目录加载失败",
},
},
en: {
nav: {
skills: "Skills",
},
header: {
zh: "中文",
en: "EN",
logout: "Logout",
loggingOut: "Logging out...",
loginHint: "Signed out",
},
login: {
fieldLabel: "PopiNewAPI Key",
fieldHint:
"Use the same upstream key as `popiart auth login --key ...`. The web app exchanges it for a product-layer session.",
submit: "Sign in to console",
submitting: "Signing in...",
helperTitle: "The same auth path as the CLI",
helperBody:
"After sign-in, the console reads skills, budget, and usage through popiartServer instead of storing provider credentials in the browser.",
commandLabel: "Equivalent CLI command",
alreadySignedIn: "You are already signed in. Jump back to the console or continue browsing the catalog.",
continueCta: "Open console",
invalidKey: "Enter a valid PopiNewAPI key.",
},
console: {
unauthenticatedTitle: "Sign in to view live console data",
unauthenticatedBody:
"This page now reads popiartServer auth, skills, budget, and usage endpoints directly. It no longer fakes keys or credits for signed-out users.",
loginCta: "Sign in",
docsCta: "Read docs",
signedInAs: "Signed in as",
liveTitle: "Connected to live popiartServer data",
liveSubtitle:
"The page follows the same product-layer protocol used by `popiart auth login`, `skills list`, and `budget`.",
quickstartTitle: "Quick install commands",
quickstartBody: "The CLI and the web console share the same product endpoint and auth flow.",
catalogCount: "Catalog",
noSkills: "No skills are visible for this account yet.",
noUsage: "No skill usage has been recorded for the current period.",
loadErrorPrefix: "Failed to load console data",
},
skills: {
tag: "SKILL CATALOG",
title: "Official skill catalog",
subtitle: "This list is fetched from `/v1/skills`, the same surface used by `popiart skills list`.",
searchLabel: "Search skills",
searchPlaceholder: "Search by skill name, description, or tag",
searchAction: "Search",
resultsPrefix: "Results",
unauthenticatedTitle: "Sign in to view the live catalog",
unauthenticatedBody:
"The catalog page uses product-layer session auth, so it does not render fake skill data for signed-out users.",
loginCta: "Sign in",
docsCta: "Read docs",
noResults: "No skills matched this query.",
routeKey: "Route key",
modelType: "Model type",
latency: "Estimated duration",
tags: "Tags",
loadErrorPrefix: "Failed to load the skill catalog",
},
},
};
export function getLiveCopy(locale: Locale) {
return copy[locale] ?? copy.zh;
}