# 使用 Apple 翻译服务

{% hint style="warning" %}
快捷指令有时候不稳定，操作频率过快或某些特殊情况，可能导致翻译失效。

如果遇到一直提示操作不允许或卡住的情况，请转至文末查看问题解决办法。
{% endhint %}

在最新版本中，HapiGo 支持了 Apple 翻译服务。此服务由 macOS 本地机器学习模型（因此仅支持 macOS 11 以上）提供翻译结果，可以免费无限量使用。

### 安装快捷指令

系统翻译服务仅提供快捷指令一种接口，所以在开始使用 Apple 翻译前，我们需要安装[翻译快捷指令](https://www.icloud.com/shortcuts/05e2e750f57f46e48b6a7f7f3fe9bbec)。

{% embed url="<https://www.icloud.com/shortcuts/05e2e750f57f46e48b6a7f7f3fe9bbec>" %}

打开快捷指令链接后，点击「获取捷径」，然后安装。如果加载缓慢，可以试一下开启🪜。

### 添加&授权

安装好后，我们就可以按下翻译快捷键 Option+D 进行划词或输入翻译了。如果翻译窗口中没有 Apple 翻译服务，可以点击右上角齿轮菜单进行勾选。

第一次使用时，快捷指令会需要你授权。在弹出的授权窗口右下角，点击「始终允许」即可。如果点错了，可以删除重新安装一遍。

<figure><img src="/files/0GUU7pcZy17lvGM1QAi0" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
HapiGo 通过快捷指令的名称进行调用，因此编辑 HapiGo Translation 快捷指令的名称会导致 HapiGo 翻译失效。如需研究学习，可复制一份进行编辑。
{% endhint %}

### 问题解决

#### 问题一：操作不允许

如果按照上文操作已经给到了快捷指令「始终允许」的权限，但是在进行翻译时仍然提示「操作不允许」，此可能是因为 Apple 翻译所用到的 2 个链接被代理🪜了。解决办法是将这 2 个链接添加到代理应用的直连规则中。具体操作，大家自行参考自己所用代理应用的帮助手册。

链接：<mark style="color:blue;">sequoia.apple.com</mark> & <mark style="color:blue;">seed-sequoia.siri.apple.com</mark>

#### 问题二：顶部菜单栏快捷指令卡住

如文首所述，系统翻译有时候可能不稳定。常见的情况就是在顶部菜单栏显示实心快捷指令图标，点开可以看到翻译任务卡住了，等很久也不会有任何进展。

此时，我们需要手动退出翻译进程。打开 HapiGo 主面板，输入关键词「kill」，按 tab 键进入「退出应用与进程」扩展。搜索「translationd」进程，回车关闭该进程即可。

<figure><img src="/files/aFteyo5PQRaCjFwBEKRV" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-cn.hapigo.com/extention/translate/apple.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
