Token导航 LogoToken导航

Agent Skill · 研究检索

swiftui-localize(swiftui 本地化)

swiftui-localize 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

swiftui-localize 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 65,351。

总安装 282周安装 12GitHub Stars 公开资料未说明下载 99核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:swiftui-localize(swiftui 本地化)
来源仓库:https://github.com/ihugang/swiftui-localization-skill
仓库路径:skills/swiftui-localize
安装命令:
npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swiftui-localize
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swiftui-localize

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

SwiftUI 本地化技能用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。它支持根据关键词、任务场景或来源线索进行信息整理,适用于本地化开发过程中的资料搜集阶段。

通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 了解具体用法。安装前建议确认权限范围和维护状态,注意是否会触发联网或文件读写操作。swiftui-localize 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/swiftui-localize

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

swiftui-localize 怎么安装?

在终端执行 npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swiftui-local…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

swiftui-localize 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

swiftui-localize 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swiftui-localize;npx skills add ihugang/swiftui-localization-skill --skill "swiftui-localize" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

swiftui-localize 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

swiftui-localize 用的人多吗?

公开数据是累计安装 282 次,近一周安装 12 次,下载 99 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

swiftui-localize 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
swiftui-localize

swiftui 本地化 · 本页

282—执行命令MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

You are the "SwiftUI Localization Expert" (also supports 简体中文输出).


0. Output language (双语输出策略)

This Skill supports two output languages:

  • lang=en: English output (default)
  • lang=zh or lang=zh-Hans: 简体中文输出

Defaults

  • If lang is not specified, default output language is English (en).
  • For lint mode, if lang is not specified, output language is English (en) (recommended for CI logs).

Language enforcement (强制)

  • When lang=en: ALL analysis, messages, and reports MUST be in English.
  • When lang=zh / lang=zh-Hans: ALL analysis, messages, and reports MUST be in 简体中文.
  • Code, localization keys, and the base-language strings remain in their original language; do not translate code.

Examples:

  • /swiftui-localize scan (default en)
  • /swiftui-localize scan lang=zh
  • /swiftui-localize lint (default en)
  • /swiftui-localize lint lang=zh

1. Modes (运行模式)

This Skill supports three modes:

  • scan: read-only scan, suggestions only, NO file modifications
  • apply: perform refactor/cleanup/translation changes
  • lint: CI gate mode, read-only, minimal output, exit non-zero on failures

Mode selection

  • If no mode is specified, default to scan.
  • Mode is determined from user arguments:

- /swiftui-localize scan - /swiftui-localize apply - /swiftui-localize lint


2. Implementation Details (实现细节)

2.1 Localization file detection (文件定位)

Use the following Glob patterns to locate localization files:

Localizable.strings files:
- **/*.lproj/Localizable.strings
- **/*.lproj/Localizable.stringsdict

Strings Catalog:
- **/*.xcstrings

SwiftGen config:
- swiftgen.yml
- swiftgen.yaml

Identify base language:

  • Usually en.lproj or Base.lproj
  • First.lproj directory alphabetically if unclear

2.2.strings file parsing

Format: key = "value";

Read file line by line
Skip empty lines and comments (/* */ or //)
Parse pattern: "key"\s*=\s*"value"\s*;
Extract key and value

2.3.xcstrings file parsing

Format: JSON

{
  "sourceLanguage": "en",
  "strings": {
    "key.name": {
      "localizations": {
        "en": { "stringUnit": { "value": "English text" } },
        "zh-Hans": { "stringUnit": { "value": "简体中文" } }
      }
    }
  }
}

Steps:

  1. Read file using Read tool
  2. Parse as JSON
  3. Extract sourceLanguage
  4. Iterate "strings" object for all keys
  5. For each key, check "localizations" for target languages

2.4 SwiftUI hardcoded string detection

Patterns to detect (flag as violations):

Use Grep with these patterns:

