بنقرة واحدة
i18n
Guide for coding agents to migrate user-visible strings to the @spherse/i18n package and update locale catalogs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide for coding agents to migrate user-visible strings to the @spherse/i18n package and update locale catalogs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when creating or editing an agent-level Spherse chat window theme.css for custom chat backgrounds, headers, message bubbles, avatars, composer inputs, markdown blocks, or placeholder text.
指导用户创建自定义 UI 主题,通过 .spherse/theme.css 覆盖 CSS 变量实现视觉定制
为任意《哈利·波特》角色生成「魔法世界风格的手机界面」——包括聊天记录、朋友圈动态和羊皮笔记。数据与 UI 分离,只需编写 JSON 数据文件即可创作新角色。
当用户想要创建自定义 skill 时使用,涵盖 skill 的两个层级(project-level 与 agent-level)、标准目录结构与 SKILL.md 格式规范
在 Spherse 的 HTML 内容中嵌入 postMessage 调用,实现 iframe 与 App 的交互(如创建会话、打开文件、key-value 数据读写)
在 Spherse 中产出任何 HTML 之前必须先阅读本 skill。当用户要求创建或修改 HTML 页面、生成网页、制作可视化展示(欢迎页、导览主页、内容卡片、预览页等任意 HTML 交付物)时,务必在写出 HTML 代码前先读本 skill,了解 charset、数据与渲染分离的决策、数据加载模式与 App 能力调用(含交互式卡片回传会话)的约定;切勿未经阅读直接输出 HTML
| name | i18n |
| description | Guide for coding agents to migrate user-visible strings to the @spherse/i18n package and update locale catalogs |
This skill guides the coding agent through identifying user-visible strings in Spherse source code, adding them to the shared @spherse/i18n locale catalogs, and replacing hardcoded text with t() calls.
Use dot-path namespacing: {domain}.{section}.{specific}
Examples:
app.loadingsettings.titlesettings.models.defaultModelcontent.save.errorserver.content.notFoundcore.tools.readFile.pathRequiredScan the specified files or directories for user-visible string literals.
Classify each string: is it user-visible UI text or a technical string that should not be translated?
Generate keys for user-visible strings using the naming convention above. Keep keys stable and descriptive.
Add entries to all three locale files in packages/i18n/src/locales/:
zh-CN.ts — the canonical catalog (add as as const)zh-TW.ts — Traditional Chinese translationen.ts — English translationReplace the hardcoded string in source code:
const { t } = useI18n(); then t("key")translate(locale, "key", params) (using locale from context or provider)For strings with variables: use {name} interpolation in the locale value, never concatenate translated parts:
"无法读取文件:{path}" + t("key", { path })"无法读取文件:" + pathRun validation:
npm run check:i18n
Fix any key consistency or interpolation variable mismatches.
Run build and tests:
npm run build
npm test -w @spherse/i18n
Report: list all new/modified keys and any strings intentionally left untranslated with reasons.
packages/i18n/src/locales/{zh-CN,zh-TW,en}.tspackages/i18n/src/types.tspackages/i18n/src/translate.tszh-CN.ts is the canonical source of truth for keys. All other locales must have identical key sets.TranslationKey type manually — it is derived from zhCN object keys.npm run check:i18n to verify consistency.settings.title) over structural keys (dialog.header.text).