Agent Skillskaininx/PlainTab › update-i18n

update-i18n

GitHub

用于维护 PlainTab 运行时 UI 翻译及多语言包。支持添加、编辑、格式化、验证或审查 js/i18n 目录下的翻译文件、data-i18n 标记及 t(key) 调用,确保所有受支持语言的键值完整且本地化,避免硬编码英文。

.agents/skills/update-i18n/SKILL.md kaininx/PlainTab

Trigger Scenarios

需要为 PlainTab UI 添加新文案或更新现有翻译时 新增设置项或新用户引导文案需进行多语言适配时 检查或修复 i18n 语言包中的键值缺失或非英语回退问题时

Install

npx skills add kaininx/PlainTab --skill update-i18n -g -y
More Options

Non-standard path

npx skills add https://github.com/kaininx/PlainTab/tree/main/.agents/skills/update-i18n -g -y

Use without installing

npx skills use kaininx/PlainTab@update-i18n

指定 Agent (Claude Code)

npx skills add kaininx/PlainTab --skill update-i18n -a claude-code -g -y

安装 repo 全部 skill

npx skills add kaininx/PlainTab --all -g -y

预览 repo 内 skill

npx skills add kaininx/PlainTab --list

SKILL.md

Frontmatter
{
    "name": "update-i18n",
    "description": "Maintain PlainTab runtime UI translations and i18n language packs. Use when adding, editing, formatting, validating, or reviewing UI text in js\/i18n\/*.js, js\/languages.js, data-i18n markup, or t(key) calls; also use when onboarding\/help copy or new settings need localized strings."
}

Update PlainTab I18N

Use this skill for PlainTab runtime UI copy. Keep the runtime contract unchanged:

  • js/languages.js is the synchronous language bootstrap and must stay early in index.html.
  • js/i18n/*.js are language packs that assign flat objects to window.I18N["locale"].
  • Runtime code should call t(key) or use existing data-i18n; do not hard-code UI language branches.
  • Keep all language packs key-complete. zh-CN and en need carefully maintained copy, and every supported locale should receive localized UI text for newly added runtime keys. Do not use English as the default fallback for non-English packs; only leave a product name, protocol, shortcut, or technical token in English when that exact token is the UI concept.

Workflow

  1. Read .claude/rules/30-language.md and any touched runtime file.
  2. Add or update flat keys in every js/i18n/*.js file. New user-facing keys must be localized for all supported locales, not copied from en.
  3. Keep language packs multi-line, one key per line:
window.I18N["en"] = {
    "someKey": "Some text",
    "anotherKey": "Another text"
};
  1. In runtime code, reference keys through t("someKey"). Avoid detecting language manually for UI strings.
  2. For generated or mechanical updates, preserve UTF-8 text. Be careful with PowerShell pipelines that can turn non-ASCII text into ?; prefer apply_patch or an ASCII-safe temporary script that is deleted after use.
  3. If adding user-facing behavior, keep first-paint rules intact; do not move js/languages.js or js/preload.js.

Validation

Run these checks before finishing:

Get-ChildItem js\i18n\*.js | ForEach-Object { node --check $_.FullName }
node --check js\languages.js
node --check js\newtab.js
@'
const fs = require('fs');
global.window = {};
global.document = { write() {} };
global.navigator = { language: 'en' };
global.localStorage = { getItem() { return ''; } };
require('./js/languages.js');
for (const file of fs.readdirSync('js/i18n').filter(f => f.endsWith('.js'))) require('./js/i18n/' + file);
const report = window.validatePlainTabI18N({ silent: true });
if (!report.ok) {
  console.log(JSON.stringify(report, null, 2));
  process.exit(1);
}
console.log('validatePlainTabI18N ok');
'@ | node -

If only specific runtime files changed, still run git diff --check on the touched files.

Also audit newly added keys for accidental English fallback in non-English packs. A value that is identical to window.I18N.en[key] should be treated as suspicious unless it is an intentional product name, protocol, shortcut, or technical token.

Version History

  • 955e53e Current 2026-07-24 12:24

Same Skill Collection

.agents/skills/bump-version/SKILL.md
.agents/skills/commit-changes/SKILL.md
.agents/skills/diagnose/SKILL.md
.agents/skills/improve-codebase-architecture/SKILL.md
.agents/skills/storage-migration/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/zoom-out/SKILL.md
.claude/skills/bump-version/SKILL.md
.claude/skills/commit-changes/SKILL.md
.claude/skills/diagnose/SKILL.md
.claude/skills/improve-codebase-architecture/SKILL.md
.claude/skills/storage-migration/SKILL.md
.claude/skills/tdd/SKILL.md
.claude/skills/update-i18n/SKILL.md
.claude/skills/zoom-out/SKILL.md

Metadata

Files
0
Version
955e53e
Hash
cdf40421
Indexed
2026-07-24 12:24

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 07:19
浙ICP备14020137号-1 $Carte des visiteurs$