Agent Skillsrokartur/BetterCmdTab › localize-strings

localize-strings

GitHub

管理 macOS 应用本地化字符串,确保代码与翻译文件同步。涵盖添加多语言条目、保持格式一致性,并通过运行 LocalizationCatalogTests 验证覆盖完整性。

.agents/skills/localize-strings/SKILL.md rokartur/BetterCmdTab

Trigger Scenarios

代码新增用户可见字符串 代码修改用户可见字符串 代码删除用户可见字符串 LocalizationCatalogTests 测试失败

Install

npx skills add rokartur/BetterCmdTab --skill localize-strings -g -y
More Options

Non-standard path

npx skills add https://github.com/rokartur/BetterCmdTab/tree/main/.agents/skills/localize-strings -g -y

Use without installing

npx skills use rokartur/BetterCmdTab@localize-strings

指定 Agent (Claude Code)

npx skills add rokartur/BetterCmdTab --skill localize-strings -a claude-code -g -y

安装 repo 全部 skill

npx skills add rokartur/BetterCmdTab --all -g -y

预览 repo 内 skill

npx skills add rokartur/BetterCmdTab --list

SKILL.md

Frontmatter
{
    "name": "localize-strings",
    "description": "Keep Localizable.xcstrings in lockstep with the code. Use whenever code adds, edits, or removes any user-facing string, or when LocalizationCatalogTests fails."
}

Localize strings

Every user-facing string ships translated in five locales. The catalog is version-controlled JSON and LocalizationCatalogTests pins full coverage — an English-only key fails the suite, it does not silently ship.

1. Use the localized form in code

User-facing text is String(localized: "…"); enum display names localize too. A bare literal in UI code ships untranslated — wrap it.

2. Add the catalog entries

Edit BetterCmdTab/Localizable.xcstrings directly (it is JSON). For each new key add translations for all of: de, es, fr, pl, zh-Hans. Copy the exact JSON shape of a neighboring entry, keep keys sorted where the surrounding file is sorted, and keep format specifiers (%@, %d, …) identical across every locale — specifier drift is a test failure. Remove catalog entries whose code key was deleted.

3. Verify

xcodebuild -scheme "BetterCmdTab Debug" -destination 'platform=macOS' test \
  -only-testing:BetterCmdTabTests/LocalizationCatalogTests

Complete when: the suite passes with the new keys present in all five locales.

Version History

  • 30e25b6 Current 2026-07-30 22:00

Same Skill Collection

.agents/skills/add-preference/SKILL.md
.agents/skills/release-changelog/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/verify/SKILL.md

Metadata

Files
0
Version
7d5fa2e
Hash
069d71a4
Indexed
2026-07-30 22:00

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 02:19
浙ICP备14020137号-1 $Гость$