Skip to content
i18n-translate logo

iOS/macOS 本地化翻译管理

i18n-translate

管理 iOS/macOS 应用的 *.xcstrings 本地化翻译文件。自动清理过期条目、检测缺失翻译、添加简繁体中文翻译。当用户需要处理翻译、补充缺失的 zh-Hans/zh-HK 翻译、或清理 *.xcstrings 文件时使用此 skill。

SKILL.md

Full skill instructions

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 命令过滤掉隐藏文件(.*/​.*)

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View