# 在地化 iOS 應用程式

此檢查不針對特定市場：它會針對您傳入的任何語系執行。以下範例使用 `de-DE`；請替換為您所發布的語系。

## 執行檢查

```sh
npx threefold check . --markets de-DE
```

檢查在您的電腦上執行。原始碼不會上傳；只有使用 `--upload` 才會傳送報告（不含程式碼）。結束代碼 `1` 表示判定結果為 `incomplete`。

若 `npx` 顯示 `threefold` 套件不存在，表示 npm 套件尚未發布（查核日期為 2026年11月12日），且無法透過 threefold 進行本機掃描。託管的 MCP 伺服器無法讀取您的磁碟。可行的做法是連接伺服器並以 `what: "repo"` 呼叫 `check`（如下），或取得公開的規則目錄（如下）。兩者都會回傳規則與標準，供您的代理程式套用於已開啟的檔案。這是代理程式依照 threefold 的標準進行評估，而非掃描結果，也不提供判定結果。

## 檢查項目內容

本頁涵蓋的檔案：`.xcstrings` 字串目錄、`.strings`、`.stringsdict`、`InfoPlist.strings`。

### CHK-IOS-001：Xcode String Catalog (.xcstrings) 狀態

- 檢查內容：確保 .xcstrings 目錄中所有鍵在目標語系下的狀態為 'translated'；拒絕缺少語系、狀態為 'new'、'needs_review' 或 'stale' 的項目。
- 嚴重性 `blocker`、驗證方式 `static`、實測狀態 `production`。
- 來源： <https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog>

### CHK-IOS-002：iOS .strings 與 .stringsdict 語法

- 檢查內容：驗證 .strings 與 .stringsdict 檔案的語法（分號、引號、註解、plist 結構）。
- 嚴重性 `blocker`、驗證方式 `static`、實測狀態 `production`。
- 來源： <https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog>

### CHK-IOS-003：iOS InfoPlist.strings 權限字串

- 檢查內容：確保面向使用者的隱私權限說明（如 NSCameraUsageDescription 等）以及 CFBundleDisplayName 已針對目標語系完成在地化。
- 嚴重性 `blocker`、驗證方式 `static`、實測狀態 `production`。
- 來源： <https://developer.apple.com/documentation/bundleresources/information_property_list>

### CHK-IOS-004：iOS CFBundleDevelopmentRegion 設定

- 檢查內容：確保 Info.plist 中的基礎後備地區（CFBundleDevelopmentRegion）非空且有效。
- 嚴重性 `warn`、驗證方式 `static`、實測狀態 `production`。
- 來源： <https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundledevelopmentregion>

## 從代理程式呼叫 threefold

以 `what: "repo"` 呼叫 MCP `check` 工具（傳入您發布的市場，此例為 `de`）：

```json
{
  "what": "repo",
  "market": "de"
}
```

在託管伺服器（`https://api.threefold.eco/mcp`）上，此工具會回傳市場的就緒規則與標準，供代理程式套用於已開啟的檔案；它不接收任何檔案，也不回傳判定結果。本機 stdio 伺服器也會掃描您提供的路徑，需從 threefold 儲存庫的本機副本執行，目前尚未公開發布。

規則目錄為公開內容，無需帳號：

```sh
curl -s "https://api.threefold.eco/api/i18n/rules?platform=ios&market=de-DE" -H "X-Threefold-Docs-Page: localise-an-ios-app"
```

## 技能

請遵循 `localise-app` 技能：執行檢查、修正每一項 `fail`，重新執行直到判定結果為 `complete` 或 `complete_static`，然後向使用者顯示人工審查清單。threefold 回傳證據與標準；代理程式評估檔案；不得虛構通過結果；法律相關項目保留在人工審查清單中。請閱讀 [https://threefold.eco/skills/localise-app.md](https://threefold.eco/skills/localise-app.md)。Claude Code 與 Codex 外掛程式內含相同技能。

## 常見問題

### threefold 會翻譯字串嗎？

檢查本身不會。它只回報缺漏或錯誤之處；字串由您的代理程式或人員撰寫。threefold 另有一個獨立、無狀態的頁面在地化呼叫（[頁面在地化](https://threefold.eco/docs/page-localisation.md)），會將頁面文字傳送至模型供應商；輸出結果由人員審閱。

### 來源程式碼會離開本機嗎？

使用 `npx threefold check` 時不會。它在本機讀取檔案。`--upload` 傳送的是報告，而非程式碼。託管的 `check` 搭配 `what: "repo"` 不接收任何檔案：它只回傳規則與標準。

### 我該傳入哪個市場代碼？

此檢查不限於特定市場。請將您發布的語系傳入 `npx threefold check --markets`（例如 `de-DE`）；MCP 工具則接受簡短的市場代碼（`de`）。

### 檢查會尋找哪些內容？

`CHK-IOS-001`：確保 .xcstrings 目錄中的所有鍵在目標語系下皆具有 state: 'translated'；拒絕缺漏的語系、'new'、'needs_review' 或 'stale'。`CHK-IOS-002`：驗證 .strings 與 .stringsdict 檔案的語法（分號、引號、註解、plist 結構）。`CHK-IOS-003`：確保面向使用者的隱私權限說明（NSCameraUsageDescription 等）與 CFBundleDisplayName 已針對目標語系在地化。`CHK-IOS-004`：確保 Info.plist 中的基礎後備地區（CFBundleDevelopmentRegion）非空且有效。

## 本頁不會聲明的事項

本頁不聲稱應用程式符合規範、已取得認證或準備就緒的百分比。檢查會回報 `complete`、`complete_static` 或 `incomplete`，並將人工審查項目列在判定結果旁，但不會將其計為已完成。

## 一次連線

Claude Code：

```sh
claude mcp add --transport http --scope user threefold https://api.threefold.eco/mcp
```

Cursor：開啟 `cursor://anysphere.cursor-deeplink/mcp/install?name=threefold&config=eyJ0aHJlZWZvbGQiOnsidXJsIjoiaHR0cHM6Ly9hcGkudGhyZWVmb2xkLmVjby9tY3AifX0=`。

Codex、VS Code、Gemini CLI、OpenCode、Claude.ai、ChatGPT 與 Grok：[安裝並連線](https://threefold.eco/docs/install.md)。若要不使用帳號試用，請使用 `https://api.threefold.eco/mcp?keyless=1`：僅能讀取資料庫內容，每個 IP 位址每日有次數上限（[定價](https://threefold.eco/pricing.md)）。
