> For the complete documentation index, see [llms.txt](https://docs.myarc.icu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.myarc.icu/gong-neng-pei-zhi/languages.md).

# 语言管理

ArcMenu 的命令提示、管理操作反馈与控制台日志都由语言文件驱动，同时你也可以通过内置的语言占位符让菜单界面中的文本随玩家语言自动切换。插件默认内置了简体中文（`zh_CN.yml`）和英文（`en_US.yml`），所有语言文件都存放在 `plugins/ArcMenu/languages/` 目录下。

## 配置默认语言与客户端跟随

在 `plugins/ArcMenu/config.yml` 的 `language` 部分，你可以设置服务器的默认语言以及是否跟随玩家客户端的语言设置：

```yaml
language:
  default: zh_CN
  follow-player-locale: true
```

这两个字段的填写规则如下：

* `default`：填写 `languages/` 目录下对应的语言代码（去掉 `.yml` 后缀，例如 `zh_CN` 或 `en_US`）。服务端控制台日志，以及未能匹配到专属语言的玩家消息，都会使用这里指定的语言。
* `follow-player-locale`：填写布尔值 `true` 或 `false`，默认值为 `true`。
  * 设为 **`true`** 时，插件会根据每位玩家 Minecraft 客户端所选的语言，自动在 `languages/` 目录中匹配对应的语言文件（例如英文客户端显示 `en_US.yml`，中文客户端显示 `zh_CN.yml`）。同一语种（如 `en_GB` 匹配 `en_US`）也会自动参与匹配。
  * 设为 **`false`** 时，无论玩家客户端设置成什么语言，所有玩家收到的插件提示与语言占位符内容都会统一使用 `default` 指定的语言。

如果你希望服务器上的所有玩家始终看到统一的简体中文内容，可以这样配置：

```yaml
language:
  default: zh_CN
  follow-player-locale: false
```

## 在菜单中使用多语言文本

除了直接在菜单配置文件里编写固定文字，你还可以把菜单的标题、按钮文字或提示框说明写进语言文件，并在菜单中通过内置的 `%arcmenu_lang_<键名>%` 占位符调用。这项功能由 ArcMenu 原生解析，无需安装 PlaceholderAPI（插件自带的示例菜单也使用了如 `%arcmenu_lang_samples.default-menu-001%` 这样的多语言键）。

例如，先在 `languages/zh_CN.yml` 和 `languages/en_US.yml` 中添加嵌套键 `menus.guide.title`：

```yaml
# languages/zh_CN.yml
menus:
  guide:
    title: '&e服务器生存指南'
```

```yaml
# languages/en_US.yml
menus:
  guide:
    title: '&eServer Survival Guide'
```

然后在菜单配置的前端文字或提示框中引用该键名：

```yaml
frontend:
  title-text:
    type: text
    content: '%arcmenu_lang_menus.guide.title%'
```

当 `follow-player-locale` 设为 `true` 时，中文与英文客户端玩家打开同一张菜单就会各自看到对应语言的文本。

## 修改现有翻译与添加新语言

如果你想调整某条提示语的措辞或颜色，可以直接打开 `plugins/ArcMenu/languages/zh_CN.yml` 进行编辑。修改时请保留消息文本中的 `{0}`、`{1}` 等占位参数标记，它们会在运行时自动替换为菜单名称、坐标或数量等具体信息。

如果你想为服务器新增其他语言支持（例如法语或日语）：

1. 复制 `languages/zh_CN.yml` 或 `en_US.yml`。
2. 将新文件按标准的“语言\_地区”代码重命名，例如 `fr_FR.yml` 或 `ja_JP.yml`。
3. 翻译文件中的消息条目与自定义菜单词条。如果个别条目暂未翻译，插件会自动使用 `default` 默认语言或内置词条补齐。
4. 保存文件后，执行 `/arcmenu reload` 即可生效。

语言文件既负责插件自身的命令与系统提示，也能通过 `%arcmenu_lang_<键名>%` 为菜单界面提供多语言词条。可视化编辑器（ArcMenu Editor）的界面语言则会自动跟随你在游戏客户端中选择的语言。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.myarc.icu/gong-neng-pei-zhi/languages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
