goman-translations
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoman Translations Skill
Goman 翻译技能
Translation management for multi-language apps via the goman.live API.
通过goman.live API管理多语言应用的翻译内容。
First-time setup (run once before anything else)
首次设置(在执行任何操作前运行一次)
Check if exists in the project root.
.envIf it does NOT exist — create it right now:
GOMAN_API_KEY=your_api_key_here
GOMAN_APP_ID=your_application_id_hereThen tell the user:
created. Please fill in.envandGOMAN_API_KEYwith values from the goman.live dashboard → Settings → API Keys, then ask me to continue.GOMAN_APP_ID
Do not run any scripts until the user confirms credentials are filled in.
Get both values from the goman.live dashboard → Settings → API Keys.
检查项目根目录下是否存在 文件。
.env如果不存在——立即创建:
GOMAN_API_KEY=your_api_key_here
GOMAN_APP_ID=your_application_id_here然后告知用户:
文件已创建。请从goman.live控制台 → 设置 → API密钥中获取值,填入.env和GOMAN_API_KEY,之后再让我继续操作。GOMAN_APP_ID
在用户确认凭据已填写完成前,请勿运行任何脚本。
可从goman.live控制台 → 设置 → API密钥 获取这两个值。
Available Scripts
可用脚本
| Script | What it does | Example |
|---|---|---|
| List active language codes | |
| List translation namespaces | |
| Get translations for a key | |
| Search/filter translations | |
| Add or update translations | |
| ⚠️ Delete a key permanently | |
All scripts output JSON. Parse with when processing results.
JSON.parse()| 脚本 | 功能 | 示例 |
|---|---|---|
| 列出可用语言代码 | |
| 列出翻译命名空间 | |
| 获取指定键的翻译内容 | |
| 搜索/筛选翻译内容 | |
| 添加或更新翻译内容 | |
| ⚠️ 永久删除一个翻译键 | |
所有脚本均输出JSON格式内容。处理结果时可使用 解析。
JSON.parse()Key Format
键格式
namespace.key- Namespace = everything before the last dot
- Key = everything after the last dot
- Example: → namespace
"screens.login.submitButton", key"screens.login""submitButton"
⚠️ Every must contain at least one dot.
fullKeynamespace.key- 命名空间 = 最后一个点之前的所有内容
- 键 = 最后一个点之后的所有内容
- 示例:→ 命名空间为
"screens.login.submitButton",键为"screens.login""submitButton"
⚠️ 每个 必须包含至少一个点。
fullKeyWorkflows
工作流
1. Add a Single Translation Key
1. 添加单个翻译键
STEP 1: node goman-languages.js → get valid language codes
STEP 2: node goman-get.js <fullKey> → check if key already exists
STEP 3: node goman-create.js <fullKey> <json> <context> → create/update步骤1:node goman-languages.js → 获取有效的语言代码
步骤2:node goman-get.js <fullKey> → 检查该键是否已存在
步骤3:node goman-create.js <fullKey> <json> <context> → 创建/更新翻译2. Localize a Component
2. 组件本地化
STEP 1: Receive component code from user
STEP 2: Find ALL hardcoded user-visible strings
(labels, placeholders, titles, errors, tooltips — skip console.log, URLs, CSS)
STEP 3: node goman-languages.js
STEP 4: Plan keys: namespace = component name, key = descriptive name
Show plan to user and ask: "Should I proceed?"
STEP 5: After confirmation → node goman-create.js for each key (all languages at once)
STEP 6: Show replacement code snippets:
Before: <button>Submit</button>
After: <button>{t("LoginForm.submitButton")}</button>步骤1:接收用户提供的组件代码
步骤2:找出所有硬编码的用户可见字符串
(标签、占位符、标题、错误提示、工具提示 —— 忽略console.log、URL、CSS内容)
步骤3:node goman-languages.js
步骤4:规划键:命名空间 = 组件名称,键 = 描述性名称
向用户展示规划并询问:"是否继续?"
步骤5:获得确认后 → 为每个键执行node goman-create.js(一次性处理所有语言)
步骤6:展示代码替换示例:
替换前:<button>Submit</button>
替换后:<button>{t("LoginForm.submitButton")}</button>3. Search / Audit Translations
3. 搜索/审核翻译内容
STEP 1: node goman-namespaces.js → understand project structure
STEP 2: node goman-search.js → filter by namespace or search query
STEP 3: node goman-languages.js → compare found keys vs active languages
STEP 4: Report missing translations per key步骤1:node goman-namespaces.js → 了解项目结构
步骤2:node goman-search.js → 按命名空间或搜索关键词筛选
步骤3:node goman-languages.js → 对比找到的键与可用语言
步骤4:报告每个键缺失的翻译内容4. Localize a Folder
4. 文件夹本地化
STEP 1: List files in the folder (ask user if not provided)
STEP 2: For each file: find hardcoded strings
STEP 3: node goman-languages.js
STEP 4: Show full plan across all files, ask confirmation
STEP 5: Batch node goman-create.js calls
STEP 6: Show replacement code for each file步骤1:列出文件夹中的文件(若用户未提供则询问)
步骤2:逐个文件查找硬编码字符串
步骤3:node goman-languages.js
步骤4:展示所有文件的完整规划,请求用户确认
步骤5:批量执行node goman-create.js调用
步骤6:展示每个文件的代码替换内容Safety Rules
安全规则
- NEVER run without explicit user confirmation
goman-delete.js - ALWAYS run first — only use language codes it returns
goman-languages.js - ALWAYS show what will be affected before destructive actions
- ALWAYS include argument in
context— it helps translatorsgoman-create.js - Present results in readable format, never raw JSON
- 切勿在未获得用户明确确认的情况下运行
goman-delete.js - 始终先运行——仅使用它返回的语言代码
goman-languages.js - 始终在执行破坏性操作前展示受影响的内容
- 始终在中包含
goman-create.js参数——这对翻译人员有帮助context - 以可读格式呈现结果,切勿直接展示原始JSON
Detailed Workflows
详细工作流
For complex scenarios, see workflows.md.
复杂场景请参考 workflows.md。