@eigenpal/docx-editor-i18n

中文文档
1.9.0发布于 2026/06/21Apache-2.0TypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 20.5万

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

此软件包已被标记为弃用

deprecated

中文使用文档
文档目录8 节
  1. 快速启动
  2. 软件包
  3. 可用地点
  4. 每个地方的子路径
  5. 类型
  6. 非反应/ 虚拟主机
  7. 捐款
  8. 商业支助

DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side.

npm version npm downloads license Demo Documentation

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

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

快速启动

npm install @eigenpal/docx-editor-i18n

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

// 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" />

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

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

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

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

软件包

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

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

可用地点

代码导出语言
enen英语( 来源)
dede德语
hehe希伯来语Name
plpl波兰语Name
pt-BRptBR葡萄牙语( 巴西)
trtr土耳其语Name
zh-CNzhCN简化中文

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

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

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

每个地方的子路径

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

// 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'),用于选择非违约进口的呼叫者.

类型

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() 适配器包外 :

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。 。 。 .

捐款

欢迎捐款。 见 捐款额 用于设置,测试,以及一次性CLA签名.

商业支助

[TIP] 问题还是习惯特征? 电子邮件 docx-编辑器@eigenpal.com。 。 。 .

版本与发布记录

@eigenpal/docx-editor-i18n 共发布 23 个版本,首次发布于 2026/05/19;过去 12 个月发布了 23 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.9.0latest2026/06/214 个月前
1.8.32026/06/204 个月前
1.8.22026/06/194 个月前
1.8.12026/06/194 个月前
1.8.02026/06/194 个月前
1.7.02026/06/184 个月前

关于 @eigenpal/docx-editor-i18n 的常见问题

@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。作者已将其标记为弃用,新项目建议寻找替代方案。