# @eigenpal/docx-editor-i18n 中文文档

规范地址：https://npmcn.com/package/%40eigenpal/docx-editor-i18n/

版本：1\.9\.0
npm 元数据更新时间：2026-06-29T21:04:38.359Z
中文译文更新时间：2026-11-13T09:38:08.432Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40eigenpal/docx-editor-i18n
原文对照：https://npmcn.com/package/%40eigenpal/docx-editor-i18n/?lang=original
项目主页：https://docx-editor.dev/
源码仓库：https://github.com/eigenpal/docx-editor

弃用说明：deprecated

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.4 MB，47 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2026-05-19T10:09:18.632Z
- 最新版本发布：2026-06-21T15:55:15.746Z
- 近 30 天下载量：204838（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：23（近 12 个月 23 个）

## 中文简介

共享用于 @eigenpal docx- editor 适配器( React and Vue) 的 UI 本地化字符串和类型 .

## 安装

```sh
npm install @eigenpal/docx-editor-i18n
```

也可以使用：`pnpm add @eigenpal/docx-editor-i18n`、`yarn add @eigenpal/docx-editor-i18n`、`bun add @eigenpal/docx-editor-i18n`

## README

[![DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side.](https://raw.githubusercontent.com/eigenpal/docx-editor/main/.github/assets/header.png)](https://www.docx-editor.dev/)

[![npm version](https://img.shields.io/npm/v/@eigenpal/docx-editor-i18n.svg?style=flat-square&color=3B5BDB)](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) [![npm downloads](https://img.shields.io/npm/dm/@eigenpal/docx-editor-i18n.svg?style=flat-square&color=3B5BDB)](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) [![license](https://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat-square&color=3B5BDB)](https://github.com/eigenpal/docx-editor/blob/main/LICENSE) [![Demo](https://img.shields.io/badge/Live_Demo-3B5BDB?style=flat-square&logo=vercel&logoColor=white)](https://docx-editor.dev/editor) [![Documentation](https://img.shields.io/badge/Docs-3B5BDB?style=flat-square&logo=readthedocs&logoColor=white)](https://www.docx-editor.dev/docs)

# @eigenpal/docx-editor-i18n (英语)

共享区域字符串、类型和运行时间助手 [docx 编辑器](https://docx-editor.dev/) 适应器. 翻译的真相来源 `@eigenpal/docx-editor-react` 财务报告和审定财务报表 `@eigenpal/docx-editor-vue`。 。 。 .

## 快速启动

```bash
npm install @eigenpal/docx-editor-i18n
```

将一个打入的语境传递给编辑器 `i18n` 道具 :

```tsx
// React
import { de } from '@eigenpal/docx-editor-i18n';
<DocxEditor documentBuffer={file} i18n={de} />

// Vue
import { de } from '@eigenpal/docx-editor-i18n';
<DocxEditor :document-buffer="file" :i18n="de" />
```

将社区语言与自定义覆盖相混合 :

```ts
import { de } from '@eigenpal/docx-editor-i18n';

const myLocale = {
  ...de,
  toolbar: { ...de.toolbar, bold: 'Fettdruck' },
};
```

密钥设置到 `null` 在任何一个地方, 回到英语.

## 软件包

| 软件包 | 说明 |
| --- | --- |
| [`@eigenpal/docx-editor-react`](https://www.npmjs.com/package/@eigenpal/docx-editor-react) | ![](https://cdn.simpleicons.org/react/61DAFB)   反应适配器. 工具栏 页面编辑器 插件. |
| [`@eigenpal/docx-editor-vue`](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) | ![](https://cdn.simpleicons.org/vuedotjs/4FC08D)   Vue 3适配器. 工具栏 页面编辑器 插件. |
| [`@eigenpal/docx-editor-core`](https://www.npmjs.com/package/@eigenpal/docx-editor-core) | 框架-不可知核:OOXML 解析器,序列器,布局引擎,ProseMirror schema. 取决于此, 如果您要叉出反应或 Vue 适配器 . |
| [`@eigenpal/docx-editor-i18n`](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) | 两个适配器消耗的共享地块串和类型. |
| [`@eigenpal/docx-editor-agents`](https://www.npmjs.com/package/@eigenpal/docx-editor-agents) | 代理SDK和聊天UI:框架-不可知桥,MCP服务器,AI SDK适配器,外加React UI. |

> **伪造适配器?** 取出叉子细. 取决于 `@eigenpal/docx-editor-core` 直接如此解析器,序列器, 和渲染自动修复您的建筑中的地块, 不回转每个上游变化的手.

## 可用地点

| 代码 | 导出 | 语言 |
| --- | --- | --- |
| `en` | `en` | 英语( 来源) |
| `de` | `de` | 德语 |
| `he` | `he` | 希伯来语Name |
| `pl` | `pl` | 波兰语Name |
| `pt-BR` | `ptBR` | 葡萄牙语( 巴西) |
| `tr` | `tr` | 土耳其语Name |
| `zh-CN` | `zhCN` | 简化中文 |

BCP-47 代码(`pt-BR`, (中文(简体) ), `zh-CN`(a) 使用骆驼Case JS标识符(`ptBR`, (中文(简体) ), `zhCN`) (中文(简体) ). 以标签搜索运行时间 :

```ts
import { locales } from '@eigenpal/docx-editor-i18n';
<DocxEditor i18n={locales[userPreferredLocale]} />
```

> 导入 `locales` 把每个地方都拉入你的包里 对于更小的捆绑,只进口需要的名字; `sideEffects: false` 让剩下的树摇倒地.

## 每个地方的子路径

对于在跑步时间选择地产的应用,上面命名的出口不会被树震——捆绑者无法知道哪个地产胜出,所以将其全部运走. 使用每个本地的子路径代替 。 每个都将一个单一的地块(~30KB)和代码分割干净地捆绑:

```ts
// Static — bundler ships only this locale's strings
import pl from '@eigenpal/docx-editor-i18n/pl';

// Dynamic — splits into its own chunk, loaded on demand
const pl = (await import('@eigenpal/docx-editor-i18n/pl')).default;
```

每个地方的子路径船: `/en`, (中文(简体) ), `/de`, (中文(简体) ), `/he`, (中文(简体) ), `/pl`, (中文(简体) ), `/pt-BR`, (中文(简体) ), `/tr`, (中文(简体) ), `/zh-CN`。每个单位还出口其用地作为命名的约束(`import { pl } from '@eigenpal/docx-editor-i18n/pl'`),用于选择非违约进口的呼叫者.

## 类型

```ts
import type {
  LocaleStrings, // shape of `en`, the full source of truth
  PartialLocaleStrings, // shape of a community partial (null falls back)
  Translations, // alias for PartialLocaleStrings
  TranslationKey, // 'toolbar.bold' | 'dialogs.findReplace.title' | ...
  LocaleCode, // 'en' | 'de' | 'pt-BR' | ...
  TFunction, // signature of the `t()` callback
} from '@eigenpal/docx-editor-i18n';
```

## 非反应/ 虚拟主机

构建已键入 `t()` 适配器包外 :

```ts
import { createT, deepMerge, en, de, type LocaleStrings } from '@eigenpal/docx-editor-i18n';

const merged = deepMerge(en, de) as LocaleStrings;
const t = createT(merged, 'de');
t('toolbar.bold'); // 'Fett'
t('dialogs.findReplace.matchCount', { current: 3, total: 15 }); // ICU plurals
```

`en.json` 是真理的来源。 在此添加密钥, 然后运行 `bun run i18n:fix` 从 repo 根到同步社区地块( 新密钥土地为 `null`) (中文(简体) ). 全向导 : [文件/i18n.md](https://github.com/eigenpal/docx-editor/blob/main/docs/i18n.md)。 。 。 .

## 捐款

欢迎捐款。 见 [捐款额](https://github.com/eigenpal/docx-editor/blob/main/CONTRIBUTING.md) 用于设置,测试,以及一次性CLA签名.

## 商业支助

> \[TIP\] 问题还是习惯特征? 电子邮件 **[docx-编辑器@eigenpal.com](mailto:docx-editor@eigenpal.com)**。 。 。 .

## 常见问题

### @eigenpal/docx-editor-i18n 是什么？

共享用于 @eigenpal docx- editor 适配器\( React and Vue\) 的 UI 本地化字符串和类型 \.注意：该包已被作者标记为弃用——deprecated

### 如何安装 @eigenpal/docx-editor-i18n？

在项目目录运行 npm install @eigenpal/docx-editor-i18n，或使用 pnpm add / yarn add / bun add。

### @eigenpal/docx-editor-i18n 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @eigenpal/docx-editor-i18n 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @eigenpal/docx-editor-i18n 可以商用吗？

@eigenpal/docx-editor-i18n 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @eigenpal/docx-editor-i18n 的下载量有多少？

根据 npm 官方下载统计，@eigenpal/docx-editor-i18n 在 2026/10/13 – 2026/11/11 这 30 天内被下载 204,838 次，日均约 6,828 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @eigenpal/docx-editor-i18n 还在维护吗？

最新版本 1\.9\.0 发布于 2026/06/21（4 个月前）；至今共发布 23 个版本，其中过去 12 个月发布了 23 个；首次发布于 2026/05/19。作者已将其标记为弃用，新项目建议寻找替代方案。

