Agent Skillsrommapp/romm › frontend-i18n

frontend-i18n

GitHub

规范 RomM 前端国际化流程,确保 en_US 为源文件且所有语言包同步更新,禁止硬编码字符串,提供 CI 校验脚本以保障翻译完整性。

.claude/skills/frontend-i18n/SKILL.md rommapp/romm

Trigger Scenarios

添加、重命名或删除前端用户可见的字符串或翻译键 修改 frontend/src/locales/ 目录下的任何文件

Install

npx skills add rommapp/romm --skill frontend-i18n -g -y
More Options

Non-standard path

npx skills add https://github.com/rommapp/romm/tree/master/.claude/skills/frontend-i18n -g -y

Use without installing

npx skills use rommapp/romm@frontend-i18n

指定 Agent (Claude Code)

npx skills add rommapp/romm --skill frontend-i18n -a claude-code -g -y

安装 repo 全部 skill

npx skills add rommapp/romm --all -g -y

预览 repo 内 skill

npx skills add rommapp/romm --list

SKILL.md

Frontmatter
{
    "name": "frontend-i18n",
    "description": "Internationalization for the RomM frontend (both v1 and v2). Use whenever adding, renaming, or removing any user-visible string \/ translation key under frontend\/src\/locales\/. Covers the en_US-is-source rule, the requirement to add every new key to ALL locale directories in the same change, namespace layout, and the check_i18n_locales.py validator enforced in CI. Trigger on any change to frontend\/src\/locales\/**."
}

RomM Frontend — i18n / Localization

User-visible strings are never hard-coded in components — they come from locale files via vue-i18n ($t(...) in templates/composites; utils may call i18n.global.t(...); v2 lib primitives must not call $t at all — text passes via props/slots).

Structure

  • Locales live in frontend/src/locales/<locale>/<namespace>.json, loaded by dynamic glob import in src/locales/index.ts.
  • 18 locales: en_US (default + fallback), en_GB, bg_BG, cs_CZ, de_DE, es_ES, fr_FR, hu_HU, it_IT, ja_JP, ko_KR, pl_PL, pt_BR, ro_RO, ru_RU, tr_TR, zh_CN, zh_TW.
  • Namespaces are per-feature files (e.g. collection, common, console, detail, emulator, gallery, home, library, login, navigation, patcher, platform, scan, settings, task).

The rule (enforced in CI)

  • en_US is the source of truth, but every key added to en_US must be added to all other locale directories in the same change. Never leave a key English-only.
  • en_US uses US spelling: "favorites", "color", "canceled". British forms belong in en_GB only. This bites tests too: an e2e or unit assertion on a label must expect the en_US string.
  • Actually translate the value into each locale's language — never paste English into non-English locales.
  • Editing an existing string counts: changing en_US means re-translating that key in every other locale.
  • Reuse each locale's established terms — grep a sibling key for how it renders "metadata", "provider", etc.
  • Copying the English value is a last-resort placeholder, only when no translation is available, and must be flagged to revisit.
  • Removing or renaming a key means doing it across every locale.

Verify before handoff

python3 frontend/src/locales/check_i18n_locales.py
python3 frontend/src/locales/check_i18n_sorted.py   # add --fix to auto-sort

check_i18n_locales.py compares every non-English locale against en_US and fails on any missing file, missing key, or extra key. check_i18n_sorted.py fails if any locale JSON file's keys aren't sorted alphabetically (run with --fix to sort them in place). CI runs both scripts (.github/workflows/i18n.yml) on any change under frontend/src/locales/**; both must pass.

Adding a new language

Create a new folder under frontend/src/locales/ mirroring en_US/'s files, then translate. Open the PR against master (see the docs/Contributing flow). This is the one i18n change where a new locale directory is expected.

Version History

  • 5b82462 Current 2026-08-29 04:26

    从 review-polish skill 中分离出 en_US 拼写规则,明确其作为独立技能处理。

  • 42e8043 2026-08-20 16:50

Same Skill Collection

.claude/skills/backend-development/SKILL.md
.claude/skills/frontend-v2-components/SKILL.md
.claude/skills/frontend-v2-input/SKILL.md
.claude/skills/frontend-v2-patterns/SKILL.md
.claude/skills/frontend-v2-theming/SKILL.md
.claude/skills/pre-pr-verification/SKILL.md
.claude/skills/security-audit/SKILL.md
.claude/skills/review-polish/SKILL.md

Metadata

Files
0
Version
5b82462
Hash
49c3dfbc
Indexed
2026-08-20 16:50

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