Agent Skills › videojs/video.js › write-locale-translations

write-locale-translations

GitHub

用于翻译或审计 Video.js 本地化包中的值,确保翻译准确、有据可查且符合无障碍标准。

.agents/skills/write-locale-translations/SKILL.md videojs/video.js

触发场景

新键需要填充值 英文源文件更新导致旧翻译失效 需要对现有本地化包进行审计

安装

npx skills add videojs/video.js --skill write-locale-translations -g -y
更多选项

非标准路径

npx skills add https://github.com/videojs/video.js/tree/main/.agents/skills/write-locale-translations -g -y

不安装直接使用

npx skills use videojs/video.js@write-locale-translations

指定 Agent (Claude Code)

npx skills add videojs/video.js --skill write-locale-translations -a claude-code -g -y

安装 repo 全部 skill

npx skills add videojs/video.js --all -g -y

预览 repo 内 skill

npx skills add videojs/video.js --list

SKILL.md

Frontmatter
{
    "name": "write-locale-translations",
    "description": "Translate or audit the values in a Video.js locale pack. Use when a key needs values, en.ts copy changes underneath a pack, or one pack needs an audit."
}

Translate locale values

Produce translated values for one locale pack in packages/core/src/core/i18n/locales/ that are backed by a citable source and free of the known pitfalls. Every value reaches the DOM as an aria-label, so a wrong word class is announced by a screen reader rather than merely displayed.

Triggers

  • A new key needs values in a pack.
  • locales/en.ts reworded a value, so the pack still translates the old English.
  • One pack needs an audit of the values it already carries.

packages/core/src/core/i18n/README.md covers the mechanics: where a pack lives, how to register a tag, what to regenerate. This workflow covers the translation judgment behind the values, so reach for the README to add or wire up a locale and reach for this to decide what a value should say. It does not cover authoring the English source copy, RTL layout work, or the generated mirrors under packages/html, packages/react, and packages/cdn.

Workflow

  1. Identify which values are stale by diffing the pack against current en.ts key by key; a value whose English source has not changed stays as it is.
  2. Research each value against localized first-party UI for the same control, with one citation per value. Read references/evidence-sources.md when choosing and citing. Never translate unsourced, and never derive one pack from a related one; zh-TW is not converted zh-CN.
  3. Check the wording against references/language-pitfalls.md, then edit values only, preserving the key set, key order, and the full {placeholder} multiset.
  4. Verify by re-deriving each value from en.ts and its old value, re-fetching every citation, and running a codepoint scan for homoglyphs, stray scripts, NBSP, and double spaces. cspell ignores non-English packs, so that scan is the only mechanical guard on the text itself. A translated value is research-backed rather than native-authored, so a native-speaker check is worth requesting.

Example

Input: When #1822 reworded errors.aborted in en.ts, es.ts was left translating the old English.

Output: A value-only edit to es.ts, carrying the source the new wording rests on.

// was: 'Ha anulado la reproducción del vídeo.' (translated the pre-#1822 "You aborted the media playback")
aborted: 'Has detenido la reproducción del contenido multimedia antes de que terminara.',
// source: YouTube es-ES player, "Has detenido la reproducción"

Validation

pnpm -F @videojs/core run generate:locales     # validates every pack carries every en.ts key
pnpm lint:fix:file packages/core/src/core/i18n/locales/<tag>.ts
CI=1 pnpm -F @videojs/core exec vp test run src/core/i18n
git diff --check

版本历史

  • 8a0a3d8 当前 2026-10-20 08:04

同 Skill 集合

.agents/skills/change-spf-behavior/SKILL.md
.agents/skills/commit-pr/SKILL.md
.agents/skills/configure-vite-plus/SKILL.md
.agents/skills/create-html-component/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-react-component/SKILL.md
.agents/skills/create-skill/SKILL.md
.agents/skills/create-spf-behavior/SKILL.md
.agents/skills/design-api/SKILL.md
.agents/skills/document-spf-feature/SKILL.md
.agents/skills/document-spf-use-case/SKILL.md
.agents/skills/implement-accessible-ui/SKILL.md
.agents/skills/implement-spf-feature/SKILL.md
.agents/skills/implement-spf-use-case/SKILL.md
.agents/skills/implement-ui-transition/SKILL.md
.agents/skills/investigate-issue/SKILL.md
.agents/skills/maintain-agent-docs/SKILL.md
.agents/skills/maintain-tests/SKILL.md
.agents/skills/maintain-vjsc-skin-gaps/SKILL.md
.agents/skills/review-accessibility/SKILL.md
.agents/skills/review-api/SKILL.md
.agents/skills/review-branch/SKILL.md
.agents/skills/review-docs/SKILL.md
.agents/skills/review-html-component-design/SKILL.md
.agents/skills/review-html-component/SKILL.md
.agents/skills/review-react-component-design/SKILL.md
.agents/skills/review-react-component/SKILL.md
.agents/skills/write-api-reference/SKILL.md
.agents/skills/write-design-doc/SKILL.md
.agents/skills/write-docs/SKILL.md
.agents/skills/write-html-component-design/SKILL.md
.agents/skills/write-react-component-design/SKILL.md
.agents/skills/write-rfc/SKILL.md
.agents/skills/create-rolldown-plugin/SKILL.md
.agents/skills/create-vite-plugin/SKILL.md
.agents/skills/create-vjsc-component/SKILL.md
.agents/skills/transform-rolldown-code/SKILL.md

元信息

文件数
0
版本
8a0a3d8
Hash
7e8c631c
收录时间
2026-10-20 08:04

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 11:29
浙ICP备14020137号-1