WebHooker/docs/zh/guide/i18n.md

24 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 消息语言i18n
消息按每个分组配置的语言渲染。WebHooker 内置**英文**(默认)与**简体中文**两套字典。
## 分组语言
设置 `Group.lang`(如 `"zh"`)可为分组内所有路由选择消息语言——见[分组 → 分组模式](./configuration#分组模式)。分组的 webhook 日志频道摘要使用相同的语言。
## 自定义覆盖
翻译覆盖从 KV 键 `i18n:<lang>` 读取,值为扁平的「键 → 文本」JSON 对象。内置字典en/zh中的任意键都可覆盖未提供的键回退为英文。
```jsonc
// KV 键i18n:zh
{
"events.push.title": "{repo}: 推送了 {count} 个提交到 {ref}"
}
```
覆盖对分组消息(以及适用的控制台界面)生效。要新增一种语言,可在 `i18n:<lang>` 存放完整字典——未提供的键都会回退为英文。
## 表情开关
`Group.emoji`(默认 `true`)控制该分组消息中是否显示事件表情。关闭后,标题、描述、字段与链接中的所有表情都会被去除。里程碑进度条(🟢🟡🟠⬜)属于数据可视化,不受该开关影响。