Automated summary
Manages *.xcstrings localization files for iOS/macOS apps by cleaning stale entries, detecting missing translations, and adding Simplified and Traditional Chinese translations.
Strengths
- Fully automated workflow with batch processing scripts
- Accurate detection of stale entries and missing translations
- Built-in Simplified to Traditional Chinese conversion
Limitations
- Requires Python 3 and project-specific scripts
- Only supports Chinese (zh-Hans/zh-HK) for automated additions
- Directly modifies files with no built-in version control backup
Use this skill to maintain Chinese translation quality in iOS/macOS projects with multiple .xcstrings files.
Do not use it if you work with languages other than Chinese, or if your project does not use the .xcstrings format.
Security analysis
CautionThe skill runs Python scripts to manipulate translation files. No network calls, obfuscation, or destructive commands are present, but file system modifications and script execution warrant caution.
- •Skill instructs execution of Python scripts that directly modify *.xcstrings files. While the intent is legitimate, running untrusted code (if the skill is compromised) could lead to unintended file modifications.
- •Uses bash commands with find -exec and for loops, which could be powerful if misused, but are contained within specific file patterns.
Examples
Check all xcstrings files in the project for missing translations.Add translation to Core.xcstrings: key 'Copy' -> Simplified '拷贝', Traditional '拷貝'.Clean all stale entries from all .xcstrings files in the project.name: i18n-translate description: 管理 iOS/macOS 应用的 *.xcstrings 本地化翻译文件。自动清理过期条目、检测缺失翻译、添加简繁体中文翻译。当用户需要处理翻译、补充缺失的 zh-Hans/zh-HK 翻译、或清理 *.xcstrings 文件时使用此 skill。
iOS/macOS 本地化翻译管理
管理项目中所有 *.xcstrings 文件的中文翻译,支持简体中文 (zh-Hans) 和繁体中文 (zh-HK)。
工作流程
处理翻译请求时,首先查找所有 .xcstrings 文件,然后按以下顺序执行:
0. 查找所有 .xcstrings 文件
find . -name "*.xcstrings" -not -path ".*" | head -20
1. 清理过期条目
python3 scripts/clean_stale.py <文件路径>.xcstrings
删除所有 extractionState 为 stale 的条目。可批量处理所有文件:
find . -name "*.xcstrings" -not -path ".*" -exec python3 scripts/clean_stale.py {} \;
2. 检查缺失翻译
python3 scripts/check_missing.py <文件路径>.xcstrings
输出缺失的 zh-Hans 和 zh-HK 翻译统计。可批量检查:
for f in $(find . -name "*.xcstrings" -not -path ".*"); do
echo "=== $f ==="
python3 scripts/check_missing.py "$f"
done
3. 添加翻译
python3 scripts/add_translation.py <文件路径>.xcstrings "Key" "简体中文翻译" "繁體中文翻譯"
<文件路径>.xcstrings: 目标文件路径(必需)Key: 条目的 key(必需)zh-Hans: 简体中文翻译(必需)zh-HK: 繁体中文翻译(可选,未提供时自动转换)
4. 验证文件
python3 scripts/validate.py <文件路径>.xcstrings
验证 JSON 格式正确性并统计翻译完成度。可批量验证:
for f in $(find . -name "*.xcstrings" -not -path ".*"); do
echo "=== $f ==="
python3 scripts/validate.py "$f"
done
批量处理所有文件
使用 batch_process.py 脚本一次性处理所有 .xcstrings 文件:
# 列出所有 .xcstrings 文件
python3 scripts/batch_process.py list
# 批量清理所有文件的过期条目
python3 scripts/batch_process.py clean
# 批量检查所有文件的缺失翻译
python3 scripts/batch_process.py check
# 批量验证所有文件的格式
python3 scripts/batch_process.py validate
# 指定项目目录
python3 scripts/batch_process.py validate --dir /path/to/project
翻译原则
- 占位符保持不变:
%@,%lld,%1$@,%d等格式化占位符必须原样保留 - 技术术语: API, SQLite, Host 等专有名词可保持英文
- UI 文本: 简洁明了,符合 macOS/iOS 应用习惯
- 简繁转换:
add_translation.py包含常见词汇的简繁转换映射
使用示例
用户: 检查项目所有 xcstrings 文件缺少的翻译
→ 运行 batch_process.py list 查看所有文件
→ 运行 batch_process.py check 检查所有文件
用户: 为 Core.xcstrings 中的 "Copy" 添加翻译
→ 运行 add_translation.py Core/Core.xcstrings "Copy" "拷贝" "拷貝"
用户: 清理所有 xcstrings 文件中过期的翻译条目
→ 运行 batch_process.py clean
用户: 验证所有翻译文件的格式和完成度
→ 运行 batch_process.py validate
用户: 处理特定目录下的翻译文件
→ 运行 batch_process.py check --dir ./Modules
注意事项
- 所有操作会直接修改指定的
.xcstrings文件 - 修改前建议先备份文件
- JSON 缩进使用 2 个空格
- 编码必须是 UTF-8
- 批量处理时使用
find命令过滤掉隐藏文件(.*/.*)
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ios-macos-i18n-translation-management-mm5t89tk/download' --output '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md.part' && mv '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md.part' '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md' && test -s '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/i18n-translate' && cp -R '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk' '.claude/skills/i18n-translate'Cursor
test -f '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md' && test -s '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/i18n-translate' && cp -R '.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk' '.cursor/skills/i18n-translate'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/ios-macos-i18n-translation-management-mm5t89tk'openskills read 'ios-macos-i18n-translation-management-mm5t89tk'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/ios-macos-i18n-translation-management-mm5t89tk/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.