31 lines
854 B
Plaintext
31 lines
854 B
Plaintext
|
|
---
|
||
|
|
title: 编辑器本地化
|
||
|
|
description: 将内置标签和自定义 Actions 接入工作区国际化运行时。
|
||
|
|
order: 21
|
||
|
|
toc:
|
||
|
|
- id: add-the-catalog
|
||
|
|
title: 添加词典
|
||
|
|
- id: fallback
|
||
|
|
title: 回退行为
|
||
|
|
- id: custom-labels
|
||
|
|
title: 自定义标签
|
||
|
|
---
|
||
|
|
|
||
|
|
## 添加词典 {#add-the-catalog}
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"catalogSources": ["@workspace/lexical/locales/{locale}"]
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
该包提供简体中文(`zh-Hans`)和美式英语(`en-US`)编辑器词典。
|
||
|
|
|
||
|
|
## 回退行为 {#fallback}
|
||
|
|
|
||
|
|
内置控件跟随当前 `@workspace/i18n` Provider。在 Provider 外部会回退为英文,使编辑器在独立预览和测试中仍可使用。
|
||
|
|
|
||
|
|
## 自定义标签 {#custom-labels}
|
||
|
|
|
||
|
|
外部 Action 标签可以是普通字符串,也可以是包含 `id` 和 `message` 的消息描述符。描述符会参与和应用文案相同的提取流程。
|