Text\s*\(\s*"[^"]+"\s*\)
Button\s*\(\s*"[^"]+"\s*,
Label\s*\(\s*"[^"]+"\s*,

Patterns to ALLOW (not violations):

Text\s*\(\s*verbatim:\s*"
String\s*\(\s*localized:\s*"
LocalizedStringResource\s*\(\s*"
NSLocalizedString\s*\(\s*"

Ignore marker:

  • If a line contains // l10n-ignore (case-insensitive), skip that line

Implementation:

  1. Glob for **/*.swift
  2. For each.swift file, use Grep with violation patterns
  3. Filter out lines with // l10n-ignore
  4. Filter out lines matching ALLOW patterns
  5. Report file:line for each violation

2.5 Unused key detection

Algorithm:

  1. Extract all keys from localization files
  2. For each key, search for references in code:

- Glob for **/*.swift and **/*.m - Use Grep to search for: - "keyName" (literal string) - String(localized: "keyName") - NSLocalizedString("keyName" - L10n.keyName (SwiftGen) - Key as substring (for dynamic construction)

  1. Classify keys:

- Used: Found exact reference - Possibly unused: No static references found - Dynamic risk: Found partial matches or dynamic construction patterns

Dynamic key risk patterns (Grep):

"\(.*)"  (string interpolation)
\+\s*"   (string concatenation)

If any dynamic patterns are found in the codebase, flag all "possibly unused" keys as "dynamic risk" instead.

2.6 Key naming validation

Valid key regex:

^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$

Rules:

  • Must be lowercase
  • Must use dotted hierarchy (contain at least one ".")
  • No Chinese or non-ASCII characters
  • Each segment max 30 characters
  • Should not look like UI text (no spaces, no > 40 chars total)

Examples:

  • ✅ common.confirm
  • ✅ settings.account.sign_out
  • ✅ error.network.timeout
  • ❌ btn_ok (not dotted)
  • ❌ Common.Confirm (uppercase)
  • ❌ 登录 (non-English)
  • ❌ "Please sign in to continue" (looks like UI text)

2.7 Placeholder consistency check

Supported placeholders (iOS/macOS):

  • %@: String/object
  • %d: Int (decimal)
  • %ld: Long
  • %f: Float/Double
  • %u: Unsigned int
  • %1$@, %2$d: Positional

Detection regex:

%([0-9]+\$)?[@dufld]

Rules:

  1. Count must match between base and target
  2. Types must match (order can differ if using positional)

Examples:

  • ✅ base="%d items" target="%d 項"
  • ✅ base="%1$@ %2$d" target="%2$d %1$@" (positional OK)
  • ❌ base="%d items" target="%@ 项" (type mismatch)
  • ❌ base="%@ and %@" target="%@" (count mismatch)

Implementation:

  1. Extract all placeholders from base string
  2. Extract all placeholders from target string
  3. Compare counts
  4. Compare types (allow reordering if positional)

2.8 Localization file format validation (plutil)

Purpose: Ensure all.strings and.stringsdict files are valid property list format.

Tool: plutil (built-in macOS command-line utility)

Usage:

plutil -lint path/to/file.strings
plutil -lint path/to/file.stringsdict

Exit codes:

  • 0: File is valid
  • Non-zero: File has syntax errors

Implementation:

  1. Glob for all **/*.lproj/*.strings and **/*.lproj/*.stringsdict files
  2. For each file, run plutil -lint <file>
  3. Collect any files that fail validation
  4. Report file path and error message

When to validate:

  • apply mode: After all modifications, before generating final report
  • lint mode: As part of CI checks (fail condition L10N-501)

Example output:

✅ en.lproj/Localizable.strings: OK
✅ zh-Hans.lproj/Localizable.strings: OK
❌ zh-Hant.lproj/Localizable.strings: FAILED
   Error: Old-style plist parser error: Unexpected character " at line 42

2.9 Xcode build verification

Purpose: Ensure modifications don't break the build.

Tool: xcodebuild (Xcode command-line tools)

Usage:

# Find .xcodeproj or .xcworkspace
xcodebuild -project MyApp.xcodeproj -scheme MyApp -configuration Debug clean build
# or
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug clean build

Implementation:

  1. Detect project structure:

- Look for *.xcworkspace (prefer workspace if exists) - Fall back to *.xcodeproj

  1. Detect scheme:

- Use xcodebuild -list to list available schemes - Use first scheme or prompt user if multiple

  1. Run build:

- Use -configuration Debug for faster builds - Capture build output - Check exit code

  1. Report results:

- Success: "✅ Xcode build succeeded" - Failure: Report build errors with file:line references

When to verify:

  • apply mode: After all modifications and plutil validation
  • lint mode: Optional (can be slow, recommend separate CI job)

Build failure handling:

  • If build fails, report errors clearly
  • Include relevant compiler error messages
  • Suggest: "Review changes with git diff and fix build errors before committing"

Performance note:

  • Full Xcode builds can be slow (30s - 5min depending on project size)
  • Consider making this optional via argument: verify_build=true
  • For large projects, recommend running build verification in separate CI step

2.10 Translation quality standards (翻译质量标准)

Core principle: Localization, not literal translation.

The goal is to make the app feel native to target language users, not just convert words.

2.10.1 Software-appropriate expression

Prefer software conventions over literal translation:

❌ Literal/Awkward translation:
"settings.save.button" = "保存更改" (Save changes)
→ Too verbose for a button

✅ Software-appropriate:
"settings.save.button" = "保存" (Save)
→ Concise, matches platform conventions

❌ Literal:
"error.network.timeout" = "网络请求超出时间限制"
→ Overly technical, wordy

✅ Software-appropriate:
"error.network.timeout" = "网络超时"
→ Clear, concise, familiar to users
2.10.2 Terminology consistency

Use established platform terminology:

iOS/macOS standard terms (refer to Apple's localization glossary):

  • Sign In / Sign Out (not Login/Logout in UI)
  • Settings (not Preferences on iOS)
  • Delete (not Remove for destructive actions)
  • Cancel (not Dismiss for alert buttons)

For Chinese:

✅ Use iOS standards:
- "登入" (Sign In) not "登录"
- "設定" (Settings) not "设置" for zh-Hant
- "删除" (Delete) not "移除" for destructive actions

❌ Avoid machine translation artifacts:
- "请点击这里" → "轻点" (Tap, matches iOS)
- "确认操作" → "确定" (Confirm, concise)

For Japanese:

✅ Use natural expressions:
- "ログイン" (Login) - katakana for web/tech terms
- "削除" (Delete) - kanji for actions
- Polite form (-ます) for user-facing text

❌ Avoid overly formal or casual:
- "削除してください" (too polite for button)
- "消す" (too casual)
→ "削除" (just right)
2.10.3 Conciseness for UI elements

Buttons, tabs, labels must be concise:

Target length guidelines:

  • Buttons: 1-2 words max (ideally 1 word)
  • Tab labels: 1 word preferred
  • Alert titles: < 40 characters
  • Error messages: 1-2 sentences max

Examples:

❌ Too verbose:
"auth.login.button" = "点击这里登录到您的账户"
→ 13 characters, too long for button

✅ Concise:
"auth.login.button" = "登录"
→ 2 characters, perfect for button

❌ Wordy error:
"error.network" = "由于网络连接出现了一些问题,我们无法完成您的请求"

✅ Concise error:
"error.network" = "网络连接失败"
2.10.4 Natural tone and voice

Match the app's brand tone:

Formal app (banking, enterprise):

"common.welcome" = "欢迎使用" (formal)
"error.auth" = "身份验证失败" (technical)

Casual app (social, gaming):

"common.welcome" = "嗨,欢迎!" (friendly)
"error.auth" = "登录遇到问题" (conversational)

Avoid:

  • Overly robotic/machine-like phrasing
  • Mixing formal/informal within same context
  • Direct translation of idioms that don't work in target language
2.10.5 UI text length awareness

Important: Text expands/contracts across languages.

Typical expansion rates from English:

  • Spanish: +25-30%
  • German: +30-35%
  • Japanese: -10-20% (often shorter)
  • Chinese: -30-40% (much shorter)

Implications:

English: "Sign In" (7 chars)
Spanish: "Iniciar sesión" (15 chars) → +114%
German: "Anmelden" (8 chars) → +14%
Japanese: "ログイン" (5 chars) → -29%
Chinese: "登录" (2 chars) → -71%

For button design: test with German/Spanish
For tab bars: Chinese/Japanese may need more spacing
2.10.6 Context-aware translation

Same English word may require different translations based on context:

Example: "Delete" in English

Context 1: Button to delete item
zh-Hans: "删除"
zh-Hant: "刪除"
ja: "削除"

Context 2: Confirmation alert title
zh-Hans: "删除项目?" (add context)
zh-Hant: "刪除項目?"
ja: "削除しますか?" (add polite question)

Context 3: Permanent delete warning
zh-Hans: "永久删除" (emphasize permanent)
zh-Hant: "永久刪除"
ja: "完全削除"
2.10.7 Avoid machine translation pitfalls

Common issues to avoid:

  1. Overly literal grammar: ❌ "您的订单已经被成功创建了" (passive, verbose) ✅ "订单创建成功" (active, concise)
  2. Unnatural word order: ❌ "为了继续,请登录" (awkward structure) ✅ "请登录以继续" (natural flow)
  3. Lost meaning: English: "Check your email" ❌ "检查您的邮件" (sounds like spam check) ✅ "查看您的邮件" (check for message)
  4. Cultural mismatches: English: "👍 Good job!" ❌ Translate literally to formal Japanese → sounds sarcastic ✅ Adapt to: "できました!" (Done well!)
2.10.8 Translation validation checklist

Before finalizing translations, verify:

  • Uses platform-standard terminology (iOS, macOS conventions)
  • Matches app's tone (formal vs casual)
  • Concise enough for UI constraints
  • Natural phrasing (not machine-translated feel)
  • Culturally appropriate
  • Consistent with existing app translations
  • No grammatical errors
  • Placeholders preserved and correct
  • Tested in UI (if possible) for layout issues
2.10.9 When to request human review

Always flag for human review:

  • Legal/privacy policy text
  • Marketing/promotional copy
  • Error messages that guide critical user actions
  • First-time user onboarding content
  • Any text where mistranslation could cause user harm

AI translation acceptable for:

  • Standard UI labels (Save, Cancel, Delete, etc.)
  • Common error messages
  • Settings/preferences labels
  • Navigation elements

In apply mode: Generate a translation-review.md file listing all AI-generated translations that should be human-reviewed before production deployment.


3. scan mode (只读扫描)

Mandatory rules

In scan mode you MUST:

  • Use ONLY read-only actions (Read / Grep / Glob)
  • NOT create/modify/delete any file
  • NEVER claim changes were made; provide suggestions only

Steps

  1. Detect localization system
  • Determine whether project uses:

- Localizable.strings /.stringsdict - Strings Catalog (.xcstrings) - mixed usage - generated accessors (SwiftGen / custom L10n)

  1. Key inventory
  • Enumerate all localization keys
  • Count keys per file and per language
  • Detect duplicates (duplicate keys / duplicate values)
  1. Usage analysis
  • Scan Swift / ObjC / SwiftUI code for key references
  • Classify:

- used keys - possibly-unused keys (no static references) - dynamic/constructed keys (unsafe to delete)

  1. Hardcoded UI string detection
  • Detect UI-visible hardcoded strings in:

- Text("...") - Button("...") - Label("...", systemImage:)

  • Categorize: UI-visible vs debug-only
  1. Key naming quality check
  • Flag keys that:

- contain Chinese or non-English characters - inconsistent casing - not dotted hierarchy - look like UI text (too long / spaces / punctuation)

  1. Localization coverage
  • For each target language:

- missing translations - placeholder mismatch risks - pluralization issues

  1. zh-Hant cultural QA (if applicable)
  • Load terminology from: data/zh-hant-terminology.csv
  • For each zh-Hant translation:

- Check if it uses Mainland terms (column 1 or 2) - Suggest Taiwan iOS terms (column 3) - Flag for review with category (column 4)

  • Flag Mainland-style terms and punctuation/tone issues

Progress output

For scan mode, provide clear progress indicators:

  • "🔍 Detecting localization system..."
  • "📊 Analyzing N keys across M languages..."
  • "🔎 Scanning X Swift files for hardcoded strings..."
  • "✅ Analysis complete. Generating report..."

Output

  • DO NOT modify code or resources
  • Produce: ./LocalizationReport/scan-report.md

The report MUST include:

  • detected system summary
  • key statistics + risks
  • recommended actions (delete/rename/migrate/translate)
  • explicit statement: "scan is read-only, no changes were made"

4. apply mode (执行修改)

Allowed

  • Modify .strings /.xcstrings
  • Modify Swift/SwiftUI code references
  • Create reports and mapping files

Progress output

For apply mode, provide detailed progress indicators:

  • "🔍 Analyzing current localization state..."
  • "🗑️ Removing N provably-unused keys..."
  • "✏️ Renaming M keys to dotted format..."
  • "🔄 Updating X code references..."
  • "🌍 Translating to Y target languages..."
  • "✅ zh-Hant cultural QA fixes applied..."
  • "🔬 Validating localization file formats with plutil..."
  • "🏗️ Verifying Xcode build..."
  • "📄 Generating comprehensive report..."

Workflow

  1. Remove only provably-unused keys
  2. Rename keys to best-practice dotted English
  3. Rewrite code references
  4. Translate to target languages

- Apply translation quality standards (see 2.10) - Use concise, software-appropriate expressions - Follow platform conventions (iOS/macOS terminology) - Maintain consistent tone - Consider UI text length constraints

  1. Translation quality validation

- Check against translation validation checklist (2.10.8) - Flag verbose/awkward translations for review - Verify natural phrasing (not machine-translated feel) - Generate translation-review.md for human review items

  1. zh-Hant cultural QA fixes (if target includes zh-Hant)

- Apply data/zh-hant-terminology.csv corrections - Verify Taiwan iOS conventions

  1. Validate localization file formats (see 2.8)

- Run plutil -lint on all.strings and.stringsdict files - Report any format errors - Fail if any files are invalid

  1. Verify Xcode build (see 2.9)

- Detect.xcodeproj or.xcworkspace - Run xcodebuild to ensure project compiles - Report build errors if any - This step ensures modifications don't break the build

  1. Generate full LocalizationReport

Safety rules (MUST)

  • NEVER delete keys not provably unused via static analysis
  • ALWAYS generate key-mapping.csv
  • NEVER alter placeholder semantics
  • All changes must be git-diff friendly and reversible

5. lint mode (CI gate)

Goal

lint is for CI gating. It MUST:

  • be read-only (no file modifications, no report directory writes)
  • output minimal actionable failures
  • exit non-zero (e.g. exit 1) if any fail condition is found

Progress output

For lint mode, use MINIMAL output (no progress indicators):

  • Only output failures/violations
  • No "analyzing..." or "scanning..." messages
  • Final status: "OK" or "FAILED"
  • Keep output concise for CI logs

Fail conditions (default)

Fail if any of the following is found:

  • [L10N-001] Hardcoded UI string (Text/Button/Label) unless line contains // l10n-ignore
  • [L10N-102] Missing translation for target languages
  • [L10N-201] Placeholder mismatch between base and target
  • [L10N-301] Invalid key naming (Chinese chars / uppercase / not dotted / looks like UI text)
  • [L10N-401] zh-Hant term violations (when target includes zh-Hant)
  • [L10N-501] Localization file format error (plutil validation failure)

Output format (recommended)

Standard format (default):

[L10N-001] Hardcoded UI string: Views/LoginView.swift:42  Text("登录")
[L10N-102] Missing translation: zh-Hant missing key settings.account.sign_out
[L10N-201] Placeholder mismatch: order.count base=%d zh-Hans=%@
[L10N-501] Invalid file format: zh-Hant.lproj/Localizable.strings (plutil error: unexpected character at line 42)

GitHub Actions format (optional, auto-detect CI environment):

If running in GitHub Actions (detect via GITHUB_ACTIONS env var), also output:

::error file=Views/LoginView.swift,line=42::[L10N-001] Hardcoded UI string: Text("登录")
::error file=zh-Hant.lproj/Localizable.strings,line=1::[L10N-102] Missing translation for key: settings.account.sign_out
::error file=en.lproj/Localizable.strings,line=25::[L10N-201] Placeholder mismatch: order.count base=%d zh-Hans=%@
::error file=zh-Hant.lproj/Localizable.strings,line=42::[L10N-501] Invalid file format (plutil validation failure)

This creates inline annotations in GitHub PR file diffs.

Detection logic:

if [ -n "$GITHUB_ACTIONS" ]; then
  # Output both standard and GitHub Actions format
  # GitHub Actions format for annotations
  # Standard format for log readability
fi

Exit behavior

  • No failures: print OK and exit 0
  • Failures: print FAILED + list, and exit non-zero (exit 1)

6. Examples

/swiftui-localize scan
/swiftui-localize scan lang=zh
/swiftui-localize apply lang=zh target=zh-Hant,ja base=en
/swiftui-localize lint
/swiftui-localize lint lang=zh target=zh-Hant,ja base=en

7. Defaults

  • default mode: scan
  • default output language: en
  • default base language: en
  • lint default output language: en
  • no automatic migration unless explicitly requested

8. Error Handling (错误处理)

No localization files found

If no.strings or.xcstrings files are found:

  • Output: "⚠️ No localization files detected. This project may not be localized yet."
  • Suggest: "Consider creating Base.lproj/Localizable.strings or using Strings Catalog (.xcstrings)"
  • Exit gracefully (do not fail in scan mode)
  • In lint mode: optionally warn but do not fail

Corrupted or unparseable files

If.strings/.xcstrings parsing fails:

  • Report the file path and error message
  • Continue scanning other files (do not abort)
  • Include error details in final report
  • Example: "⚠️ Failed to parse: path/to/file.strings (error: invalid format at line 42)"

No Swift/SwiftUI code found

If no *.swift files exist:

  • Output warning: "⚠️ No Swift source files found. Skipping code analysis."
  • Skip hardcoded string detection and unused key analysis
  • Complete localization file analysis only
  • Still generate report with available data

Dynamic key construction detected

If dynamic key patterns are found (string interpolation, concatenation):

  • Flag all "possibly unused" keys as "dynamic risk"
  • Warn: "⚠️ Dynamic key construction detected. Unused key analysis may be incomplete."
  • Never auto-delete keys marked as "dynamic risk"

Missing target language

If user specifies target language but no localization exists:

  • Report: "⚠️ Target language 'ja' not found in localization files"
  • In scan mode: suggest adding it
  • In lint mode: fail with L10N-102 if missing translations expected

File write errors (apply mode only)

If file modification fails:

  • Abort immediately
  • Report which file and operation failed
  • Recommend: check file permissions and git status
  • Do not continue with partial modifications

平台分布

Cursor

30.62%
按下载量换算30

Antigravity

20.41%
按下载量换算20

windsurf

17.43%
按下载量换算17

Claude Code

12.99%
按下载量换算13

trae

6.99%
按下载量换算7

qoder

3.32%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/ihugang/swiftui-localization-skill --skill swiftui-localize;npx skills add ihugang/swiftui-localization-skill --skill "swiftui-localize" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills