<a id="machine-translation-setup"></a>

# 翻譯服務

#### Versionchanged
在 4.13 版的變更: 在 Weblate 4.13 之前，這些服務是在 [設定](https://docs.weblate.org/zh-tw/latest/admin/config.md#config) 中設定的。

Weblate 內建支援多種機器翻譯與翻譯記憶服務。同一項服務可以使用不同設定安裝多次。管理員可在 [管理介面](https://docs.weblate.org/zh-tw/latest/admin/admin.md#management-interface) 的 翻譯服務 中設定全站適用的安裝項目。工作空間管理員可設定工作空間的安裝項目，專案管理員則可設定專案的安裝項目：

![image](screenshots/project-machinery.webp)

#### NOTE
它們受到其使用條款的約束，所以確保您被允許以您想要的方式使用它們。第三方服務可從 Weblate 接收來源字串、翻譯、和相關的情境。

該服務從 [組件設定](https://docs.weblate.org/zh-tw/latest/admin/projects.md#component) 設定的原始檔進行翻譯，請參考 [來源語言](https://docs.weblate.org/zh-tw/latest/admin/projects.md#component-source-language)。

專案會合併使用網站、工作空間及專案的安裝項目。您可以在工作空間或專案設定中排除某個繼承的安裝項目，或排除某項服務的所有繼承安裝項目。暫停安裝項目會保留其設定，方便日後繼續使用。

在清單中選取服務，即可開啟其詳細資料、設定與控制項。已安裝服務的詳細資料頁面 URL 使用其數字安裝 ID。詳細資料頁面也提供用於自動化工作流程的選取識別碼。若有管理權限，繼承的服務會連結至其所屬範圍。清單會摘要顯示模型、來源語言選項、區域等基本設定，以及安裝 ID 與代稱。這些摘要不包含認證資訊、API URL 與自由文字提示詞。

已受速率限制 標記表示，Weblate 在服務提供者發生錯誤後，已暫時停止發送請求。預設冷卻時間為 30 分鐘，但會因服務及服務提供者指定的重試延遲而異；請參閱 [冷卻時間設定](#machinery-rate-limit-window)。冷卻時間套用至單一安裝項目，包括所有繼承此項目的專案。不同安裝項目的冷卻時間各自獨立，即使它們使用相同的服務提供者認證資訊也一樣。

管理員可在安裝項目所屬的網站、工作空間或專案範圍，開啟其詳細資料頁面並使用 重設速率限制。這會清除 Weblate 的翻譯與改寫冷卻時間，但不會清除已快取的建議，也不會重設服務提供者的配額；若服務提供者再次發生錯誤，可能又會進入冷卻時間。繼承的安裝項目會顯示狀態，但無法從使用該項目的工作空間或專案重設其冷卻時間。

<a id="machinery-error-log"></a>

安裝項目詳細資料頁面的 日誌 分頁，會列出擷取支援語言、翻譯與改寫建議時發生的錯誤，包括服務提供者的速率限制。記錄歸屬於安裝項目，即使是由繼承該項目的專案使用也一樣。只有能在所屬範圍管理安裝項目的管理員，才可讀取這些記錄。若具備必要權限，繼承的服務會提供連結前往這些記錄。

訊息會保留服務提供者的診斷資訊，但會遮蔽 URL 與已設定的機密值。服務提供者可能在訊息中回傳翻譯內容，因此記錄仍可能包含來源字串或譯文。錯誤記錄預設保留 30 天，可透過 [`MACHINERY_ERROR_KEEP_DAYS`](https://docs.weblate.org/zh-tw/latest/admin/config.md#std-setting-MACHINERY_ERROR_KEEP_DAYS) 調整。舊記錄每天清除一次。移除安裝項目時，也會一併移除其記錄。

每個安裝項目都有數字 ID，也可以設定代稱。在自動翻譯、自動化或 AI 檢閱中，可用 `service:id` 或 `service:slug` 選取單一安裝項目。若專案只適用該服務的一個啟用中安裝項目，也可只填服務名稱。非空白代稱必須在專案可見的所有安裝項目中保持唯一，包含繼承的安裝項目；不同專案則可使用相同代稱。已儲存的代稱選取器會指向目前使用該代稱的安裝項目。沒有可設定選項的服務，在每個範圍只能安裝一次，且不能與已啟用的繼承安裝項目重疊。若要在下層範圍啟用另一個安裝項目，請先排除繼承的安裝項目。每個範圍最多可有 20 個安裝項目，包含已暫停的項目。

使用 `install_machinery --update` 時，若同一服務有多個網站層級的安裝項目，請用唯一的 `--slug` 或 `--id` 指定項目。

也可以透過 [Weblate 的 REST API](https://docs.weblate.org/zh-tw/latest/api.md#api) 設定翻譯服務安裝項目。

已設定的翻譯服務會在翻譯編輯器的 自動建議 分頁提供建議，也可以在 [自動翻譯](https://docs.weblate.org/zh-tw/latest/user/translating.md#auto-translation) 中選用。

#### SEE ALSO
[自動建議](https://docs.weblate.org/zh-tw/latest/user/translating.md#machine-translation)

<a id="mt-translation-services-priority"></a>

## 機器翻譯與翻譯記憶服務的優先順序

[Weblate 翻譯記憶](#mt-weblate-translation-memory) 的相符結果若為 100%，其優先順序高於機器翻譯服務。如果翻譯記憶中有 100% 相符結果，就不會執行機器翻譯。如果有多筆 100% 相符結果，系統會使用資料庫傳回的第一筆結果。

每個機器翻譯服務都有一個預定義的可以產生的最高分。系統按照它們的最高分確定使用安裝的翻譯服務的順序。如果字串譯文的分低於機器翻譯服務的最高分，那麼將請求該服務產生翻譯。如果譯文得分超過目前得分，那麼系統將接受該譯文。

若要明確指定服務順序，並為每項服務設定不同的分數門檻，請使用 [在機器翻譯前先套用翻譯記憶](https://docs.weblate.org/zh-tw/latest/admin/automation.md#automation-translation-ordering)。此工作流程會先完成一輪翻譯，再選取字串交由下一項服務處理。

<a id="mt-sources"></a>

## 機器翻譯的來源字串

#### Versionadded
在 5.11 版被加入.

可以設定所有第三方服務的來源字串來源。這可以用來微調服務獲得最好結果。有以下選項可用：

自動選擇
: 自動選擇最佳來源語言。
  <br/>
  這是預設行為。

組件來源語言
: 使用組件來源語言。
  <br/>
  此為 5.11 版本前的行為。

專案或組件中定義的第二語言
: 使用專案 [第二語言](https://docs.weblate.org/zh-tw/latest/admin/projects.md#project-secondary-language) 或組件 [第二語言](https://docs.weblate.org/zh-tw/latest/admin/projects.md#component-secondary-language)。
  <br/>
  退回到自動選擇來源語言，如果未設定第二語言。

<a id="llm-translation-context"></a>

## LLM 翻譯情境

若有可用資訊，以 LLM 為基礎的翻譯服務會收到每個待譯字串的額外背景資訊，包括字串的情境或單語鍵、額外說明、已設定的次要語言譯文、複數資訊、未通過的品質檢查及預留位置內容。相符的詞彙表條目也會連同說明與選取的旗標一併傳送，以便區分重複的詞彙。

您可以在 特定語言的操作指南 中，使用將語言代碼對應至文字的 JSON 物件，新增目標語言專用的說明。語言代碼必須存在於 Weblate 中，且會進行完全比對；不會忽略空白字元。每項說明最多可包含 1000 個字元。Weblate 會先尋找完全相符的目標語言代碼，再退回使用基礎語言代碼。

新增的中繼資料只用於引導產生建議；傳回的翻譯仍必須保留來源的預留位置和標記。Weblate 也會向 LLM 服務傳送一小段先前的對話，示範預期的 JSON 回應格式。來源語言和目標語言的組合有可用範例時，對話會使用隨附的已翻譯範例，否則會使用與語言無關的格式範例。也可以附加相同目標語言的既有翻譯作為其他範例。

<!-- AUTOGENERATED START: alibaba -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-alibaba"></a>

## Alibaba

#### Versionadded
在 5.3 版被加入.

* **服務編號:**
  `alibaba`
* **分數上限:**
  80
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | 存取金鑰 ID  |                                                                                                    |
  | `secret`            | 存取金鑰秘密   |                                                                                                    |
  | `region`            | 區域 ID    |                                                                                                    |

<!-- AUTOGENERATED END: alibaba -->

Alibaba Translate 是用於翻譯文字的神經機器翻譯服務，支援最多 214 個語言配對。

#### SEE ALSO
[Alibaba 翻譯說明文件](https://www.alibabacloud.com/help/en/machine-translation)

<!-- AUTOGENERATED START: anthropic -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-anthropic"></a>

## Anthropic

#### Versionadded
在 5.16 版被加入.

* **服務編號:**
  `anthropic`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
  * [LLM 翻譯情境](#llm-translation-context)
* **設定:**
  | `source_language`       | 來源語言選擇            | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                                                                                                                                                                                                                   |
  |-------------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `base_url`              | Anthropic API URL | Anthropic API 基本 URL。留空以使用預設 URL。                                                                                                                                                                                                                                                                                  |
  | `model`                 | Anthropic 模型      | 可用的選擇：<br/><br/>`claude-haiku-4-5` -- Claude Haiku 4.5<br/><br/>`claude-sonnet-5` -- Claude Sonnet 5<br/><br/>`claude-opus-5` -- Claude Opus 5<br/><br/>`claude-fable-5-1` -- Claude Fable 5.1<br/><br/>`claude-opus-4-8` -- Claude Opus 4.8<br/><br/>`claude-fable-5` -- Claude Fable 5<br/><br/>`custom` -- 自訂模型 |
  | `persona`               | 翻譯者角色描述           | 描述譯者的角色或專長。例如：「您是一位經驗豐富的醫學譯者。」                                                                                                                                                                                                                                                                                     |
  | `style`                 | 翻譯風格              | 描述希望採用的翻譯風格。例如：「請使用口語化的表達方式。」                                                                                                                                                                                                                                                                                      |
  | `language_instructions` | 特定語言說明            | 輸入 JSON 物件，將 Weblate 可辨識的目標語言代碼對應至額外的翻譯指示。每份指示最多可有 1000 個字元。例如：{"de": "Use formal address."}                                                                                                                                                                                                                       |
  | `key`                   | API 金鑰            |                                                                                                                                                                                                                                                                                                                    |
  | `custom_model`          | 自訂模型名稱            | 選取「自訂模型」時必填。請輸入 API 使用的模型識別碼。                                                                                                                                                                                                                                                                                      |
  | `max_tokens`            | 最大詞元數             | 產生的回應中可包含的詞元數上限。                                                                                                                                                                                                                                                                                                   |

<!-- AUTOGENERATED END: anthropic -->

使用 [Anthropic 的 Claude](https://www.anthropic.com/) 模型執行翻譯。

Anthropic API 可存取 Claude 模型家族，這些模型以強大的推理及語言能力著稱。您需要 Anthropic 的 API 金鑰才能使用此服務。

模型選項會優先列出目前普遍提供的 Claude 模型。只要 Anthropic 繼續支援先前提供的模型，仍可選取這些模型。

使用 persona 和 style 欄位進一步微調翻譯。這些將被用於 Claude 的提示並允許您變更翻譯的風格。

服務自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

#### SEE ALSO
* [Anthropic API 說明文件](https://docs.anthropic.com/en/api/getting-started)
* [Anthropic Console](https://platform.claude.com/)

<!-- AUTOGENERATED START: apertium-apy -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-apertium-apy"></a>

## Apertium APy

* **服務編號:**
  `apertium-apy`
* **分數上限:**
  88
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |

<!-- AUTOGENERATED END: apertium-apy -->

開源原件機器翻譯平台提供一組有限語言的翻譯。

使用 Apertium的建議方式是執行您自己的 Apertium-APy 伺服器。

#### SEE ALSO
* [Apertium 網站](https://www.apertium.org/)
* [Apertium APy 說明文件](https://wiki.apertium.org/wiki/Apertium-apy)

<!-- AUTOGENERATED START: aws -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-aws"></a>

## Amazon Translate

* **服務編號:**
  `aws`
* **分數上限:**
  88
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | 存取金鑰 ID  |                                                                                                    |
  | `secret`            | API 金鑰   |                                                                                                    |
  | `region`            | 區網域稱     |                                                                                                    |
  | `formality`         | 正式程度     | 可用的選擇：<br/><br/> *空值* -- 預設值<br/><br/>`FORMAL` -- 正式<br/><br/>`INFORMAL` -- 非正式                    |
  | `brevity`           | 簡潔度      | 支援時，優先採用較短的譯文。<br/><br/>可用的選擇：<br/><br/> *空值* -- 預設值<br/><br/>`ON` -- 已啟用                          |
  | `profanity`         | 不雅用語     | 遮蔽譯文中的不雅用語。<br/><br/>可用的選擇：<br/><br/> *空值* -- 預設值<br/><br/>`MASK` -- 遮蔽不雅用語                        |

<!-- AUTOGENERATED END: aws -->

Amazon Translate 是神經機器翻譯服務，用於將英語與廣泛支援的語言進行互譯。此服務需要 TranslateFullAccess 受管政策。

服務自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

#### SEE ALSO
* [Amazon Translate 說明文件](https://docs.aws.amazon.com/translate/)
* [AWS TranslateFullAccess 政策](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/TranslateFullAccess.html)

<!-- AUTOGENERATED START: azure-openai -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-azure-openai"></a>

## Azure OpenAI

#### Versionadded
在 5.8 版被加入.

* **服務編號:**
  `azure-openai`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
  * [LLM 翻譯情境](#llm-translation-context)
* **設定:**
  | `source_language`       | 來源語言選擇              | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |-------------------------|---------------------|----------------------------------------------------------------------------------------------------|
  | `base_url`              | API URL             |                                                                                                    |
  | `model`                 | LLM 模型              |                                                                                                    |
  | `persona`               | 翻譯者角色描述             | 描述譯者的角色或專長。例如：「您是一位經驗豐富的醫學譯者。」                                                                     |
  | `style`                 | 翻譯風格                | 描述希望採用的翻譯風格。例如：「請使用口語化的表達方式。」                                                                      |
  | `language_instructions` | 特定語言說明              | 輸入 JSON 物件，將 Weblate 可辨識的目標語言代碼對應至額外的翻譯指示。每份指示最多可有 1000 個字元。例如：{"de": "Use formal address."}       |
  | `key`                   | API 金鑰              |                                                                                                    |
  | `azure_endpoint`        | Azure OpenAI 端點 URL | 執行個體的端點 URL，如：[https://my-instance.openai.azure.com](https://my-instance.openai.azure.com)。        |
  | `deployment`            | Azure OpenAI 部署     | 模型的唯一部署名稱。                                                                                         |

<!-- AUTOGENERATED END: azure-openai -->

使用託管在 Azure 上的 [OpenAI](https://openai.com/) 執行翻譯。

#### SEE ALSO
[OpenAI](#mt-openai)

<!-- AUTOGENERATED START: baidu -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-baidu"></a>

## Baidu

* **服務編號:**
  `baidu`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇           | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|------------------|----------------------------------------------------------------------------------------------------|
  | `key`               | 用戶端 ID           |                                                                                                    |
  | `secret`            | 用戶端秘密金鑰 (secret) |                                                                                                    |

<!-- AUTOGENERATED END: baidu -->

由百度提供的機器翻譯服務。

這項服務使用 API，並且您需要從百度獲得 ID 和 API 金鑰來使用它。

#### SEE ALSO
[Baidu Translate API](https://fanyi-api.baidu.com/product/11)

<!-- AUTOGENERATED START: cyrtranslit -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-cyrtranslit"></a>

## CyrTranslit

#### Versionadded
在 5.7 版被加入.

* **服務編號:**
  `cyrtranslit`
* **分數上限:**
  100
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|

<!-- AUTOGENERATED END: cyrtranslit -->

使用 Cyrtranslit 函式庫的機器翻譯服務。

此服務可為同時使用西里爾及拉丁書寫系統的語言，在兩種書寫系統間轉換文字。

#### SEE ALSO
[Cyrtranslit 儲存庫](https://github.com/opendatakosovo/cyrillic-transliteration)

<!-- AUTOGENERATED START: deepl -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-deepl"></a>

## DeepL

* **服務編號:**
  `deepl`
* **分數上限:**
  91
* **進階功能:**
  * [自動建議中的可置入項目](https://docs.weblate.org/zh-tw/latest/user/checks.md#placeables-mt)
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |
  | `key`               | API 金鑰   |                                                                                                    |
  | `formality`         | 正式程度     | 如果語言沒有特別指定是否為書面語，則使用指定的正式程度                                                                        |
  | `context`           | 翻譯情境     | 描述翻譯情境，提升翻譯準確性。                                                                                    |
  | `next_gen`          | 使用下一代模型  | 偏好使用下一代大語言模型，而非經典機器翻譯模型。                                                                           |

<!-- AUTOGENERATED END: deepl -->

DeepL 是付費服務，可為少數語言提供品質良好的機器翻譯。您需要購買 DeepL API 訂閱方案。

搭配 DeepL 服務使用的 API URL。請設定不含 API 版本的基底端點；Weblate 會為每個要求選擇適當的 DeepL API 版本。若使用需要 API v1 的舊版訂閱，請改為設定 `https://api.deepl.com/v1/`。

#### Versionchanged
在 2026.9.1 版的變更: 已重新提供對明確設定的 DeepL API v1 端點之支援。

`https://api.deepl.com/` （Weblate 預設值）
: 用於付費計劃的 API 用量，訂閱是基於用量的。

`https://api-free.deepl.com/`
: 用於免費計劃的 API 用量，訂閱是基於用量的。

Weblate 支援 DeepL 正式程度功能，它將根據語言選擇相符的變體（例如，有 `de@formal` 和 `de@informal`）。

可指定翻譯情境來改進翻譯品質（選用）。要閱讀這方面的更多資訊，請存取 [DeepL 翻譯情境的文件](https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter)。

此服務會自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)；請參閱 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。API v1 不支援詞彙表整合。

<a id="mt-deepl-rephrase"></a>

## 改寫現有譯文

字串已有翻譯時，Weblate 可以將已儲存的目標文字傳送至 DeepL Write API 的 `/v2/write/rephrase` 端點，並將改寫後的文字列為額外的機器翻譯建議。

此功能需要使用 `https://api.deepl.com/` 的 DeepL API Pro 訂閱。使用免費 API 端點時，不會執行改寫。

只有 DeepL Write API 支援的語言才能使用此功能。已儲存的翻譯會以純文字傳送，不會像 DeepL 翻譯一樣處理 XML 佔位符。改寫建議的評分會略低於 DeepL 翻譯，因此自動翻譯仍會優先採用翻譯結果。成功的改寫會加入快取；若快取未命中，仍會額外發出 API 要求，並可能增加 API 用量與帳務費用。

#### SEE ALSO
* [DeepL 翻譯器](https://www.deepl.com/translator)
* [DeepL 價格](https://www.deepl.com/pro)
* [DeepL API 說明文件](https://developers.deepl.com/docs/getting-started/quickstart)

<!-- AUTOGENERATED START: etranslation -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-etranslation"></a>

## eTranslation

* **服務編號:**
  `etranslation`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                                                                                             |
  |---------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `key`               | 應用程式名稱   |                                                                                                                                                                                              |
  | `secret`            | 密碼       |                                                                                                                                                                                              |
  | `domain`            | 預設翻譯領域   | 可用的選擇：<br/><br/>`GEN` -- 一般文字 (GEN)<br/><br/>`SPD` -- 歐盟正式用語 (SPD)<br/><br/>`ECB` -- 財經 (ECB)<br/><br/>`ECJ` -- 歐洲法院 (ECJ)<br/><br/>`IPO` -- EIP 判例法（智慧財產權）(IPO)<br/><br/>`_OTHER` -- 其他領域代碼 |
  | `other_domain`      | 其他領域代碼   | 選取「其他領域代碼」時，請輸入 eTranslation 提供的領域代碼。                                                                                                                                                        |
  | `component_domains` | 組件翻譯領域   | 將完整組件路徑對應至領域代碼的 JSON 物件，例如 {"my-project/privacy-policy": "SPD"}。                                                                                                                             |

<!-- AUTOGENERATED END: etranslation -->

向歐盟執行委員會註冊應用程式，取得應用程式名稱與密碼，再於 自動建議 中設定 [eTranslation](#mt-etranslation)。認證資料會透過 HTTP 基本驗證傳送。預設翻譯領域為 `GEN`（一般文字）。請依名稱選取文件所列的領域，或選取 其他領域代碼，輸入 eTranslation 傳回的代碼。服務的領域端點會提供可用的領域代碼及其支援的語言配對。API 也列出 `QE`（品質估計）與 `NER`，但領域文件未說明如何將它們用作翻譯領域。

Use Component language domains to select a different domain for
individual components. Enter a JSON object whose keys are full component paths,
including category segments where applicable. Use the domain codes shown in
parentheses in the Default language domain choices:

```default
{"my-project/privacy-policy": "SPD"}
```

未列在對映中的組件，會使用 預設翻譯領域。這份對映屬於 eTranslation 服務設定，而非組件設定。專案層級的服務設定會覆寫全站服務設定，與其他建議服務相同。建議中會顯示每筆翻譯使用的領域。

eTranslation 透過非同步回呼傳回文字。請將 [`SITE_DOMAIN`](https://docs.weblate.org/zh-tw/latest/admin/config.md#std-setting-SITE_DOMAIN) 設為可公開存取的網域，並啟用 HTTPS，讓 eTranslation 能夠存取回呼 URL。所有 Weblate 應用程式處理程序都必須共用設定的快取。Weblate 最多會等待每個文字建議 15 秒；超時才收到的回呼無法填入該建議。超過 5,000 個字元的文字片段會略過。

#### SEE ALSO
* [eTranslation REST v2 文字 API](https://language-tools.ec.europa.eu/dev-corner/etranslation/rest-v2/text)
* [eTranslation 語言配對與領域](https://language-tools.ec.europa.eu/dev-corner/etranslation/rest-v2/languages-pairs)
* [eTranslation 錯誤代碼](https://language-tools.ec.europa.eu/dev-corner/etranslation/rest-v2/error-codes)
* [申請 eTranslation API 認證資訊](https://language-tools.ec.europa.eu/registerApiKey)

<!-- AUTOGENERATED START: glosbe -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-glosbe"></a>

## Glosbe

* **服務編號:**
  `glosbe`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|

<!-- AUTOGENERATED END: glosbe -->

幾乎每一種活語言的免費字典與翻譯服務。

此 API 可免費使用，但翻譯的使用受所用資料來源之授權條款約束。為防止濫用，服務會限制單一 IP 在特定時段內可發出的呼叫次數。

#### SEE ALSO
[Glosbe 網站](https://glosbe.com/)

<!-- AUTOGENERATED START: google-translate -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-google-translate"></a>

## Google Cloud Translation Basic

* **服務編號:**
  `google-translate`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: google-translate -->

Google 雲服務提供的機器翻譯服務。

這項服務使用了 Google Translation API v2，您需要得到 API 金鑰，並在 Google API 控制檯開啟記費。

#### SEE ALSO
[Google 翻譯說明文件](https://docs.cloud.google.com/translate/docs)

<!-- AUTOGENERATED START: google-translate-api-v3 -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-google-translate-api-v3"></a>

## Google Cloud Translation Advanced

* **服務編號:**
  `google-translate-api-v3`
* **分數上限:**
  90
* **進階功能:**
  * [自動建議中的可置入項目](https://docs.weblate.org/zh-tw/latest/user/checks.md#placeables-mt)
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
* **設定:**
  | `source_language`   | 來源語言選擇                   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|--------------------------|----------------------------------------------------------------------------------------------------|
  | `credentials`       | Google 翻譯服務帳號資訊          | 輸入服務帳號的 JSON 金鑰。                                                                                   |
  | `project`           | Google 翻譯專案              | 輸入您 Google Cloud 專案的數字或字母 ID。                                                                      |
  | `location`          | Google Translate 位置      | 選擇您用在 Google Cloud 專案，或者是位置最靠近您的 Google Cloud Translation 區域。                                      |
  | `bucket_name`       | Google Storage Bucket 名稱 | 請輸入用來儲存詞彙表檔案的 Google Cloud Storage bucket 名稱。                                                      |

<!-- AUTOGENERATED END: google-translate-api-v3 -->

Google 雲服務提供的機器翻譯服務。

這項服務使用 Google 翻譯 API v3，您需要 JSON 格式的憑證來存取它。

要使用此服務，您需要先經歷下列步驟：

1. [選擇或建立 Cloud Platform 專案.](https://console.cloud.google.com/project)
2. [啟用專案計費.](https://docs.cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
3. [啟用雲端翻譯。](https://docs.cloud.google.com/translate/docs)
4. [設定身分驗證。](https://googleapis.dev/python/google-api-core/latest/auth.html)

您也可以建立儲存桶來設定 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary) 要使用的服務（非必須）：

1. [建立 Google 雲端儲存桶.](https://docs.cloud.google.com/storage/docs/creating-buckets)
2. [設定儲存桶位置為 "us-central1".](https://docs.cloud.google.com/translate/docs/migrate-to-v3#resources_projects_and_locations)
3. [授予服務帳號 'Storage Admin' 權限.](https://docs.cloud.google.com/translate/docs/access-control)

#### SEE ALSO
* [Google 翻譯說明文件](https://docs.cloud.google.com/translate/docs)
* [用客戶端庫進行雲服務身分驗證](https://docs.cloud.google.com/docs/authentication/client-libraries)
* [建立 Google Translate 專案](https://docs.cloud.google.com/appengine/docs/standard/nodejs/building-app/creating-project)
* [Google Cloud 應用引擎位置](https://docs.cloud.google.com/appengine/docs/standard/locations)

<a id="mt-ibm"></a>

## IBM Watson Language Translator

#### Versionremoved
在 5.13.1 版被移除: 廠商自 2024 年 12 月 10 日起停止提供本服務。

<!-- AUTOGENERATED START: libretranslate -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-libretranslate"></a>

## LibreTranslate

#### Versionadded
在 4.7.1 版被加入.

* **服務編號:**
  `libretranslate`
* **分數上限:**
  89
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: libretranslate -->

LibreTranslate 是一項自由開源的機器翻譯服務。公共執行個體需要 API 金鑰，但 LibreTranslate 可以自託管，並且有幾個映像可以免費使用 API。

`https://libretranslate.com/` (官方公開服務)
: 需要一個API金鑰才能在該網站之外使用。

#### SEE ALSO
* [LibreTranslate 網站](https://libretranslate.com/)
* [LibreTranslate 儲存庫](https://github.com/LibreTranslate/LibreTranslate)
* [LibreTranslate Docker 容器整合](https://docs.weblate.org/zh-tw/latest/admin/install/docker.md#docker-libretranslate)

<!-- # spellchecker:off -->
<!-- AUTOGENERATED START: ltengine -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-ltengine"></a>

## LTEngine

#### Versionadded
在 5.17.1 版被加入.

* **服務編號:**
  `ltengine`
* **分數上限:**
  89
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: ltengine -->

LTEngine 提供本機的 LibreTranslate 相容 API，由大型語言模型提供支援。對許多 Weblate 安裝環境而言，[Ollama](#mt-ollama) 之類的原生 LLM 服務可能更適合，因為 Weblate 可將翻譯情境直接傳送給模型。只有在您特別想使用 LTEngine 的本機翻譯引擎，或未來 LTEngine 的翻譯改進時，才使用 LTEngine。

<!-- AUTOGENERATED START: microsoft-translator -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-microsoft-translator"></a>

## Azure AI Translator

* **服務編號:**
  `microsoft-translator`
* **分數上限:**
  90
* **進階功能:**
  * [自動建議中的可置入項目](https://docs.weblate.org/zh-tw/latest/user/checks.md#placeables-mt)
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
* **設定:**
  | `source_language`   | 來源語言選擇     | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                                                                                                                                                                                                                                                               |
  |---------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `key`               | API 金鑰     |                                                                                                                                                                                                                                                                                                                                                                |
  | `base_url`          | 應用程式基礎 URL | 可用的選擇：<br/><br/>`api.cognitive.microsofttranslator.com` -- 全球（不分區）<br/><br/>`api-apc.cognitive.microsofttranslator.com` -- 亞太<br/><br/>`api-eur.cognitive.microsofttranslator.com` -- 歐洲<br/><br/>`api-nam.cognitive.microsofttranslator.com` -- 北美<br/><br/>`api.translator.azure.cn` -- 中國<br/><br/>`api.cognitive.microsofttranslator.us` -- Azure 美國政府雲端服務 |
  | `endpoint_url`      | 身分驗證服務 URL | 可以使用下方的區域欄位指定區域性或多服務。<br/><br/>可用的選擇：<br/><br/>`api.cognitive.microsoft.com` -- 全球<br/><br/>`api.cognitive.azure.cn` -- 中國<br/><br/>`api.cognitive.microsoft.us` -- Azure 美國政府雲端服務                                                                                                                                                                             |
  | `region`            | 身分驗證服務區域   |                                                                                                                                                                                                                                                                                                                                                                |
  | `category`          | 類別         | 指定自訂的系統分類 ID（而非通用 ID）來使用。                                                                                                                                                                                                                                                                                                                                      |

<!-- AUTOGENERATED END: microsoft-translator -->
<!-- # spellchecker:on -->

這是由 Microsoft 透過 Azure portal 提供的機器翻譯服務，屬於 Cognitive Services 之一。

Weblate 實施了 Translator API V3.

此服務透過 [dynamic dictionary](https://learn.microsoft.com/en-us/azure/ai-services/translator/dynamic-dictionary) 自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

### Translator Text API V2

您用於Translator API V2 的金鑰可以用於 API 3。

### Translator Text API V3

您必須在 Azure 入口網站註冊，並使用在該處取得的金鑰。使用新的 Azure 金鑰時，還必須將 `region` 設為服務所在區域。

您也可以指定自訂類別來使用 [custom translator](https://learn.microsoft.com/en-gb/azure/ai-services/Translator/custom-translator/concepts/customization).

#### HINT
對於 Azure 中國，請使用您的 Azure Portal 的端點。

#### SEE ALSO
* [認知服務 ——文字翻譯 API](https://azure.microsoft.com/en-us/products/ai-services/ai-translator)
* [Microsoft Azure 入口網站](https://portal.azure.com/)
* [Base URLs](https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/v3/reference#base-urls)
* ["用多服務資源進行身分驗證"](https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/authentication#authenticating-with-a-multi-service-resource)
* [「使用存取權杖進行驗證」節落](https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/authentication#authenticating-with-an-access-token)

<!-- AUTOGENERATED START: mistral -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-mistral"></a>

## Mistral

#### Versionadded
在 2026.7 版被加入.

* **服務編號:**
  `mistral`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
  * [LLM 翻譯情境](#llm-translation-context)
* **設定:**
  | `source_language`       | 來源語言選擇             | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                                                                                                                                                                                                                                                                                                                                         |
  |-------------------------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `base_url`              | Mistral API 基底 URL | Mistral API 的基底 URL (若與 Mistral 預設 URL 不同)                                                                                                                                                                                                                                                                                                                                                                                               |
  | `model`                 | Mistral 模型         | 選取「自動選擇」時，Weblate 會依照預先設定的優先順序清單，選用第一個可透過 API 使用的模型。<br/><br/>可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`mistral-small-latest` -- Mistral Small 4<br/><br/>`ministral-14b-latest` -- Ministral 3 14B<br/><br/>`ministral-8b-latest` -- Ministral 3 8B<br/><br/>`ministral-3b-latest` -- Ministral 3 3B<br/><br/>`mistral-large-latest` -- Mistral Large 3<br/><br/>`mistral-medium-latest` -- Mistral Medium 3.5<br/><br/>`custom` -- 自訂模型 |
  | `persona`               | 翻譯者角色描述            | 描述譯者的角色或專長。例如：「您是一位經驗豐富的醫學譯者。」                                                                                                                                                                                                                                                                                                                                                                                                           |
  | `style`                 | 翻譯風格               | 描述希望採用的翻譯風格。例如：「請使用口語化的表達方式。」                                                                                                                                                                                                                                                                                                                                                                                                            |
  | `language_instructions` | 特定語言說明             | 輸入 JSON 物件，將 Weblate 可辨識的目標語言代碼對應至額外的翻譯指示。每份指示最多可有 1000 個字元。例如：{"de": "Use formal address."}                                                                                                                                                                                                                                                                                                                                             |
  | `key`                   | API 金鑰             |                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  | `custom_model`          | 自訂模型名稱             | 選取「自訂模型」時必填。請輸入 API 使用的模型識別碼。                                                                                                                                                                                                                                                                                                                                                                                                            |

<!-- AUTOGENERATED END: mistral -->

自動選取或預先定義模型時，系統會查詢服務的模型清單端點。自動選取會優先採用兼顧翻譯品質、回應時間與價格的通用模型，並依顯示順序嘗試其他可用模型。若使用不提供模型探索功能的相容閘道，請選擇 自訂模型；Weblate 會將已設定的模型識別碼直接傳送至聊天端點。

<!-- AUTOGENERATED START: modernmt -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-modernmt"></a>

## ModernMT

#### Versionadded
在 4.2 版被加入.

* **服務編號:**
  `modernmt`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |
  | `key`               | API 金鑰   |                                                                                                    |
  | `context_vector`    | 情境向量     | 「記憶 ID:權重」的逗號分隔清單。範例：1234:0.123,4567:0.456                                                         |

<!-- AUTOGENERATED END: modernmt -->

服務自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

#### SEE ALSO
[ModernMT API](https://www.modernmt.com/api/#translation)

<!-- AUTOGENERATED START: mymemory -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-mymemory"></a>

## MyMemory

* **服務編號:**
  `mymemory`
* **分數上限:**
  100
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `email`             | 聯絡電子郵件   |                                                                                                    |
  | `username`          | 使用者名稱    |                                                                                                    |
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: mymemory -->

使用機器翻譯的巨量翻譯記憶。

自由匿名使用，目前限制為 100 個請求/天，或者在 `email` 中提供電子郵件聯絡地址時限制為 1000 個請求/天。您還可以向他們請求更多。

#### SEE ALSO
[MyMemory 網站](https://mymemory.translated.net/)

<!-- AUTOGENERATED START: netease-sight -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-netease-sight"></a>

## Netease Sight

* **服務編號:**
  `netease-sight`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇           | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|------------------|----------------------------------------------------------------------------------------------------|
  | `key`               | 用戶端 ID           |                                                                                                    |
  | `secret`            | 用戶端秘密金鑰 (secret) |                                                                                                    |

<!-- AUTOGENERATED END: netease-sight -->

網易提供的機器翻譯服務。

這項服務使用 API，兵器額您需要從網易得到金鑰和密碼。

#### SEE ALSO
[網易見外翻譯平台](https://sight.youdao.com/)

<!-- AUTOGENERATED START: ollama -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-ollama"></a>

## Ollama

#### Versionadded
在 5.15 版被加入.

* **服務編號:**
  `ollama`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
  * [LLM 翻譯情境](#llm-translation-context)
* **設定:**
  | `source_language`       | 來源語言選擇    | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                      |
  |-------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------|
  | `base_url`              | API URL   | Ollama API 的基礎網址，必須可從 Weblate 伺服器存取。預設為 [http://localhost:11434](http://localhost:11434)；localhost 指的是執行 Weblate 的環境。 |
  | `model`                 | Ollama 模型 | 在 Ollama 模型目錄中描述的模型名稱。                                                                                                |
  | `persona`               | 翻譯者角色描述   | 描述譯者的角色或專長。例如：「您是一位經驗豐富的醫學譯者。」                                                                                        |
  | `style`                 | 翻譯風格      | 描述希望採用的翻譯風格。例如：「請使用口語化的表達方式。」                                                                                         |
  | `language_instructions` | 特定語言說明    | 輸入 JSON 物件，將 Weblate 可辨識的目標語言代碼對應至額外的翻譯指示。每份指示最多可有 1000 個字元。例如：{"de": "Use formal address."}                          |

<!-- AUTOGENERATED END: ollama -->

用 [Ollama](https://ollama.com/) 模型執行翻譯。

Ollama API 可使用本機安裝的開放原始碼模型進行翻譯，也可透過 [Ollama](https://ollama.com/) 服務遠端存取模型。請注意，設定模型之前，應先完成 [Ollama installed](https://ollama.com/download) 中的安裝步驟，並下載要使用的模型。

使用 persona 和 style 欄位進一步微調翻譯。這些將被用於 Ollama 的提示並允許您變更翻譯的風格。

服務自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

#### SEE ALSO
* [Ollama 模型](https://ollama.com/search)

<!-- AUTOGENERATED START: openai -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-openai"></a>

## OpenAI

#### Versionadded
在 5.3 版被加入.

* **服務編號:**
  `openai`
* **分數上限:**
  90
* **進階功能:**
  * [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)
  * [LLM 翻譯情境](#llm-translation-context)
* **設定:**
  | `source_language`       | 來源語言選擇            | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  |-------------------------|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `base_url`              | OpenAI API 基礎 URL | OpenAI API 的基底 URL (若與 OpenAI 預設 URL 不同)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | `model`                 | OpenAI 模型         | 選取「自動選擇」時，Weblate 會依照預先設定的優先順序清單，選用第一個可透過 API 使用的模型。<br/><br/>可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`gpt-5.6-luna` -- GPT-5.6 Luna<br/><br/>`gpt-5.4-mini` -- GPT-5.4 mini<br/><br/>`gpt-5-mini` -- GPT-5 mini<br/><br/>`gpt-5.4-nano` -- GPT-5.4 nano<br/><br/>`gpt-5-nano` -- GPT-5 nano<br/><br/>`gpt-5.6-terra` -- GPT-5.6 Terra<br/><br/>`gpt-5.4` -- GPT-5.4<br/><br/>`gpt-5` -- GPT-5<br/><br/>`gpt-5.6` -- GPT-5.6 Sol<br/><br/>`gpt-5.5` -- GPT-5.5<br/><br/>`gpt-4.1-mini` -- GPT-4.1 mini<br/><br/>`gpt-4o-mini` -- GPT-4o mini<br/><br/>`gpt-4.1-nano` -- GPT-4.1 nano<br/><br/>`gpt-4.1` -- GPT-4.1<br/><br/>`gpt-4o` -- GPT-4o<br/><br/>`gpt-4-turbo` -- GPT-4 Turbo<br/><br/>`gpt-4` -- GPT-4<br/><br/>`gpt-3.5-turbo` -- GPT-3.5 Turbo<br/><br/>`custom` -- 自訂模型 |
  | `persona`               | 翻譯者角色描述           | 描述譯者的角色或專長。例如：「您是一位經驗豐富的醫學譯者。」                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | `style`                 | 翻譯風格              | 描述希望採用的翻譯風格。例如：「請使用口語化的表達方式。」                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
  | `language_instructions` | 特定語言說明            | 輸入 JSON 物件，將 Weblate 可辨識的目標語言代碼對應至額外的翻譯指示。每份指示最多可有 1000 個字元。例如：{"de": "Use formal address."}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | `key`                   | API 金鑰            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | `custom_model`          | 自訂模型名稱            | 選取「自訂模型」時必填。請輸入 API 使用的模型識別碼。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

<!-- AUTOGENERATED END: openai -->

使用 [OpenAI](https://openai.com/) 執行翻譯。

OpenAI API 由多元模型集驅動，這些模型的能力和定價各不相同。自動選擇會選擇最佳可用模型，但您或許想要選擇相符您需求的特定模型。

自動選取或預先定義模型時，系統會查詢服務的模型清單端點。自動選取會優先使用兼顧翻譯品質、回應時間與價格的通用模型，只有在相容性需求下才會使用較舊的 GPT 模型。若使用不提供模型探索功能的 OpenAI 相容閘道，請選擇 自訂模型；Weblate 會將已設定的模型識別碼直接傳送至聊天完成端點。

使用 persona 和 style 欄位進一步微調翻譯。這些將被用於 OpenAI 的 prompt 並允許您變更翻譯的風格。

服務自動使用 [詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary)，見 [翻譯服務中的詞彙表](https://docs.weblate.org/zh-tw/latest/user/glossary.md#glossary-mt)。

#### Versionchanged
在 5.7 版的變更: 新增支援自訂模型和基礎 URL。

#### SEE ALSO
* [OpenAI 模型](https://platform.openai.com/docs/models)
* [OpenAI API 金鑰](https://platform.openai.com/api-keys)

<!-- AUTOGENERATED START: sap-translation-hub -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-sap-translation-hub"></a>

## SAP Translation Hub

* **服務編號:**
  `sap-translation-hub`
* **分數上限:**
  100
* **設定:**
  | `source_language`   | 來源語言選擇    | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|-----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL   |                                                                                                    |
  | `key`               | API 金鑰    |                                                                                                    |
  | `username`          | SAP 使用者名稱 |                                                                                                    |
  | `password`          | SAP 密碼    |                                                                                                    |
  | `enable_mt`         | 啟用機器翻譯    |                                                                                                    |
  | `domain`            | 翻譯領域      | 翻譯領域的 ID，例如 BC。若未指定領域，這個方法會在所有可用領域中搜尋翻譯。                                                           |

<!-- AUTOGENERATED END: sap-translation-hub -->

SAP 提供的機器翻譯服務。

您必須有 SAP 帳號（並已在 SAP Cloud Platform 啟用 SAP Translation Hub），才能使用此服務。

除了術語資料庫，您還可以設定是否使用機器翻譯服務。

#### NOTE
要存取 Sandbox API，您需要設定 `url` 和 `key`.

為了存取正式環境的 API，您需要設定 `url`, `username` 與 `password`。

#### SEE ALSO
* [什麼是 SAP Translation Hub](https://help.sap.com/docs/translation-hub/sap-translation-hub/what-is-sap-translation-hub)
* [SAP Translation Hub API](https://api.sap.com/api/translationhub/overview)

<!-- AUTOGENERATED START: systran -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-systran"></a>

## Systran

* **服務編號:**
  `systran`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: systran -->

Systran 提供的機器翻譯服務。

這項服務使用 API，您需要從 <[https://translate.systran.net/en/account](https://translate.systran.net/en/account)> 取得 API 金鑰。

<!-- AUTOGENERATED START: tmserver -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-tmserver"></a>

## tmserver

* **服務編號:**
  `tmserver`
* **分數上限:**
  100
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `url`               | API URL  |                                                                                                    |

<!-- AUTOGENERATED END: tmserver -->

使用 tmserver 協議您可以執行自己的翻譯記憶伺服器。

* 原始的 **tmserver** 和 translate-toolkit 捆綁在一起。
* amaGama 伺服器是增強版 tmserver。

#### NOTE
目前似乎沒有針對這個的受維護的伺服器。

<!-- AUTOGENERATED START: weblate -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-weblate"></a>

## Weblate

* **服務編號:**
  `weblate`
* **分數上限:**
  100
* **設定:**
  此服務無設定。

<!-- AUTOGENERATED END: weblate -->

Weblate 機器翻譯服務可根據 Weblate 目前現有字串中的完全相符結果提供翻譯；這些字串必須處於 已翻譯、已核准 或 唯讀 [狀態](https://docs.weblate.org/zh-tw/latest/workflows.md#states)。

<!-- AUTOGENERATED START: weblate-translation-memory -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-weblate-translation-memory"></a>

## Weblate 翻譯記憶

* **服務編號:**
  `weblate-translation-memory`
* **分數上限:**
  100
* **設定:**
  此服務無設定。

<!-- AUTOGENERATED END: weblate-translation-memory -->

使用 [翻譯記憶](https://docs.weblate.org/zh-tw/latest/admin/memory.md#translation-memory) 作為機器翻譯服務。任何過去翻譯過的字串（或上傳到翻譯記憶）都可以用這種方式翻譯。此建議源可用於模糊相符。

#### NOTE
重新建立 [翻譯記憶](https://docs.weblate.org/zh-tw/latest/admin/memory.md#translation-memory) 會降低此機器翻譯服務的能力。

<!-- AUTOGENERATED START: yandex -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-yandex"></a>

## Yandex

* **服務編號:**
  `yandex`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: yandex -->

Yandex 提供的機器翻譯服務。

這項服務使用翻譯 API，您需要從 Yandex 得到 API 金鑰。

#### SEE ALSO
* [Yandex Translate API](https://yandex.com/dev/translate/)

<!-- AUTOGENERATED START: yandex-v2 -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-yandex-v2"></a>

## Yandex v2

#### Versionadded
在 5.1 版被加入.

* **服務編號:**
  `yandex-v2`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇   | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|----------|----------------------------------------------------------------------------------------------------|
  | `key`               | API 金鑰   |                                                                                                    |

<!-- AUTOGENERATED END: yandex-v2 -->

Yandex 提供的機器翻譯服務。

這項服務使用翻譯 API，您需要從 Yandex Cloud 得到 API 金鑰。

#### SEE ALSO
* [Yandex Translate API v2](https://aistudio.yandex.ru/docs/en/translate/api-ref/authentication.html)

<!-- AUTOGENERATED START: youdao-zhiyun -->
<!-- This section is automatically generated by `./manage.py list_machinery`. Do not edit manually. -->

<a id="mt-youdao-zhiyun"></a>

## Youdao Zhiyun

* **服務編號:**
  `youdao-zhiyun`
* **分數上限:**
  90
* **設定:**
  | `source_language`   | 來源語言選擇           | 可用的選擇：<br/><br/>`auto` -- 自動選擇<br/><br/>`source` -- 組件來源語言<br/><br/>`secondary` -- 專案或組件中定義的次要語言   |
  |---------------------|------------------|----------------------------------------------------------------------------------------------------|
  | `key`               | 用戶端 ID           |                                                                                                    |
  | `secret`            | 用戶端秘密金鑰 (secret) |                                                                                                    |

<!-- AUTOGENERATED END: youdao-zhiyun -->

有道提供的機器翻譯服務。

這項服務使用 API，您需要從有道獲得 ID 和 API 金鑰。

#### SEE ALSO
[有道智雲自然語言翻譯服務](https://ai.youdao.com/product-fanyi-text.s)

<a id="custom-machinery"></a>

## 自訂機器翻譯

您也可以使用幾行 Python 程式碼來實作自己的機器翻譯服務。將程式碼放在 Weblate 可以匯入的模組中 （請參閱 [建立 Python 模組](https://docs.weblate.org/zh-tw/latest/admin/customize.md#custom-module) 或 [自訂程式碼](https://docs.weblate.org/zh-tw/latest/admin/install/docker.md#docker-python-override)） 並新增完整限定類別名稱至 [`WEBLATE_MACHINERY`](https://docs.weblate.org/zh-tw/latest/admin/config.md#std-setting-WEBLATE_MACHINERY)。

<a id="machinery-rate-limit-window"></a>

Weblate 偵測到速率限制或特定服務失敗後，會由服務類別的 `rate_limit_window` 屬性控制冷卻時間，預設為 1800 秒。若服務傳回重試延遲，Weblate 會改用該值：優先採用 `retry-after-ms`，其次是 `Retry-After`（秒數或 HTTP 日期），最後是 Google `RetryInfo` 詳細資訊。無效的延遲會略過；有效延遲可短於或長於服務預設值。

有文件說明短期流量限制的服務可以覆寫預設值；例如，在服務類別加入 `rate_limit_window = 60`，即可在一分鐘後重試。翻譯與改寫使用相同的冷卻時間長度，但各自維護冷卻狀態。

內建的 Alibaba、Amazon Translate、Anthropic、Baidu、Google Cloud Translation Basic 與 Advanced、LibreTranslate、Mistral、OpenAI 及 Azure OpenAI 服務使用 60 秒冷卻時間，其他服務則保留預設值。

冷卻時間結束後可以再次發出請求，但不保證每日或計費配額已重設。為服務設定的自訂端點也適用此冷卻時間。已快取的冷卻狀態仍會在原定時間到期。

```python
"""
Machine translation example.

This example uses fictional http://example.com/ service to translate the
strings.
"""

from __future__ import annotations

from typing import TYPE_CHECKING

from weblate.machinery.base import MACHINERY_DEFAULT_THRESHOLD, MachineTranslation

if TYPE_CHECKING:
    from weblate.auth.models import User
    from weblate.machinery.base import DownloadTranslations
    from weblate.trans.models import Unit


class SampleTranslation(MachineTranslation):
    """Sample machine translation interface."""

    name = "Sample"

    def download_languages(self) -> list[str]:
        """Return list of languages your machine translation supports."""
        response = self.request("get", "http://example.com/languages")
        return response.json()["languages"]

    def download_translations(
        self,
        source_language: str,
        target_language: str,
        text: str,
        unit: Unit | None,
        user: User | None,
        threshold: int = MACHINERY_DEFAULT_THRESHOLD,
    ) -> DownloadTranslations:
        """Return tuple with translations."""
        response = self.request(
            "get",
            "http://example.com/translate",
            params={
                "source_language": source_language,
                "target_language": target_language,
                "text": text,
            },
        )

        for translation in response.json()["translations"]:
            yield {
                "text": translation,
                "quality": 100,
                "service": self.name,
                "source": text,
            }
```

#### SEE ALSO
* [自訂品質檢查、附加元件、翻譯服務與自動修正](https://docs.weblate.org/zh-tw/latest/admin/customize.md#custom-modules)
* [建立 Python 模組](https://docs.weblate.org/zh-tw/latest/admin/customize.md#custom-module)
* [自訂程式碼](https://docs.weblate.org/zh-tw/latest/admin/install/docker.md#docker-python-override)
